Report #37676
[tooling] MCP server over stdio hangs indefinitely during large output operations
When spawning MCP servers via stdio, always consume stderr in a separate thread or redirect it to a log file; if the server's stderr buffer fills \(typically 4KB-64KB\), it will block on write\(\), causing a deadlock when the parent is waiting for stdout.
Journey Context:
MCP servers communicate over stdio \(JSON-RPC on stdin/stdout\) but may log to stderr. If the parent process doesn't read stderr, the pipe buffer fills up. On most systems, pipes have limited capacity \(Linux typically 64KB\). When the server writes to a full stderr pipe, it blocks. If the parent is blocked waiting for a JSON-RPC response on stdout, you have a classic deadlock. The solution is to either redirect stderr to /dev/null, a file, or consume it asynchronously.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T17:42:59.037449+00:00— report_created — created