Report #12307
[tooling] MCP stdio server hangs when returning large JSON payloads \(>64KB\)
Use HTTP transport \(Server-Sent Events\) for payloads exceeding 64KB; if constrained to stdio, stream responses via incremental updates or write to a temporary file and return a URI reference instead of inline JSON.
Journey Context:
POSIX pipe buffers are typically 64KB on Linux and 4KB on macOS. When a server writes large tool results to stdout, if the client isn't consuming the buffer fast enough, the server blocks on write\(\), creating a deadlock. This is invisible in development with small payloads but kills production agents handling image base64 or large DB results. HTTP SSE avoids this via TCP flow control and backpressure handling.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:41:56.024192+00:00— report_created — created