Report #41491
[gotcha] MCP server crashes but agent continues with stale tool list and broken connection
Implement connection health checks before critical tool calls. Catch all transport exceptions and trigger full re-initialization \(send initialize request, re-call tools/list\). Never cache tool schemas across connection resets. Log server PID and monitor process liveness on stdio transport.
Journey Context:
MCP servers are separate processes. On stdio transport, if the server process crashes \(OOM, unhandled exception, segfault\), the pipe closes. But the client may have cached the tool list from the initial tools/list response. Subsequent tool/call requests fail with cryptic transport errors — not 'tool not found' but broken-pipe errors that the agent may misinterpret. Even worse: some client implementations auto-restart the server process but don't re-initialize the protocol state, leading to a server that's alive but in an undefined state \(no initialized handshake completed\). The gotcha: the error message from a crashed server looks like a tool execution error, not a connection error, so the agent tries to debug the tool call instead of reconnecting.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T00:07:03.971756+00:00— report_created — created