Expand description
The in-process MCP server.
Holds a registry of Tool implementations and dispatches JSON-RPC
requests to them. Transport is OUT of scope here - this type is a pure
request/response router. The mcp::orchestration module wires dispatch
calls to the mcp_message control-request arm of Client::handle_control.
Re-exportsΒ§
use std::collections::BTreeMap;πuse std::sync::Arc;πuse tracing::debug;πuse tracing::warn;πuse crate::mcp::protocol::JsonRpcRequest;πuse crate::mcp::protocol::JsonRpcResponse;πuse crate::mcp::protocol::JsonRpcResult;πuse crate::mcp::protocol::LATEST_PROTOCOL_VERSION;πuse crate::mcp::protocol::McpError;πuse crate::mcp::protocol::SUPPORTED_PROTOCOL_VERSIONS;πuse crate::mcp::protocol::ServerInfo;πuse crate::mcp::protocol::ToolDescription;πuse crate::mcp::tool::Tool;πuse crate::mcp::tool::ToolInput;πuse crate::mcp::tool::ToolOutput;π
StructsΒ§
- McpServer
- A fully-constructed MCP server. Clone is cheap (just bumps Arcs).
- McpServer
Builder - Builder for
McpServer.
EnumsΒ§
- Negotiated π
- What the clientβs requested version resolved to. Kept distinct from the
answered string because an unsupported version and a missing one are
different events:
protocolVersionis required, so the latter is a broken client rather than a negotiation outcome.
FunctionsΒ§
- classify_
protocol_ πversion - negotiate_
protocol_ πversion - Echo the clientβs requested protocol version when we speak it, else answer with our latest - the specβs SHOULD for an unsupported request.