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
rmcpSDK’sTokioChildProcesstransport. - streamable HTTP (
httpfeature) — connect to a REMOTE MCP server over the network.https-only (loopbackhttppermitted for local dev), with env-var-sourced auth headers and bounded timeouts. Backed byrmcp’s reqwest streamable-HTTP client transport. SeeMcpToolset::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 aVec<Arc<dyn Tool>>.
Structs§
- Http
Connect Options - Connection options for
crate::McpToolset::connect_http.
Constants§
- MCP_
PROTOCOL_ VERSION - MCP protocol revision advertised on the
initializehandshake.