aarondb/mcp/stdio
mcp/stdio — local MCP stdio transport
Runs the supported MCP surface as newline-delimited JSON-RPC over stdin and stdout. stdout carries protocol responses only; diagnostics use stderr.
Lifecycle and flow control
This is a local child-process adapter. It accepts one complete line, handles
it synchronously, writes at most one response, then reads the next line.
There is no request queue, concurrent execution, or partial-result mode: a
slow tool call applies backpressure through stdin. EOF is the supported
shutdown signal. notifications/initialized and
notifications/cancelled are accepted notifications and deliberately write
no response. Cancellation cannot interrupt an already-running synchronous
call; hosts should stop the child process if they need hard cancellation.
Values
pub fn parse_request(
line: String,
) -> Result(server.JsonRpcRequest, json.DecodeError)
pub fn serve(db: process.Subject(transactor.Message)) -> Nil
Serve one JSON-RPC request per stdin line until EOF.
pub fn serve_line(
db: process.Subject(transactor.Message),
line: String,
) -> option.Option(server.JsonRpcResponse)
Decode and synchronously handle one stdin line.
A request produces Some(response). JSON-RPC notifications intentionally
produce None, including malformed notifications only when they cannot be
identified as notifications.