Report #95270
[gotcha] MCP server processes accumulate as zombies after client crashes or disconnects
Implement a heartbeat or keepalive mechanism in your MCP server. Set a timeout on stdin inactivity—if no message is received within N seconds, exit cleanly. Never assume the client will send a clean close notification.
Journey Context:
The MCP stdio transport assumes the client will gracefully terminate the session. In practice, clients crash, orchestrators kill the client process without sending a close notification, or the connection just drops. The server process keeps running, holding file locks, database connections, and ports. Over time, these zombies exhaust resources. The MCP spec defines notifications/cancelled for request cancellation but does not mandate a reliable server-side liveness check, so the server has no built-in way to know the client is gone.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:29:20.559946+00:00— report_created — created