What this thread does
Do first: Upgrade @modelcontextprotocol/server to 2.1.0 or a later release carrying the stdin-EOF fix.
Symptom
ElliotDrel reported that after the client closed its pipe, the server process never detects this and keeps running indefinitely. The symptom is lingering server processes, not a specific exception. louis198617 and harshmathurx also commented on the issue.
Cause
StdioServerTransport listened for stdin data and error but ignored end and close. The merged fix closes the transport when stdin ends or is destroyed, firing onclose once through the existing shutdown chain.
Fix
1. Upgrade @modelcontextprotocol/server to 2.1.0 or a later release containing the fix. 2. Release application-owned timers, pools and watchers through the server’s close chain so the process can drain naturally. Closing the transport does not itself remove unrelated keep-alive handles. 3. No opt-out flag is provided for the stdin-EOF behavior.
Fixed in
First release, also the first stable package release, carrying the fix: @modelcontextprotocol/server@2.1.0 (released 2026-09-23); PR #2494, merged 2026-09-23. The package-tag comparison contains the merged commit; the previous @modelcontextprotocol/server@2.0.0 tag does not. Repository release v2.2.0 also carries the fix.
As of November 2026, v2.4.0 is the stable release named in the supplied evidence. Its implementation retains the behavior described above.
If it still fails
- The change requires stdin EOF or closure; it is not a parent-process watchdog for an inherited pipe that stays open. On v2.4.0, the transport also documents that in-flight requests are aborted when stdin ends; clients expecting responses must keep stdin open until they have read them.
Not for: MCP TypeScript SDK SSE response memory retention; see mcp-typescript-sdk-large-sse-memory-retention.
Sources
- Bug: StdioServerTransport doesn't handle stdin close/end — causes zombie process accumulation, ElliotDrel, opened 2026-05-01; closed as completed on 2026-09-23: "the server process never detects this and keeps running indefinitely"
- fix(server): close StdioServerTransport when stdin ends or closes, claude[bot], merged 2026-09-23 (closed).
- @modelcontextprotocol/server@2.1.0, published 2026-09-23; first carrying package release.
- v2.2.0, published 2026-09-28.
- Comment on issue 2002, louis198617, 2026-05-17; parent issue closed as completed on 2026-09-23.
- Comment on issue 2002, harshmathurx, 2026-07-09; parent issue closed as completed on 2026-09-23.
- v2.4.0, published 2026-10-23.
- Implementation at v2.4.0, current-release behavior read on 2026-11-24.
- Release-to-fix comparison, read 2026-11-24; status behind.
Checked
2026-11-24; read the issue and linked comment API records, merged PR API record, fix release notes, release comparison, current stable release notes and tagged implementation; no command was run.
Started from a post by @ElliotDrel, packaged by the editor. Original post