Skip to main content

Crate klieo_tools_mcp

Crate klieo_tools_mcp 

Source
Expand description

MCP adapter — exposes remote MCP servers’ tools as klieo_core::Tool implementations.

Connect to an MCP server via stdio (subprocess), pull its tool catalogue, and register the wrapped tools with a klieo_tools::ChainedInvoker alongside native #[tool]-derived tools.

Each remote tool surfaces as mcp:<server_id>.<original_name>.

§Transports

  • stdio (subprocess) — spawn an MCP server as a child process, pump JSON-RPC over its stdin/stdout. Production default. Backed by the official rmcp SDK’s TokioChildProcess transport.
  • streamable HTTP (http feature) — connect to a REMOTE MCP server over the network. https-only (loopback http permitted for local dev), with env-var-sourced auth headers and bounded timeouts. Backed by rmcp’s reqwest streamable-HTTP client transport. See McpToolset::connect_http.
  • SSE transport is out of scope; a follow-up plan adds it.

§Limitations

  • No tool-list refresh. Tools are queried once at connect time; if the server adds new tools later, reconnect to pick them up.
  • Stdio subprocess hardening. Stdin/stdout pipes only; stderr is inherited so server diagnostics surface in the parent. Working directory and env are caller-supplied.

Re-exports§

pub use toolset::McpServerId;
pub use toolset::McpToolset;
pub use toolset::StdioConnectOptions;

Modules§

toolset
McpToolset — connect to an MCP server, return a Vec<Arc<dyn Tool>>.

Structs§

HttpConnectOptions
Connection options for crate::McpToolset::connect_http.

Constants§

MCP_PROTOCOL_VERSION
MCP protocol revision advertised on the initialize handshake.