Submit a toolSubmit

Your MCP server shows Failed to connect. Fix the status before you re-add it

Claude Code or Cursor lists an MCP server, but it never reaches Connected, so Agent has no tools from it. Short answer: 5 steps. 1) Read the exact status, not just the red icon; 2) Confirm the config file and transport match the server; 3) Run the server the same way the agent would; 4) Fix auth and env, including hidden whitespace; 5) Widen the startup timeout, then reconnect once.

Last updated: · This page is the decision checklist; the tools list for “Fix an MCP server that won't connect” is a separate URL.

The problem: Claude Code or Cursor lists an MCP server, but it never reaches Connected, so Agent has no tools from it.

How do I fix this: Your MCP server shows Failed to connect?

  1. Read the exact status, not just the red icon

    In Claude Code, run /mcp or claude mcp list. Failed to connect and Connection error mean the process or URL never came up; Needs authentication means the host is reachable and you still need browser sign-in or a token header; Pending approval means a project .mcp.json server is waiting for you to approve it. In Cursor, open Customize > MCPs and confirm the server toggle is on, then open the Output panel (Cmd/Ctrl+Shift+U) and choose MCP Logs. Docs: https://code.claude.com/docs/en/mcp-quickstart and https://cursor.com/docs/mcp

  2. Confirm the config file and transport match the server

    Claude Code project servers live in .mcp.json at the repo root under mcpServers, not under .claude/. User-scoped servers go in ~/.claude.json. Cursor merges ~/.cursor/mcp.json with .cursor/mcp.json (project wins on name clash). Local servers need a command (and usually args); remote ones need a url. A 404 on an HTTP endpoint usually means the path is wrong for that product's MCP URL.

  3. Run the server the same way the agent would

    For a stdio server, paste the configured command into your own terminal. If it errors, fix Node, the package, or the path before blaming the IDE. If it starts and waits for input, the binary is fine: compare that command to claude mcp get <name> or your mcp.json. For HTTP, curl -I the URL; a 401/403 means auth, a 404/405 still proves the host is reachable from your machine.

  4. Fix auth and env, including hidden whitespace

    OAuth servers need Authenticate from /mcp (Claude Code) or the Cursor sign-in prompt. Token servers need Authorization: Bearer … without leading or trailing spaces; Claude Code's list command warns when a pasted value has whitespace. Put API keys in env (Claude Code --env, or the env object in mcp.json), then fully quit and restart the app so the process sees them.

  5. Widen the startup timeout, then reconnect once

    A first npx download can exceed Claude Code's default 30s startup window. Start with MCP_TIMEOUT=60000 claude (milliseconds). In Cursor, remove the server from Customize > MCPs and re-add it, or toggle it off and on after the log is clean. If only tools are missing while the server says connected, the process started without a required key: add that env var and reconnect.

Which tools are best to fix an MCP server that won't connect?

Claude Code MCP quickstart

Statuses from claude mcp list / /mcp, config paths, and the Failed to connect checklist.

Cursor MCP

stdio vs SSE/HTTP, mcp.json fields, and how to open MCP Logs.

Cursor MCP help

Where to put mcp.json, how to toggle servers, and when to restart Cursor.

Official MCP Registry

Prefer servers published by the product they connect to.

All tools for “Fix an MCP server that won't connect” →

Related fixes

See also AI tools launched today on the daily board.