Report #15728
[tooling] MCP server hangs indefinitely when returning large tool results via stdio transport
Switch to HTTP with SSE transport for payloads exceeding 4KB, or implement explicit fflush\(stdout\) after each JSON-RPC message and read from stdin in a separate thread to avoid OS pipe buffer deadlocks.
Journey Context:
Developers often choose stdio for simplicity but hit silent deadlocks when tool results grow large \(e.g., file listings, search results\). The OS pipe buffer \(typically 4KB-64KB\) fills up when the server writes without the client reading, causing both sides to block indefinitely. Most tutorials don't mention this because they use 'hello world' sized payloads. HTTP\+SSE avoids this by using TCP flow control, and explicit flushing prevents stdio buffering issues.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:50:55.245463+00:00— report_created — created