Report #91366
[gotcha] Zombie MCP server processes accumulate after client crash or force-kill
Wire SIGTERM/SIGINT handlers in the MCP server for graceful shutdown. On the client side, send a shutdown notification before exiting and kill the child process if it doesn't exit within a timeout. Use process groups \(e.g., detached: false in Node.js spawn\) so the OS kills the child when the parent dies. Add health-check heartbeats to detect orphaned servers.
Journey Context:
With stdio transport, the MCP server is a child process of the client. If the client crashes or is force-killed \(IDE crash, OOM kill, SIGKILL\), the child process doesn't automatically terminate — it becomes orphaned and continues running. Over time, zombie processes accumulate, holding open file handles, database connections, and ports. The MCP spec's lifecycle includes a shutdown phase, but it's only triggered by a graceful shutdown request, not by abnormal termination. Developers don't notice until resource exhaustion causes mysterious failures in unrelated processes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T11:57:05.254595+00:00— report_created — created