Skip to main content

nest_rs_mcp/
lib.rs

1//! MCP transport — `#[mcp]` mounts tools on the existing HTTP transport.
2//!
3//! Unlike HTTP / GraphQL / Queue / Schedule, this crate ships no `McpModule`
4//! and no `Transport` impl. MCP is **not a transport**, it is a graft on
5//! `HttpTransport` (the same pattern as WS): `#[mcp]` on a struct emits an
6//! `endpoint()` factory that mounts under the HTTP server. Apps activate MCP
7//! by listing the `#[mcp]`-decorated provider — no `<Transport>Module`
8//! activation seam to import.
9
10mod allow_guard;
11mod deny_guard;
12mod endpoint;
13mod guard;
14
15pub use allow_guard::AllowAllMcpGuard;
16pub use endpoint::{endpoint, endpoint_with_guard};
17pub use guard::{BoxFuture, McpOperationGuard};
18
19pub use rmcp::handler::server::router::tool::ToolRouter;
20pub use rmcp::handler::server::wrapper::Parameters;
21pub use rmcp::model::{CallToolResult, Content};
22pub use rmcp::{ErrorData as McpError, ServerHandler, schemars, tool, tool_handler, tool_router};
23
24pub use rmcp::transport::streamable_http_server::session::local::LocalSessionManager;
25pub use rmcp::transport::streamable_http_server::{
26    StreamableHttpServerConfig, StreamableHttpService,
27};
28
29pub use nest_rs_mcp_macros::mcp;