Serverdex error reference · read 21 November 2026
MCP error -32000: Connection closed: what it means and how to fix it
MCP error -32000: Connection closedThe client opened the server process (stdio) or endpoint and the connection ended before, or right after, the MCP initialize handshake. -32000 is the SDK's generic connection error, not a code the server chose: the server crashed on start, printed something that was not JSON-RPC, or the transport dropped.
Shown by: Claude Desktop · Claude Code · Cursor · VS Code · JSON-RPC code -32000
Causes, most likely first — and the fix for each
1The server command exits immediately — the package is not installed, the runtime is missing, or a required environment variable is empty and the process throws on start.
Fix: Run the exact command from the config in a terminal (`npx -y <package>` / `uvx <package>`); it must stay open and print nothing but JSON-RPC. Fix whatever error it prints there first, then restart the client.
2The server writes logs or banners to stdout. On stdio, stdout is the protocol channel; a single stray line breaks the connection.
Fix: Send logs to stderr (console.error / logging to stderr), or run the server with a quiet flag. The TypeScript SDK troubleshooting page covers exactly this case.
3A remote (HTTP) server closed the session, usually after an idle timeout or a deploy, and the client did not reconnect.
Fix: Restart the client or reload the server from its MCP panel; if it recurs, check the server's status with the Serverdex live check — hosted servers that drop connections show up as unreachable.
4Windows: the command is `npx`/`uvx` without `.cmd`, or the path has unescaped backslashes in JSON.
Fix: Use `npx.cmd` (or `cmd /c npx …`) and double the backslashes (`C:\\path`) in the JSON config.
Still failing?
Work through the twelve general causes in order in MCP server not working: the causes, in order, check the exact config file path and shape for your client in the client setup guides, or generate a known-good config with the config generator.
Sources (read 21 November 2026)
Other MCP errors: MCP error -32001: Request timed out · MCP error -32601: Method not found · MCP error -32602: Invalid params · MCP error -32603: Internal error · MCP error -32600: Invalid request · HTTP 406 Not Acceptable from an MCP server · spawn npx ENOENT · spawn uvx ENOENT (and uv, docker) · Server transport closed unexpectedly · Client closed (Cursor) · No tools, prompts, or resources (Cursor) · Unexpected token … is not valid JSON · SSE error: Invalid content type, expected text/event-stream · Could not attach to MCP server (Claude Desktop) · Failed to reconnect to an MCP server (Claude Code) · MCP server needs authentication (401 Unauthorized) · MCP OAuth loop (infinite sign-in tabs) · Tools limited to 40 total (Cursor) · executable file not found in $PATH (Antigravity) · MODULE_NOT_FOUND / No module named mcp.server.fastmcp.