Expand description
MCP transport — #[mcp] mounts tools on the existing HTTP transport.
Unlike HTTP / GraphQL / Queue / Schedule, this crate ships no McpModule
and no Transport impl. MCP is not a transport, it is a graft on
HttpTransport (the same pattern as WS): #[mcp] on a struct emits an
endpoint() factory that mounts under the HTTP server. Apps activate MCP
by listing the #[mcp]-decorated provider — no <Transport>Module
activation seam to import.
Re-exports§
pub use rmcp::schemars;
Structs§
- Allow
AllMcp Guard - Opt-in counterpart to the default deny-all. An MCP endpoint mounted without
an
McpOperationGuardfails closed (deny-all) — so a genuinely public tool must declare that intent by wiring this guard asdyn McpOperationGuard. It admits every request unchanged; authorization, if any, is left to the tool. Reach for it only when the tool surface is deliberately public (no claims, no row-level data) — never to silence the deny-all on an endpoint that should authenticate. - Call
Tool Result - The result of a tool call operation.
- Local
Session Manager - McpError
- Error information for JSON-RPC error responses.
- Parameters
- Parameter extractor for tools and prompts
- Streamable
Http Server Config - Streamable
Http Service - Streamable HTTP server
- Tool
Router
Traits§
- McpOperation
Guard - Authenticates an MCP HTTP request before the streamable handler runs. Bind
with
providers = [MyBridge as dyn McpOperationGuard]. - Server
Handler
Functions§
- endpoint
factoryruns on every new MCP session, so per-session state stays fresh.- endpoint_
with_ guard
Type Aliases§
Attribute Macros§
- mcp
- Mark a struct as an MCP server handler that self-mounts over HTTP.
- tool
- tool
- tool_
handler - tool_handler
- tool_
router - tool_router