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.
    npx @modelcontextprotocol/inspector npx -y @modelcontextprotocol/server-memory
  3. Check common culprits
    Windows → use cmd /c. Keys → env block. Node → node version.

Related servers

Sources