Skip to main content

Module mcp_client

Module mcp_client 

Source
Expand description

Minimal stdio MCP (Model Context Protocol) client for the agent.call_mcp builtin (#185). Spawns the named MCP server as a subprocess, completes the initialize handshake, then forwards a tools/call request and returns the result.

Scope:

  • One client per call (spawn-per-call). MCP servers are cheap to start; per-call spawning keeps the implementation stateless. A connection cache is a clear v2 optimization once benchmarks show it matters.
  • stdio transport only. Future transports (TCP / SSE / HTTP) can branch on a URL prefix in command later.
  • No auth; the issue body explicitly defers credential handling to a follow-up. Don’t expose this builtin to untrusted code paths until that’s done.

Structs§

McpClient