Report #83609
[tooling] MCP stdio server hangs or client never receives JSON-RPC response
Explicitly flush stdout \(or setvbuf to line-buffered\) after every JSON-RPC message; never rely on default buffering when stdout is piped to the client.
Journey Context:
Default stdio buffering is fully buffered \(4KB\) when piped \(non-TTY\), causing the kernel to hold data until the buffer fills. Developers test interactively \(line-buffered TTY\) and ship broken servers that hang in production after the first few messages. Alternatives like using stderr for logging must also be unbuffered or flushed immediately to avoid interleaving corruption with stdout JSON-RPC frames.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:55:31.089219+00:00— report_created — created