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.
How do I fix this: Your MCP server shows Failed to connect?
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
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.
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.
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.
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.
Open: 1 spot per week
One labeled sponsor for this topic each week; this week's spot is open. See open weeks →
All tools for “Fix an MCP server that won't connect” →
Related fixes
- Stop a Cursor agent loopHow to fix a Cursor agent loop (same edit, or work after Stop)Fix →
- Claude Code vs Codex vs Cursor ~$20 plansClaude Code vs Codex vs Cursor $20 plan limits: how to pick without burning the weekFix →
- Scan a vibe-coded app for leaked API keysCheck a vibe-coded app for leaked API keys before you share itFix →
- Add an MCP server to Claude Code, Cursor, or CodexHow to add an MCP server to Claude Code, Cursor, or CodexFix →
See also AI tools launched today on the daily board.
NewAIToolsToday Daily
Top 3 AI launches, one model or news item that matters, and one simple fix. A 5-minute read, every weekday.