Skip to main content

Crate nest_rs_mcp

Crate nest_rs_mcp 

Source
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§

AllowAllMcpGuard
Opt-in counterpart to the default deny-all. An MCP endpoint mounted without an McpOperationGuard fails closed (deny-all) — so a genuinely public tool must declare that intent by wiring this guard as dyn 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.
CallToolResult
The result of a tool call operation.
LocalSessionManager
McpError
Error information for JSON-RPC error responses.
Parameters
Parameter extractor for tools and prompts
StreamableHttpServerConfig
StreamableHttpService
Streamable HTTP server
ToolRouter

Traits§

McpOperationGuard
Authenticates an MCP HTTP request before the streamable handler runs. Bind with providers = [MyBridge as dyn McpOperationGuard].
ServerHandler

Functions§

endpoint
factory runs on every new MCP session, so per-session state stays fresh.
endpoint_with_guard

Type Aliases§

BoxFuture
Content

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