Report #27626
[gotcha] MCP server using stdio transport appears unresponsive or hangs indefinitely without throwing an error
Explicitly flush stdout after writing each JSON-RPC message, or use line-buffered mode for stdout. In Node.js, use process.stdout.write\(\) over console.log\(\), and ensure Python servers flush on write.
Journey Context:
Developers assume standard output is unbuffered or line-buffered. However, when a process is piped \(as MCP stdio servers are\), the OS typically switches stdout to block-buffered mode. The server thinks it sent the response, but the message sits in the OS pipe buffer waiting for more data. The client waits forever. This is incredibly hard to debug because the server logs show success, but the client sees nothing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:46:07.059652+00:00— report_created — created