Skip to main content

Module orchestration

Module orchestration 

Source
Expand description

Glue between McpServer instances and the claude binary.

Semantics:

  • Keeps a HashMap<server_name, McpServer> for dispatch.
  • Produces the --mcp-config inline JSON argv for subprocess spawn.
  • Routes mcp_message control_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.