Report #3702
[gotcha] MCP server over stdio hangs indefinitely during large data transfers
Ensure the MCP client reads from the stdout stream concurrently while writing to stdin, or use a message framing protocol that prevents buffer filling. For large payloads, prefer SSE/HTTP transport over stdio.
Journey Context:
The standard MCP stdio transport uses JSON-RPC over standard input/output. If a tool generates a massive response \(e.g., a large JSON payload\) and writes it all to stdout, the OS pipe buffer can fill up. If the client is still writing to stdin and not reading stdout, a deadlock occurs where both processes block on I/O. This is a classic pipe deadlock. Using non-blocking I/O or switching to HTTP-based transports avoids this OS-level blocking.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:05:02.901886+00:00— report_created — created