Expand description
Glue between McpServer instances and the claude binary.
Semantics:
- Keeps a
HashMap<server_name, McpServer>for dispatch. - Produces the
--mcp-configinline JSON argv for subprocess spawn. - Routes
mcp_messagecontrol_requests to the right server.
No transport ownership: servers are in-process, dispatch is a direct method call.
Re-exportsยง
use std::collections::HashMap;๐use crate::mcp::McpServer;๐use crate::mcp::protocol::JsonRpcRequest;๐use crate::mcp::protocol::JsonRpcResponse;๐use forge_primitives::McpServerConfig;๐
Structsยง
- McpHosts ๐
- Registry of MCP servers (both in-process SDK and external stdio /
SSE / HTTP). Keyed by the name under which the caller registered
them via
OptionsBuilder::mcp_server/external_mcp_server.
Enumsยง
- Dispatched ๐
- Outcome of routing an
mcp_message. Kept three-way so an unroutable message cannot share a representation with a notification: the caller answers a notification with an id-less empty result, which for an unknown server would report success for something that never ran.