Report #65296
[tooling] MCP client hangs indefinitely when calling tool or initializing server
Ensure all logging and debug output goes to stderr, never stdout. Explicitly flush stdout after every JSON-RPC message write. Use line-buffered writes.
Journey Context:
The MCP stdio transport uses stdout for JSON-RPC messages and stderr for logging. If a server process accidentally writes logs to stdout \(e.g., via a default logger configuration\), or if stdout is block-buffered and not flushed, the client will wait indefinitely for a JSON-RPC response that is stuck in a buffer or interleaved with log lines. This is a classic IPC deadlock. The fix requires strict separation of streams and explicit flushing, which is easy to overlook in high-level languages with automatic buffering.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:05:05.459233+00:00— report_created — created