rig-rmcp
MCP (Model Context Protocol) tool support for Rig, built on the rmcp SDK. Depends on rig-core only.
McpTool— one MCP server tool; convert it into arig_core::tool::DynamicTool(From) and register it wherever dynamic tools go (rig-agent'sAgentBuilder::dynamic_tool,ToolServer::dynamic_tool, or any other runtime). The dynamic tool carries a liveness probe bound to the MCP transport, so registries can retire it on disconnect.tools_from_serverconverts a whole tool list.McpClientHandler<S: rig_core::tool::ManagedToolSink>— an rmcp client handler that keeps a tool registry in sync withnotifications/tools/list_changed. rig-agent'sToolServerHandleimplementsManagedToolSink, soMcpClientHandler::new(client_info, tool_server_handle.clone()).connect(transport)is the agent usage; other runtimes implement the sink for their own registry.- Per call, an
rmcp::model::Metaplaced in the runtime'srig_core::tool::ToolContextis forwarded as the request's_meta, and the response'sstructuredContent,Meta, and rawCallToolResultare published to the context's result map for hooks (preserve_mcp_result).
The rig facade re-exports this crate as rig::tool::rmcp behind its rmcp feature.
Native-only: rmcp's ClientHandler requires Send + Sync unconditionally, which rig's wasm tool registry cannot satisfy; building for wasm32 fails with a single explanatory compile_error!.