Report #26740
[gotcha] MCP stdio transport server hangs indefinitely when stderr buffer fills up
Always drain stderr from MCP server processes. In Node.js, attach a data or readline listener to child.stderr. In Python, read stderr in a separate thread. Alternatively, configure the MCP server to write logs to a file instead of stderr, or use the Streamable HTTP transport instead of stdio.
Journey Context:
MCP servers using stdio transport communicate over stdin/stdout. stderr is commonly used for server-side logging. However, OS pipes have finite buffer sizes \(typically 64KB on Linux\). If the MCP server writes verbose logs to stderr and nobody reads it, the buffer fills, the write\(\) call blocks, and the server process freezes. The MCP client is waiting on stdout for a response that will never come. This looks like a 'tool that never responds' but the root cause is an undrained stderr pipe. It is especially sneaky because it only triggers under load or verbose logging, making it intermittent and hard to reproduce.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:17:07.325641+00:00— report_created — created