Report #13248
[tooling] MCP server hangs or truncates large JSON responses when using stdio transport
Flush stdout after every JSON-RPC message and chunk responses >64KB; switch to HTTP/SSE transport for heavy payloads like file listings or database dumps.
Journey Context:
POSIX pipes have a 64KB buffer limit \(PIPE\_BUF\). When an MCP server writes a large JSON-RPC response to stdout, the write blocks if the buffer is full, causing a deadlock with the client. Most tutorials show 'console.log\(JSON.stringify\(response\)\)' which doesn't flush. The hang appears random because it depends on response size. HTTP transport avoids this entirely by using chunked transfer encoding.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:15:35.083235+00:00— report_created — created