Serverdex error reference · read 21 November 2026

Could not attach to MCP server (Claude Desktop): what it means and how to fix it

Could not attach to MCP server

Claude Desktop started the configured command but did not get a valid MCP handshake back, so the server is shown as unavailable. It is Claude Desktop's wording for a start-up failure: wrong command, missing runtime, or a process that exits at once.

Shown by: Claude Desktop

Causes, most likely first — and the fix for each

  1. 1`claude_desktop_config.json` points at a command Claude Desktop cannot run (nvm-managed `npx`, `uvx` in `~/.local/bin`).

    Fix: Use absolute paths in `command`; on macOS launch Claude Desktop from a terminal once to confirm the PATH difference.

  2. 2The config file has a JSON error (trailing comma, single backslashes on Windows).

    Fix: Validate the file; Claude Desktop ignores or rejects an invalid file without naming the line.

  3. 3The server needs an environment variable that is not in the `env` block.

    Fix: Add it to `env` in the server entry; Claude Desktop does not pass your shell's variables.

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 -32000: Connection closed · 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 · 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.