"Could not connect to MCP server" means the MCP client (your IDE or Claude Desktop) attempted to establish a connection and failed before the handshake could begin. Unlike error -32000 where the connection starts then drops, this error means no connection was established at all.
The short answer: The three most common causes are: (1) the server binary or URL is unreachable, (2) the config JSON has a syntax error that silently breaks all servers, or (3) the IDE can't find the runtime (node, python, npx) because it uses a different PATH than your terminal.
If you see Could not connect to MCP server mcp-registry in Claude Desktop, this is a known application-level issue — not a problem with your configuration.
Claude Desktop includes an internal mcp-registry service for its built-in features. When this internal service fails to connect, it surfaces the error as a toast notification. This can happen:
What to do:
mcp-registry error is cosmetic and can be safely ignored.If only mcp-registry errors appear but your custom servers work fine, you don't need to change anything in your config.
A single JSON syntax error — a missing comma, unclosed bracket, or trailing comma — breaks the entire config file. All servers stop loading, not just the new one.
bash# Validate your config file # macOS/Linux cat ~/.cursor/mcp.json | python3 -m json.tool # Windows (PowerShell) Get-Content "$env:USERPROFILE\.cursor\mcp.json" | python -m json.tool
Or paste it into jsonlint.com. If the validator shows an error, fix it before debugging anything else.
Different tools use different root keys, and using the wrong one produces no error — the config is valid JSON, the tool just ignores it:
| Tool | Correct root key |
|---|---|
| VS Code | servers |
| Cursor | mcpServers |
| Claude Desktop | mcpServers |
| Claude Code | mcpServers |
| Windsurf | mcpServers |
If you copied a config from a Cursor guide into VS Code (or vice versa), this is likely the problem.
The IDE runs the command from your config as a subprocess. If the binary doesn't exist at that path, the connection fails immediately.
bash# Check if the command your config references actually exists which npx # macOS/Linux where npx # Windows # If you use nvm, the path your IDE sees may differ from your terminal # Use the absolute path instead which node # → /Users/you/.nvm/versions/node/v22.4.0/bin/node
Then use the absolute path in your config:
json{ "mcpServers": { "my-server": { "command": "/Users/you/.nvm/versions/node/v22.4.0/bin/npx", "args": ["-y", "some-mcp-package"] } } }
bash# Test if the server responds at all curl -s -w "\nHTTP code: %{http_code}\nTime: %{time_total}s\n" \ -X POST https://your-server-url/mcp \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{}}}'
| Result | Meaning |
|---|---|
| Connection refused | Server is down or wrong port |
| HTML response | URL points to web UI, not MCP endpoint — try /mcp or /sse path |
| HTTP 401/403 | Auth header missing or wrong |
| HTTP 502/504 | Proxy or gateway issue |
| Timeout | Server unreachable, firewall blocking, or cold start |
If the server requires API keys or tokens, they must be in the env block of your config — not in your shell's .bashrc or .zshrc:
json{ "mcpServers": { "my-server": { "command": "npx", "args": ["-y", "some-mcp-package"], "env": { "API_KEY": "your-api-key-here" } } } }
IDEs don't inherit your shell environment. If the server crashes on startup because a required env var is missing, the IDE reports "could not connect."
Help → Toggle Developer Tools → Console tab
Output panel (Ctrl+Shift+U) → select "MCP" from dropdown
Look for spawn ENOENT (command not found), ECONNREFUSED (server unreachable), or ETIMEDOUT (network timeout).
Output panel (Ctrl+Shift+U) → select "MCP" from dropdown
bash# macOS tail -f ~/Library/Logs/Claude/mcp*.log # Windows type %APPDATA%\Claude\logs\mcp*.log
Look for spawn errors — they almost always mean the command path is wrong or the binary doesn't exist.
| Symptom | Most likely cause | Fix |
|---|---|---|
| "Could not connect" on all servers | JSON syntax error in config | Validate with jsonlint.com |
| "Could not connect" on one server | Wrong command path or missing binary | Use absolute path from which / where |
| "Could not connect to mcp-registry" | Claude Desktop internal issue | Update app; ignore if custom servers work |
| Connects in terminal but not IDE | PATH difference (nvm/pyenv) | Use absolute runtime path |
| Connects on one machine, not another | Different environments | Match PATH and env vars across machines |
| "Could not connect" after IDE update | Config format changed | Check IDE docs for current format |
npx @modelcontextprotocol/inspector node your-server.js to confirm the server works independently of any IDEFor a complete testing workflow, see How to Test MCP Servers.
IDE setup guides: VS Code · Cursor · Claude Desktop · Windsurf