Claude Code MCP "Failed to Connect": Read the Status Detail, Then Check the URL or Command
What ✘ Failed to connect means, whether to wait, and what to check first.
Language: English · 日本語版
Wait or fix?
Fix the server configuration; waiting rarely helps. Both "Failed to connect" and "Connection error" mean the MCP server did not start or its URL did not respond. Claude Code already retries an HTTP or SSE server's first connection up to three times for transient errors such as a 5xx response, a refused connection or a timeout. It does not retry authentication or not-found errors, because those need a configuration change. So when you see the status, the useful next step is reading the detail.
Messages you may see
✘ Failed to connect✘ Connection errorMCP endpoint not found at <origin>. Check the URL in your MCP config.Leading or trailing whitespace in: headers.Authorization
The exact wording changes a little between Claude Code versions and providers.
What the message means
claude mcp list shows a health status next to each server, such as ✔ Connected, ! Needs authentication or ✘ Failed to connect. A failure status means Claude Code could not connect to that server, not that the list command failed. For Failed to connect, claude mcp list appends the failure detail, which is the HTTP status or error code plus any error text the server returned, and claude mcp get <name> shows it on an Issue: line. Before v2.1.219, the status showed no detail. Connection error never carries detail on any version, because the text could embed the server URL, which can contain secrets.
Common causes
- A wrong URL or path for an HTTP server. A 404 shows "MCP endpoint not found at <origin>".
- A token configured in
headers.Authorizationthat the server rejects, often with hidden whitespace from pasting. - For stdio servers, a command that fails on its own, for example because Node.js or a browser is missing, or a missing
--separator before the server command when it was added. - A slow first start, such as npx downloading the package, that goes past the default 30-second startup timeout.
- A configuration file at the wrong path, or a malformed entry in
.mcp.json.
Check in this order
- Run
claude mcp listorclaude mcp get <name>and read the detail on the status or the Issue: line. Also read any warnings, such as hidden leading or trailing whitespace in a token. - For HTTP servers, run
curl -I <url>(PowerShell:curl.exe -I <url>). A 404 or 405 means the server is up; a 401 or 403 means you need to authenticate; no response means check the URL and your network. For a 404 in Claude Code, compare the URL inclaude mcp get <name>with the server's documented endpoint path, then remove the server and add it again with the right URL. - For stdio servers, run the configured command directly in your terminal. If it starts and waits for input, compare it with the command shown by
claude mcp get <name>; a difference usually means the--separator was left out. - If the connection timed out at startup, raise the limit, for example
MCP_TIMEOUT=60000 claude(milliseconds). - After a fix, reconnect the server from the
/mcppanel. If you edited.mcp.json, restart the session, because Claude Code reads that file at session start.
We took the fixes from the official pages below and put them in order, with the quickest and most likely ones first.
How it differs from similar errors
- "! Needs authentication" means the server wants a sign-in you have not completed. Choose Authenticate for that server in
/mcp. - "/mcp shows No MCP servers" means Claude Code found no configuration for the current directory. The correct files are
~/.claude.jsonand.mcp.jsonat the project root.
Related errors
Official sources
- Connect to MCP servers: Troubleshooting (checked 2026-11-20)
- MCP: Server status and status detail (checked 2026-11-20)
- MCP: Failed first connections (checked 2026-11-20)
- MCP: Configuration warnings (checked 2026-11-20)
Unofficial page. Not affiliated with, endorsed by, or sponsored by Anthropic, PBC. Claude and Claude Code are trademarks of Anthropic, PBC. Messages and fixes change with updates, so read the official pages as well.