stdio MCP servers are killed mid-session with no error output; all servers drop simultaneously

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 0 comments · opened Aug 2, 2026

Environment: Claude Code 2.1.220 (native install), Windows 11, Node-based stdio MCP servers.

What happens

Every few tool calls, all configured stdio MCP servers disconnect at once. Their tools disappear from the session and come back only after running /mcp. This repeats indefinitely — it happened 8+ times over a single working session, several times in the middle of a tool call (MCP error -32000: Connection closed).

Evidence that the server itself is not at fault

I wrapped the server launch so its stderr is appended to a file, bypassing Claude Code entirely:

"command": "cmd",
"args": ["/c", "node <path-to-server>/dist/index.js 2>> <logfile>"]

After a disconnect the log contains only the two startup lines the server prints and nothing else:

NanoBanana MCP: Using model gemini-3.1-flash-image-preview
Gemini MCP server running on stdio

No exception, no stack trace, no API error — the server has nothing to say before it dies.

Additional observations:

  • After a disconnect there is no server process left: Get-Process node returns 0. So this is not a hung pipe with a live process — the process is gone.
  • The Windows Application event log has no error records for node.exe over the same period, so it is not an abnormal termination either. It looks like a clean external kill.
  • Both configured MCP servers die at the same moment. They are unrelated packages and share nothing except being spawned by Claude Code, which points at the client tearing the connections down rather than at either server.

Ruled out

  • Corrupt npx cache — one cache entry was genuinely broken (missing package.json, causing -32000 on reconnect); cleared, and startup failures stopped. The mid-session deaths continued.
  • @latest resolution on every start — pinned to an exact version, then npx removed from the chain entirely by installing the package globally and launching node <entry>.js directly. Deaths continued.
  • Duplicate Claude Code installations — claude update warned about a leftover npm-global copy alongside the native one; removed on its own advice. Deaths continued.
  • Outdated version — 2.1.220 is current; claude update reports up to date.
  • --debug produced nothing about the death either.

Impact

Any long-running task that depends on an MCP tool has to be resumed by hand every few calls, and a call that is interrupted loses its work.

Expected

stdio MCP servers stay connected for the life of the session; if the client does terminate them, it says why.

View original on GitHub ↗