AdYour product here, seen by people installing AI tools every day Sponsor slots open: 12 of 12, from $249 a month

Troubleshooting

Fix "failed to connect" for an MCP server in Claude Code

Claude Code marks a server as failed when its start command exits or does not answer in time. Run claude mcp list to see the status, then run the server command yourself in the same terminal to see the real error. Slow first starts can be fixed with a longer startup timeout.

Why it happens

  • The command after -- is wrong or the package does not exist.
  • A required environment variable is missing.
  • The first start downloads the package and takes longer than the timeout.

How to fix it

  1. 1

    Check the status

    claude mcp list

    Inside a session, /mcp shows each server and lets you reconnect.

  2. 2

    Run it by hand

    Run the exact command you passed after --. Fix any error it prints, then reconnect.

  3. 3

    Pass environment variables

    claude mcp add my-server -e API_KEY=your-key -- npx -y package-name
  4. 4

    Allow a slower start

    Start Claude Code with a longer MCP startup timeout, for example MCP_TIMEOUT=30000 claude (milliseconds).

Still stuck? Every server page on this site shows the exact config for each app. Find your server.