Claude Code MCP Error -32000 Connection Closed
When Claude Code shows MCP error -32000: Connection closed, reconnect from /mcp after startup, keep server logs on stderr, and hand-test the server.
Quick answer
Match MCP error -32000: Connection closed in logs or after a failed MCP connect. If the server works when you pipe initialize JSON into it by hand, open /mcp and reconnect after Claude Code has finished starting. Keep MCP server logs on stderr, not stdout, so JSON-RPC framing stays clean. Prefer an absolute node path over a bare npx command when the process dies during handshake. This is a transport or startup-race failure, not a weekly-limit wait.
On this page
What we're seeing
- The exact failure string is MCP error -32000: Connection closed, often with Failed to connect or a failed reconnect note in /mcp.
- Independent January–March 2026 first-hand reports on anthropics/claude-code quote that string while the same server answers MCP initialize when tested outside Claude Code.
- A common pattern is a startup race: the MCP process starts, then the client closes stdin or drops the session before the REPL is ready, so /mcp reconnect succeeds seconds later.
- Stdout pollution from the server can also break framing and surface as Connection closed even when the process is still running.
- Overloaded, weekly-limit, and rate-limit waits are a different fingerprint.
Start here
Try these first
Fix 1
Confirm MCP error -32000 Connection closed
Match the exact code and wording before changing MCP configs. Nearby MCP failures use different codes or timeouts.
- Read the error. This guide is for MCP error -32000: Connection closed.
- If the message is a timed-out request such as -32001, or only Failed to connect without -32000, treat it as a different fingerprint.
- Note whether the failure happens only at session start and clears after a manual reconnect.
Applies to Windows, Mac, Desktop
Fix 2
Reconnect from /mcp after startup
March 2026 first-hand reports show MCP servers failing at launch with -32000, then connecting in under a second after /mcp reconnect once the REPL is up. That is the first try-today leftover for the startup-race branch.
- Wait until Claude Code has finished opening the session.
- Run /mcp and select reconnect for the failed server.
- If the server flips to connected, stop. Retry the MCP action that failed.
- If reconnect fails immediately again, continue with the hand-test and stdout checks below.
Applies to Windows, Mac, Desktop
Fix 3
Hand-test the MCP server outside Claude Code
January 2026 first-hand reports prove the package can answer initialize on stdin while Claude Code still reports -32000. That separates a broken server from a client transport drop.
- From a normal terminal, start the same command configured in your MCP settings.
- Pipe a minimal initialize JSON-RPC request into the process the way the MCP docs describe for stdio servers.
- If the server returns a valid initialize result locally, keep the Claude Code leftovers. Do not reinstall packages yet.
- If the hand-test fails, fix the server command, PATH, or credentials before changing Claude Code.
Applies to Windows, Mac, Desktop
Fix 4
Move logs to stderr and prefer absolute node
Community MCP -32000 threads warn that stdout logging corrupts JSON-RPC framing. Absolute node paths also avoid npx races that die during handshake.
- Change the MCP server so status logs go to stderr, not stdout.
- In MCP settings, prefer an absolute path to node plus the server entry file over a bare npx invocation when reconnect still fails.
- On Windows, if npx is required, wrap it so the shell stays attached for the child process, then reconnect from /mcp.
- Retry the same MCP tool once after a full Claude Code quit and relaunch.
Applies to Windows, Mac, Desktop
Device notes
- Windows
- npx-launched stdio servers are a frequent Windows path for early Connection closed. Prefer absolute node, and reconnect from /mcp after startup.
- Mac
- macOS first-hand reports quote the same -32000 string for filesystem and database MCP servers that still pass a manual initialize test.
- Desktop
- Claude Code CLI and desktop MCP managers both surface MCP error -32000: Connection closed. Linux desktop builds use the same /mcp reconnect leftover.
Official information
Checked on 6 September 2026, Anthropic does not publish a Help Center article that names MCP error -32000: Connection closed as a single known issue. Community-confirmed leftovers come from independent January–March 2026 anthropics/claude-code first-hand reports: /mcp reconnect after startup races, hand-testing initialize on stdin, and keeping server logs off stdout.
Sources
Keep troubleshooting
Related problems
Claude
Claude Code PreToolUse Bash Hook Error
Windows · Mac · DesktopUpdated Sep 7, 2026
Claude
Claude Code Connection Dropped ECONNRESET
Windows · Mac · DesktopUpdated Sep 19, 2026
Cursor
Cursor Unable to Verify the First Certificate
Windows · Mac · DesktopUpdated Sep 8, 2026
Cursor
Cursor Agent Connection Failed Please Try Again
Windows · Mac · DesktopUpdated Sep 7, 2026