"MCP error -32000: Connection closed": what it means and how to fix it
The error
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. Use@latestso 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 - Check common culprits
Windows → use cmd /c. Keys → env block. Node → node version. - Git server: check your Git version
mcp-server-git2026.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--repositoryfolder whose.gitfile points at a Git directory somewhere else (other than its own linked worktree or submodule checkout), so if it stopped after that update, point--repositoryat the real repository folder.git --version
Related servers
Everything (test server)
Official test server that exercises every MCP feature (prompts, tools, resources, sampling and more). It is meant for people building MCP clients, not
Filesystem
Official reference server for reading, writing, searching and moving files, limited to the directories you allow. Version 2.4.1 (Nov 27, 2026, referen
Memory (Knowledge Graph)
Official reference server that gives the model persistent memory as a local knowledge graph (entities, relations and observations stored in a file). V
Git
Official reference server for reading and working with local Git repositories (status, diff, log, branches and commits). Version 2026.11.27 (Nov 27, 2
Sources
- https://modelcontextprotocol.io/docs/tools/debugging
- https://modelcontextprotocol.io/docs/develop/connect-local-servers
- https://github.com/modelcontextprotocol/servers/releases/tag/v2.4.0
- https://github.com/modelcontextprotocol/servers/releases/tag/v2.5.0
- https://github.com/modelcontextprotocol/servers/releases/tag/v2.6.0
- Error MCP error -32000: Connection closed (GitHub issue, 6 comments)