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:
#McpIO
export interface McpIOOptional stream overrides for serveMcp (defaults: process stdin/stdout).
#serveMcp
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.