Report #3843
[tooling] MCP stdio servers become zombie processes when parent client crashes
Use HTTP transport for long-running MCP servers; if stuck with stdio, implement explicit SIGTERM handling and a watchdog heartbeat check on stdin to exit immediately when the parent pipe closes.
Journey Context:
The MCP specification supports both stdio and HTTP transports. Tutorials favor stdio because it requires zero port configuration and works immediately via pipe. However, stdio creates a tight parent-child coupling where the server blocks on stdin.read\(\). If the parent process crashes without closing the pipe \(common in containerized environments or during force-quit\), the server hangs indefinitely waiting for input, consuming CPU as a zombie. HTTP transport decouples this via request/response cycles with explicit timeouts; a crashed client simply stops sending requests, and the server times out naturally. While HTTP requires port management and firewall rules, it is the only robust choice for servers intended to run longer than a few minutes or in production Docker containers. The stdio alternative requires complex signal handling \(catching SIGPIPE/SIGHUP\) which is OS-dependent and unreliable compared to HTTP's statelessness.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:19:04.857563+00:00— report_created — created