MCP stdio server fails to (re)connect with error -32000 after update to 2.1.212, though the subprocess handshakes correctly when invoked directly

Status Open
Reported on v2.1.211
Maintainer reply None cached
Activity 0 comments · opened Jul 17, 2026

Description

After Claude Code auto-updated from 2.1.211 to 2.1.212, a previously-working local stdio MCP server started failing to connect/reconnect with:

Failed to reconnect to <server-name>: -32000

This reproduces both on a resumed (previously-connected) session and on a brand-new session start — so it isn't specific to recovering an already-degraded connection.

Environment

  • Claude Code version: 2.1.212 (native install), previously 2.1.211
  • OS: Windows 11 Pro (10.0.26200)
  • claude doctor: no installation issues reported, auto-updates enabled (channel latest)
  • Last auto-update: 2.1.2112.1.212, succeeded, same day the issue first appeared
  • claude update confirms 2.1.212 is current — no newer build to test against yet

MCP server config

Registered via:

claude mcp add <server-name> -- "<absolute-path-to-python.exe>" "<absolute-path-to-server-script>"

(local scope, stdio transport, absolute paths on both sides — not relying on PATH resolution)

Minimal repro of the server (Python, mcp package 1.12.1, FastMCP):

from mcp.server.fastmcp import FastMCP

mcp = FastMCP("demo-server")

@mcp.tool()
def ping() -> dict:
    """Trivial tool for repro purposes."""
    return {"status": "ok"}

if __name__ == "__main__":
    mcp.run()

What I've ruled out

I reproduced the exact spawn Claude Code performs by hand and fed it a real MCP handshake over stdin:

{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"diag","version":"1.0"}}}
{"jsonrpc":"2.0","method":"notifications/initialized"}
{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}

Piped directly into the exact interpreter + script Claude Code is configured to run, this returns a clean, valid initialize response and a full tools/list result, with empty stderr — reproduced consistently under both:

  • A normal, fully inherited environment
  • A completely empty environment (no PATH, no other variables)

So the subprocess itself is healthy and speaks correct MCP/JSON-RPC. The failure does not originate in the server process — it appears to be in Claude Code's own client-side connect/reconnect handling.

Steps to reproduce

  1. Register a working stdio MCP server (claude mcp add, local scope, absolute interpreter path)
  2. Confirm it connects and works normally
  3. Let Claude Code auto-update (in this case 2.1.2112.1.212)
  4. Open a session (fresh or resumed) in the project the server is registered under
  5. Run /mcp and attempt to reconnect

Expected

The server reconnects successfully, as it did before the update.

Actual

Failed to reconnect to <server-name>: -32000

No further detail is surfaced — not in the session transcript, not in claude doctor, not in claude mcp list.

Additional notes

  • Failure is consistent across a resumed session and an entirely fresh session — rules out stale in-session state as the cause.
  • No newer Claude Code build is available yet to check whether this has already been fixed.

View original on GitHub ↗