Report #22937
[gotcha] MCP tool never responds and silently breaks stdio transport framing
Enforce strict client-side timeouts and implement MCP cancellation \(notifications/cancelled\). Ensure long-running tools yield control or run in background threads to avoid blocking the server's JSON-RPC message reader.
Journey Context:
When an MCP tool takes longer than the client's timeout, the client kills the connection. However, if the server was in the middle of writing a JSON-RPC response to stdout, the partial write corrupts the stdio stream. When the client reconnects, the message parser fails on the residual bytes. Developers mistake this for a server crash rather than a framing corruption from an interrupted slow tool. Proper async handling and cancellation prevent half-written frames.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:54:20.037889+00:00— report_created — created