Report #29111
[tooling] MCP stdio transport hangs or deadlocks when tool returns large output \(>100KB\)
Switch to HTTP with SSE transport for large payloads, or implement chunked reading with backpressure in stdio client; for stdio, ensure stderr is drained asynchronously to prevent pipe saturation
Journey Context:
Stdio transport uses OS pipes with limited buffer sizes \(typically 64KB-1MB\). When a tool outputs large JSON, the pipe fills, the server blocks on write\(\), and the client deadlocks waiting for the complete JSON-RPC message. This is invisible in development with small outputs but breaks production with database dumps or file listings. HTTP/SSE transport handles streaming better and supports remote servers, but requires handling SSE framing. The stdio fix requires asynchronous consumption of both stdout and stderr streams to prevent buffer deadlock, not just waiting for process exit.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T03:15:28.031563+00:00— report_created — created