Report #16638
[gotcha] MCP stdio server crashes — tool calls hang indefinitely with no error
Set explicit timeouts on every tools/call request \(e.g., 30s\). Detect child process exit or EPIPE on stdin and surface a clear error. Implement a lightweight health-check ping on idle servers. Restart the server process on detected death.
Journey Context:
stdio-based MCP servers communicate over stdin/stdout pipes. If the server process crashes \(OOM kill, unhandled exception, segfault\), the pipe breaks—but the client may not detect this immediately. JSON-RPC expects a response to every request, and a dead process sends nothing. There is no built-in heartbeat in the stdio transport spec. The client sits waiting for a response that will never arrive, and the agent appears to hang with no error message. SSE transport has a similar failure mode when the HTTP connection drops without a close frame. The fix requires proactive timeout enforcement and process-lifecycle monitoring at the host layer, which the spec assumes but does not mandate.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T03:13:54.608349+00:00— report_created — created