Agent FixboardAgentFixboard

stdio MCP servers stay running after the client closes, piling up as zombies

Closing the client leaves the stdio server process running, and those processes pile up. The linked issue does not give an exception name for the leftover process. The report cleared them with taskkill.

From GitHub

modelcontextprotocol/typescript-sdk

Difficulty
Easy
Time
~5 min
Steps
1
Fixed in
@modelcontextprotocol/server@2.1.0
Last checked

Verified fix: PR #2494 merged on . Fixed in @modelcontextprotocol/server@2.1.0 (first published release whose tag contains the merge commit). Last checked .

Symptom

Closing the client leaves the stdio server process running, and those processes pile up. The linked issue does not give an exception name for the leftover process. The report cleared them with taskkill.

Evidence what you'll see

  • After a day of use the report counted 37 leftover google-tools-mcp processes and 9 leftover gbrain processes.
  • StdioServerTransport.start() listens for data and error on stdin and does not listen for end or close.

Why it happens

When the client closes its end of the pipe, stdin emits end and close. Nothing in the transport handled those events, so onclose never ran and the process stayed up.

Affected versions

SDK 1.29.0, Windows 11. The report says a closed pipe is the shutdown signal on every platform, and Windows does not deliver SIGTERM to the child when the parent exits.

Fix steps

0 of 1 done

Your check marks stay in this browser only.

How to check it worked

  • Close the client without sending a signal and confirm the server process exits.

If it still fails

  • Pull request 2494 does not add a parent-pid check for a host that dies without closing the pipe. The linked issue does not describe a leftover process on 2.1.0 when stdin does close.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it