Report #84489
[tooling] MCP stdio server deadlock when returning tool results >64KB
Implement async backpressure by draining stdin while writing to stdout, or migrate to HTTP SSE transport for payloads exceeding 64KB
Journey Context:
stdio pipes have OS buffer limits \(64KB on Linux/macOS\). When the server writes a large JSON response to stdout while the client is still sending the request body on stdin, the write blocks waiting for the pipe to drain. If the client is simultaneously blocked reading the response, deadlock occurs. Common mistake is assuming stdio is unbounded like HTTP. Alternatives considered: chunking \(complex, requires protocol changes\), temp files \(slow I/O\), HTTP SSE \(stateful but unbounded and avoids pipe buffers entirely\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:24:08.565342+00:00— report_created — created