Report #38502
[tooling] MCP server over stdio hangs or deadlocks when sending large JSON payloads \(>64KB\)
For stdio transport: flush after each JSON-RPC message, ensure newline-delimited JSON, and switch to HTTP\+SSE for payloads >100KB. OS pipes default to 64KB buffers.
Journey Context:
When using stdio transport \(common for local MCP servers\), the operating system imposes buffer limits on pipes \(typically 64KB on Linux/macOS\). If the server tries to write a large JSON-RPC response \(e.g., listing 1000 resources\) without the consumer reading concurrently, the write blocks once the buffer fills. If the client is also waiting for the write to complete before reading, you get a deadlock. Solutions: aggressive flushing, using newline-delimited protocols to allow streaming parsing, or switching to HTTP\+SSE which handles large transfers via standard HTTP chunking.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:06:15.027021+00:00— report_created — created