Report #85989
[gotcha] MCP tool calls hang indefinitely or fail silently when the stdio server process dies
Set explicit timeouts on every tools/call invocation \(e.g., 30 seconds\). Monitor the server child process for exit events and stdin EOF. Auto-restart the server process on crash, re-run the full initialize handshake, and re-query tools/list before retrying any pending tool calls. Surface process-exit diagnostics to the agent so it can choose an alternative strategy.
Journey Context:
The stdio transport runs the MCP server as a child process communicating over stdin/stdout. If the server process crashes—OOM kill, unhandled Python exception, segfault in a native dependency—the client may not detect this until it tries to write to a closed pipe or reads EOF. Without an explicit timeout, the calling code waits forever. Without process-exit monitoring, the tool appears broken with zero diagnostic information. This is especially common with MCP servers written in Python that hit memory limits on large file operations, or servers with native extensions that segfault. The counter-intuitive part: the tool was 'working fine' in development with small inputs, and there is no error message to search for—just silence.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T02:55:11.594272+00:00— report_created — created