Expand description
§PulseEngine MCP Macros
Procedural macros for the PulseEngine MCP Framework that dramatically simplify server and tool development while maintaining enterprise-grade capabilities.
§Quick Start
Create a simple MCP server with tools:
ⓘ
use pulseengine_mcp_macros::{mcp_server, mcp_tool};
#[mcp_server(name = "Hello World")]
struct HelloWorld;
#[mcp_tool]
impl HelloWorld {
/// Say hello to someone
async fn say_hello(&self, name: String) -> String {
format!("Hello, {}!", name)
}
}
§Features
- Zero Boilerplate: Focus on business logic, not protocol details
- Type Safety: Compile-time validation of tool definitions
- Auto Schema Generation: JSON schemas derived from Rust types
- Doc Comments: Function documentation becomes tool descriptions
- Progressive Complexity: Start simple, add enterprise features as needed
Attribute Macros§
- mcp_app
- Creates a complete MCP application with minimal boilerplate.
- mcp_
backend - Auto-implements the McpBackend trait with smart defaults.
- mcp_
prompt - Automatically generates MCP resource definitions from Rust functions.
- mcp_
resource - Generates MCP resource implementations from Rust functions.
- mcp_
server - Complete server generation from a simple struct.
- mcp_
tool - Automatically generates MCP tool definitions from Rust functions.
- mcp_
tools - Derives MCP tool implementations for all methods in an impl block.