An MCP server that will not load can tell you so in four ways. The reflex is to rerun the command or paste a fresh token and see what happens. That guessing turns a one-line status into a lost afternoon. The status you already have names the one stage that broke.
A status names the broken boundary
Treat an MCP status as evidence. Failed to connect, Needs authentication, Pending approval and MCP tools fetch failed each point to a different stage between Claude Code and the server. Knowing which one you have is most of the diagnosis. Find it before you touch the config. Every unrelated edit is one more thing you will have to rule out later.
The stages always run in the same order. First the process or remote endpoint must be reachable. Then login must succeed. Then the server lists its tools. Passing one stage says nothing about the next. So start from the status you see, and save the raw error, the transport type and the time of the attempt:
Failed to connect
Needs authentication
Pending approval
MCP tools fetch failed
Process logs, proxy logs or the server's own response can add detail later. But the label tells you where to look first.
Failed to connect means no usable session
Failed to connect means Claude Code never got a working session with the server. That does not mean the server is broken or that login is at fault. With stdio, the failure can happen before the server reads a single request. With a remote server, the network and HTTPS can be fine while the endpoint, a redirect or the handshake is not.
For a stdio server, check the child process first. A command that works in your shell can fail under Claude Code because it gets a different working folder, PATH, runtime version or environment. A missing program, arguments broken by quoting, package-manager shims outside the path, and processes that exit at once all show this status. Startup messages are a common trap. Each message on stdout must be one line of JSON, so a single banner printed before the first response breaks the parse. Send your logs to stderr and keep stdout for protocol messages only.
For an HTTP MCP server, test the exact endpoint you configured, not the home page or a health check. A proxy can return a login page, an HTML error, a redirect or the wrong server while a browser still seems to reach the site. TLS problems, proxy login and a wrong path all give the same status, so the details matter. A corporate proxy answering 407 Proxy Authentication Required, a 302 to a single sign-on page, and a 404 because the server lives under another path are three different fixes behind one label.
In practice: for stdio, save the exit code and stderr, then compare the launched command and environment with the config entry. For HTTP, check the request path, the response status and headers, and the proxy logs for that moment. Do not change credentials yet unless you see a login challenge. It only adds another variable.
Authentication needs more than a token
Needs authentication means Claude Code reached the server, but the server refused access. So the connection is no longer the main suspect. Editing the server command or a network setting will not fix OAuth consent, an expired credential or an account without access.
It often appears after a server switches from open to protected access, when an OAuth refresh token expires, when you logged in under a different local profile, or when your account lacks the rights even to list tools. A successful browser login means little here. It helps only if that session is stored where the MCP client can reach it.
So log in from the same Claude Code context that showed the status. Check that the account and permissions are the ones you expect. Only then retry discovery. If you suspect old credentials, save the raw error and the account details before you delete anything. Wiping credentials first can hide an account mismatch and send you round the same broken loop.
One mismatch is worth naming. A token in an environment variable will not satisfy a server that expects an interactive OAuth login. And an OAuth login will not satisfy a server that wants a fixed API key. The server's login model decides the fix.
Pending approval is a permission gate
Pending approval is neither a connection fault nor a login prompt. Claude Code found a server entry that needs an explicit trust decision. Your job is to review it; retrying changes nothing.
Look at the program or endpoint, the arguments and the environment values passed in. Approval gives a local integration real permissions. So a command that was safe yesterday deserves a fresh look if its path, arguments, package version or remote address changed. Approving something just to make the warning go away throws away the safeguard.
Once you have checked it, approve through the Claude Code permission flow and look at the status again. If it stays pending, find out whether it is a local prompt or an organisation policy that blocks or reviews integrations. Authentication can still fail after approval, but that is a different state with its own evidence. Approval is not the finish line.
In incident notes, do not describe pending approval as the server being down. The system may be doing exactly what it should. Record it as an authorisation decision, with who approved it and which definition they reviewed.
Tool fetching fails after the connection stage
MCP tools fetch failed comes later in the sequence. Claude Code has enough access to ask for the tools, but the server did not send back a usable list. The problem is usually around tools/list, not at launch or in the network.
The usual causes: incompatible protocol behaviour, broken JSON, extra output on stdio, a crash while a tool loads, or a login redirect instead of an MCP response. A remote server can also accept the first request while a service it calls during discovery fails. The connection then looks healthy, but no tools appear.
Keep the raw response or the server error from discovery, because the fixes differ a lot. HTTP 401 sends you back to authorisation. A parsing error points to formatting or extra stdout output. A server exception means reading server logs and checking its dependencies. JSON-RPC error codes help too: -32700 is a parse error, -32601 is "method not found", and -32602 means invalid parameters. The code often names the fix before you open a log. A -32601 on tools/list usually means the server never registered its tools or speaks an older protocol version.
A running process proves little here: it can fail every tools/list request it gets. An open port proves even less. Success means Claude Code receives and shows the list of tools you expected.
Stdio and HTTP leave different evidence
The same status points to different evidence for each transport. Do not use HTTP checks on a stdio server, and do not read a remote redirect as a crashed process.
| Status or symptom | Boundary that failed | Evidence to capture | Corrective direction |
|---|---|---|---|
Failed to connect with stdio |
Process launch or initial protocol stream | Executable path, exit code, stderr, working directory, inherited environment |
Fix command resolution, arguments, runtime access, or stdout contamination |
Failed to connect with HTTP |
Endpoint reachability or handshake | Exact request path, HTTP status, response headers, proxy and TLS logs | Correct endpoint, proxy route, certificate chain, or network policy |
Needs authentication |
Server authorisation | Auth challenge, account identity, scope or permission error, credential-store context | Complete required auth flow or repair credential state |
Pending approval |
Local trust policy | Server definition, changed fields, approval record, managed-policy message | Review integration and complete approval path |
MCP tools fetch failed |
Capability discovery | tools/list response, JSON-RPC error, server stack trace, stdout or response body |
Repair protocol output, tool registration, downstream dependencies, or authorisation |
A browser test only helps for HTTP. Even then it may follow redirects or use a login session Claude Code does not have. A terminal test helps only if it uses the same program, arguments and environment as the MCP launch. Different contexts often explain different failures, so pin the context down.
The table becomes a routine if you ask one question per status before changing anything:
Failed to connect→ is the server stdio or HTTP?- stdio: run the exact launch command with the same working directory and environment. A non-zero exit means: read stderr and check the launch context. Extra output on stdout means: move your logs to stderr. If it works by hand but not under Claude Code, the PATH, folder or runtime differs, so make them match.
- HTTP: call the exact configured endpoint, not the home page. HTML, a login page or a redirect means the path or proxy route is wrong. If TLS is fine but there is no MCP handshake, check the endpoint path and upstream target before the certificates.
Needs authentication→ did the status just move here fromFailed to connect? Then the connection works. Stop editing the command and finish auth in the same Claude Code context. If you pass a token in an env var but the server wants interactive OAuth, or the other way round, give it the credential type it expects.Pending approval→ did the definition, path, arguments or endpoint change recently? Review what changed before you approve. If it is still pending afterwards, check for an org policy rather than a local prompt.MCP tools fetch failed→ save thetools/listresponse. HTTP 401 sends you back to authorisation. A JSON parse error points to extra stdout output or broken formatting. HTTP 500 or a stack trace means the server failed during discovery, in its handler, a dependency or a proxy, not in the connection.
Change one condition per retry. If the status advances to a later boundary, treat that as progress: the first diagnosis was probably right.
Preserve a small reproduction artifact
A screenshot will not survive a handoff. Keep the smallest record that reproduces the failure. It keeps secrets out of the ticket and stops later config changes from rewriting the history:
timestamp and local time zone
server name and transport type
visible Claude Code status
exact raw error text
phase: launch, initialize, authentication, approval, or tools/list
command or endpoint with secrets removed
exit code or HTTP status
relevant stderr, proxy log, or server exception
change made and status after retry
The phase matters more than a long story. A ticket that says the status moved from Failed to connect to Needs authentication tells the next person that the network or process stage already works. It also explains the one-change rule: if the command, token, proxy and approval all changed together, nobody can say which one helped.
The maths is harsh. Change four things at once (command path, token, proxy setting, approval) and watch the status clear. Now any of 15 combinations of those changes could be the cause. You will keep all four, including the token change that did nothing, and the next engineer inherits a superstition. One change per retry costs at most four attempts and leaves exactly one suspect. Say a Failed to connect clears on the third single change, moving startup logs from stdout to stderr. The ticket gets its cause in one line. Bundle the same fix with a reinstall and a new token, and the ticket learns nothing.
Raw errors expose false fixes. A timeout that disappears after a token change may be a coincidence if a proxy recovered at the same moment. A tool list that works after approval does not prove authentication is healthy. Record the status before and after every change, so you know what actually fixed it.
More servers create status ambiguity
A team can end up with local stdio tools, remote services, and shared project entries next to personal ones with the same display name. Claude Code may then launch a different definition from the one you are debugging. Clear, distinct names and a note of the transport in each incident are a cheap defence.
Shared setups also drift. Two definitions can look identical while credentials, runtime paths, proxy settings and approvals differ behind them. So treat a fix that worked on one machine as a guess until it works in the same launch context somewhere else.
What you match logs by depends on the transport. For remote services, match requests. For local servers, match processes. Without timestamps and IDs, it is easy to mistake logs from an old launch for the current failure. It gets worse when discovery calls other APIs, because the status shows only the first stage that failed.
Sometimes reinstalling beats diagnosing
On a single laptop, time argues against all of this. With one stdio server and no shared setup, deleting the entry and adding it again takes about two minutes. A careful record of phase, exit code and stderr can take twenty. If the failure never comes back, the reinstall was the right call, and nobody needs an incident note.
The shortcut works only in a narrow case: one user, a local server, no OAuth, and no project entry that teammates also load. Change any of these and a reinstall starts hiding evidence. It resets credentials, which hides an account mismatch. It asks for approval again, which hides a changed definition. On a shared entry it fixes your machine, and the same failure waits for the next person. A simple rule: allow one clean reinstall for a personal stdio server. If the same status comes back within a week, or the server is remote, uses OAuth or is shared, go stage by stage and keep the record.
Each time the status moves to a later stage, add the new phase to the top of your notes. A working integration passes every stage: the process or endpoint is reachable, it is approved and authorised, and tools/list returns the tools Claude Code asked for.