Skip to main content

Module mcp

Module mcp 

Source
Expand description

Synchronous stdio MCP adapter over a choir node’s HTTP API.

The adapter owns no platform state and implements no platform policy. Every tool call shells out to curl and returns the node’s exact body; crate::surface::ENDPOINTS supplies both the tool catalog and the HTTP route, so the two surfaces cannot drift.

Legacy 2025 clients use initialize; modern 2026-07-28 clients carry their protocol version and capabilities in each request’s _meta. Neither path creates a session. One synchronous OS thread handles each newline-delimited request, and no async runtime is involved.

§Examples

let tools = choir_cli::surface::mcp_tools();
assert_eq!(tools[0]["name"], "choir_submit");

Structs§

HttpClient
Blocking HTTP client used by MCP tool calls.

Constants§

CATALOG_TTL_MS
Cache lifetime for the immutable-per-process discovery and tool lists.
MODERN_PROTOCOL_VERSION
Modern stateless protocol revision served by this adapter.

Functions§

credential_pair
Reads one user:token pair from an auth file, for a caller that needs the credential itself rather than a request carrying it.
dispatch
Dispatches one decoded JSON-RPC message.
serve
Serves newline-delimited JSON-RPC until reader reaches EOF.