"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
- Run the exact command in a terminal
The crash message shows up immediately.npx -y @modelcontextprotocol/server-filesystem /path/that/exists - 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 - Check common culprits
Windows → use cmd /c. Keys → env block. Node → node version.
Related servers
Dev Tools● Maintained
Everything (test server)
This MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for buil
★ 91.3k · updated 2026-10-10
Files & OS● Maintained
Filesystem
Node.js server implementing Model Context Protocol (MCP) for filesystem operations.
★ 91.3k · updated 2026-10-10
Memory & Reasoning● Maintained
Memory (Knowledge Graph)
A basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.
★ 91.3k · updated 2026-10-10