Skip to main content

serve_stdio

Function serve_stdio 

Source
pub fn serve_stdio(db_path: &str, tenant: &str) -> Result<()>
Expand description

Serve MCP over stdio: read newline-delimited JSON-RPC from stdin, write responses to stdout. Blocks until stdin closes. Synchronous by design — one request in flight at a time.

All store reads/writes are scoped to tenant (ADR 0004 §D3): the reader is bound to a single tenant for its whole session and never reads or writes across the boundary. Single-operator runs pass the default tenant, so behavior is unchanged.

§Errors

Returns an std::io::Error if reading stdin or writing stdout fails.