MCP error -32000: Connection closed
- Spec
2026-07-28- Evidence
- E2Reproducedarm64
- Verified
What it means
Section titled “What it means”The client started your server as a child process, and that process exited. The client’s pipe to it closed, so the request it was waiting on failed.
We reproduced it with a server that prints an error and exits during startup:
| Client SDK | What it reported |
|---|---|
TypeScript v1 (@modelcontextprotocol/sdk 1.32.2), used by many existing clients |
MCP error -32000: Connection closed |
TypeScript v2 (@modelcontextprotocol/client 2.4.0) |
Connection closed (error code CONNECTION_CLOSED) |
Both arrived within 15 ms of starting the process: the server did not hang, it died.
Find the cause in this order
Section titled “Find the cause in this order”Copy command and args from the client’s configuration, unchanged, and run them in a terminal:
node /absolute/path/to/server.jsExpectedThe process starts and waits silently. Messages on stderr are fine. If it exits, the error it prints is your cause.
The server’s stderr usually ends up in the client’s log. Claude Desktop, for example, writes files named mcp*.log; on Windows they are under %APPDATA%\Claude\logs. Where clients write MCP logs lists the other clients.
npx -y @modelcontextprotocol/inspector@2.12.0 --cli \ node /absolute/path/to/server.js --protocol-era auto --method tools/listExpectedThe Inspector lists the tools. If it does, the server is fine and the client configuration is the problem.
The server crashes on start
Section titled “The server crashes on start”The most common cause. Typical reasons:
- A required environment variable is missing. Your shell has the API key; the client does not pass it. Set it in the client’s
envsection for that server. - A dependency is missing in the environment the client uses, such as a different Python virtual environment.
- The SDK major version does not match the code. Code written for an older SDK can fail at import time. With the Python SDK 2.x,
from mcp.server.fastmcp import FastMCPraisesModuleNotFoundError: No module named 'mcp.server.fastmcp', because version 2 renamedFastMCPtoMCPServer. With the TypeScript SDK, version 1 imports from@modelcontextprotocol/sdkdo not exist in the version 2 packages. - The runtime is too old. For example, the TypeScript SDK v2 needs Node.js 20 or later.
The command or path is wrong for the client
Section titled “The command or path is wrong for the client”A command that works in your terminal can fail in the client:
- Relative paths. The client does not start the server in your project directory. Use absolute paths in
args, or set the client’s working directory option if it has one. PATHis different. Desktop applications are not started from your shell, so they do not read.zshrc,.bashrcor nvm’s setup. Use the full path tonode,python,uvornpx. When the command itself cannot be found, many clients reportspawn … ENOENTinstead of this error.
Windows: npx is not an executable
Section titled “Windows: npx is not an executable”On Windows, npx is a batch script (npx.cmd), not an .exe. Some clients cannot start it directly. Two common fixes:
{ "command": "cmd", "args": ["/c", "npx", "-y", "your-mcp-server"] }or point command at the full path of npx.cmd. We have not yet tested this on our Windows lab machine, so treat it as documented community practice.
Related
Section titled “Related”- Test a server with the MCP Inspector
- Your first server in TypeScript
- spawn … ENOENT: the program never started.
- Request timed out: the server is running but does not answer.
Sources
MCPDev is community documentation. It is not affiliated with the Model Context Protocol project or with the vendors of the clients it covers.