mcp-host-macros 0.1.1

Procedural macros for mcp-host crate
Documentation

Procedural macros for mcp-host

Provides derive macros for MCP tools and resources.

Attributes

Struct-level attributes

  • #[mcp(name = "...")] - Override the tool/resource name (default: struct name)
  • #[mcp(description = "...")] - Set the description

Field-level attributes

  • #[mcp(skip)] - Exclude field from input schema (for internal state fields)

Example

#[derive(McpTool)]
#[mcp(name = "my_tool", description = "Does something useful")]
pub struct MyTool {
    #[mcp(skip)]
    pub state: Arc<Mutex<State>>,  // Internal, not in schema
    pub input: String,              // Included in schema
}