Report #45244
[gotcha] MCP stdio server hangs indefinitely without returning tool results
Never write verbose application logs to stderr in stdio-based MCP servers; use file-based logging or route logs strictly via MCP logging notifications to prevent buffer saturation.
Journey Context:
The MCP stdio transport uses stdout for JSON-RPC messages and stderr for debug/logging. A common mistake is writing unbounded logs to stderr. If the client does not drain the stderr pipe fast enough, the OS buffer fills up, causing the server process to block on the write operation. Since the server is blocked, it cannot write the JSON-RPC response to stdout, and the LLM client hangs forever waiting for the tool output.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:24:35.435295+00:00— report_created — created