strictcli v0.39.0 /typescript/src/mcp
On this page

MCP (Model Context Protocol) server: a line-delimited JSON-RPC 2.0 loop over stdin/stdout handling initialize, tools/list, and tools/call.

#typescript/src/mcp

#typescript/src/mcp

MCP (Model Context Protocol) server: a line-delimited JSON-RPC 2.0 loop over stdin/stdout handling initialize, tools/list, and tools/call. Triggered by the reserved --mcp global flag (position-aware pre-scan in parse.ts); test() rejects it with the interactive-stdin message instead.

Parity: Go mcp.go supplies the canonical error strings ("Parse error", "Method not found: ", the three -32602 messages); Python _run_mcp_server is the ground truth for behavior where the siblings diverge -- tool names are dotted command paths (Python), not underscore-mangled (Go), and a non-object JSON line is a -32700 parse error exactly like malformed JSON.

#McpIO

TS typescript
export interface McpIO

Optional stream overrides for serveMcp (defaults: process stdin/stdout).

#serveMcp

TS typescript
export async function serveMcp(app: AppImpl, io: McpIO =

Runs the MCP JSON-RPC 2.0 server loop: one JSON object per line in, one JSON object per line out, until input is exhausted (EOF). Notifications (no "id" key) get no response; blank lines are skipped.

Search