Report #52504
[tooling] MCP server hanging indefinitely when returning large JSON payloads over stdio
For payloads >1MB, switch to SSE \(HTTP\) transport or implement chunked reading with explicit flush; stdio pipes deadlock when buffer limits \(typically 4-64KB\) are exceeded by simultaneous writes.
Journey Context:
Stdio appears simple but relies on OS pipe buffers that block when full. If the server writes a 100KB JSON response while the client is still transmitting input, both sides block indefinitely \(classic pipe deadlock\). The MCP Python SDK explicitly warns about this; SSE avoids it by separating read/write streams. If stuck with stdio, you must flush and read interleaved or use temp files.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:37:19.328211+00:00— report_created — created