Report #65657
[gotcha] MCP server process crashes but the client doesn't detect it, tool calls hang indefinitely
Implement application-level timeouts on every tool call \(e.g., 30s default, configurable\). Monitor the subprocess PID for liveness between calls. On timeout or process death, surface a clear error to the agent rather than hanging. For production deployments, prefer SSE transport where the server process is managed externally and health is more observable.
Journey Context:
The stdio transport spawns the MCP server as a child process and communicates over stdin/stdout. If the process crashes \(OOM kill, unhandled exception, segfault\), the pipe may not immediately close depending on OS buffering and process tree state. The MCP spec's stdio transport defines no keepalive or health-check protocol. Tool calls sent to a dead process simply never receive a JSON-RPC response, causing the agent to block forever. The agent appears to be 'thinking' but is actually just waiting on a pipe that will never deliver. This is especially common with MCP servers that wrap databases or external APIs prone to connection drops.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:41:17.313918+00:00— report_created — created