Fixes › Claude Desktop, Claude Code, Cursor

"MCP error -32000: Connection closed": what it means and how to fix it

Claude DesktopClaude CodeCursor

The error

McpError: MCP error -32000: Connection closed

Why it happens

The server process exited before it finished the handshake. Common reasons: a missing dependency, wrong Node version, missing API key, bad args, or Windows npx without cmd /c. The real error is in the server's stderr.

How to fix it

  1. Run the exact command in a terminal
    The crash message shows up immediately.
    npx -y @modelcontextprotocol/server-filesystem /path/that/exists
  2. Test with the MCP Inspector
    The Inspector starts the server and shows its stderr and protocol messages. Use @latest so npx does not reuse an old cached copy: Inspector 2.17.0 (November 27, 2026) is a security fix (GHSA-v2gx-m79c-pvxj), and it needs Node 22.23.4, 24.22.1 or 26.12.1 or newer.
    npx @modelcontextprotocol/inspector@latest npx -y @modelcontextprotocol/server-memory
  3. Check common culprits
    Windows → use cmd /c. Keys → env block. Node → node version.
  4. Git server: check your Git version
    mcp-server-git 2026.11.11 (reference servers v2.4.0, November 11, 2026) refuses to work with a Git older than 2.31, because older Git would ignore the safety overrides that stop a repository's own config from running programs. Since 2026.11.18 (reference servers v2.5.0, November 18, 2026) it also needs Git 2.33 or newer for a repository with a checked-out submodule. If the Git server stopped working after an update, check your Git version and upgrade Git if it is below 2.31 (or below 2.33 with submodules). Since 2026.11.27 (reference servers v2.6.0, November 27, 2026) it also refuses a --repository folder whose .git file points at a Git directory somewhere else (other than its own linked worktree or submodule checkout), so if it stopped after that update, point --repository at the real repository folder.
    git --version

Related servers

Sources