Claude says "Couldn't reach the MCP server": a diagnosis tree
What "Couldn't reach the MCP server" means in Claude, and an ordered set of curl checks for DNS, redirects, firewalls, OAuth discovery and the handshake.
On this page
- Claude says "Couldn't reach the MCP server"
- Before you start
- The diagnosis tree
- 1. Does the hostname resolve to a public IPv4 address?
- 2. Is the endpoint reachable from the public internet?
- 3. Does the URL redirect?
- 4. Is a firewall or WAF blocking Anthropic?
- 5. Does OAuth discovery work?
- 6. Does the handshake finish in time?
- 7. Does the server list tools?
- What each result means
- If every check passes
Claude says "Couldn't reach the MCP server"
The message means Claude could not finish the connection handshake with your server. Anthropic's troubleshooting page says that, despite the wording, it is not always a network failure: an unreadable OAuth discovery document, a redirect to another host and a firewall rule can all produce it. Work through the checks below in order, because they follow the order in which Claude meets problems.
Sources: Anthropic's connector troubleshooting guide and the authentication docs. Where this page relies on something else, it says so.
Before you start
Claude's connector runs on Anthropic's infrastructure and reaches your server over the public internet. A test that passes from your laptop proves little. Run every check below from a network that is not yours (a cloud shell or a phone hotspot), with https://mcp.acme.example/mcp standing in for your endpoint.
When the failure happens on claude.ai, Anthropic says the error URL carries a reference ID. Copy it before you retry; if you end up reporting the problem, include it with your server URL and log timestamps.
The diagnosis tree
1. Does the hostname resolve to a public IPv4 address?
Claude resolves your hostname first and rejects the connection if any returned address is not globally routable. Anthropic lists private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), carrier-grade NAT (100.64.0.0/10), loopback and link-local addresses, a mix of public and non-public answers, and a hostname with no A record. Connectors are IPv4-only, so an AAAA-only hostname fails. Your access logs see nothing, because no request leaves Anthropic.
dig +short A mcp.acme.example
dig +short AAAA mcp.acme.example
Expect at least one public IPv4 address and no private ones. Split-horizon DNS, dynamic DNS names and VPN-only hostnames are the usual culprits.
2. Is the endpoint reachable from the public internet?
curl -i -m 15 https://mcp.acme.example/mcp
A 401, 405 or 400 is fine: something answered. A timeout, connection reset or TLS error is not. Check the certificate chain too (the scanner rule is auth.https).
3. Does the URL redirect?
curl -sI https://mcp.acme.example/mcp
If you get a 301, 302, 307 or 308 to a different host (apex to www, regional routing, a vanity domain in front of a CDN), register the final URL instead. Anthropic says Claude follows the redirect, drops the Authorization header as standard HTTP clients do, and the target answers 401, so the failure shows up later as an authorization error. Redirects on the same host, such as a trailing slash, are covered in 405 and 307 errors on an MCP endpoint.
4. Is a firewall or WAF blocking Anthropic?
Look in your edge logs for 403 or 429 responses that your application did not produce, around the time of your Connect attempt. Anthropic's docs say to allowlist its published egress range or exempt the MCP and OAuth paths from the blocking rule, and they list the outbound range as 160.79.104.0/21. Check the identity provider's firewall as well, since it is often a different host with a different WAF.
5. Does OAuth discovery work?
If your server requires sign-in, Claude does discovery before it connects, and a discovery failure can surface as "Couldn't reach".
# 1. Unauthenticated call: expect 401 and a resource_metadata pointer
curl -i -X POST https://mcp.acme.example/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
# 2. Protected resource metadata: expect 200 JSON
curl -i https://mcp.acme.example/.well-known/oauth-protected-resource
# 3. Authorization server metadata for the first issuer listed there
curl -i https://auth.acme.example/.well-known/oauth-authorization-server
curl -i https://auth.acme.example/.well-known/openid-configuration
What to look for:
- Step 1 returns
401withWWW-Authenticate: Bearer resource_metadata="...". A 200 or 403 fails auth.challenge-401, and the full walk-through is in 401 without resource_metadata. - Step 2 returns JSON whose
resourceequals the URL users type, path included (auth.prm-missing, auth.resource-mismatch). - Step 3 returns metadata from the first entry of
authorization_servers, with anissuerthat matches it exactly (auth.as-metadata-missing, auth.issuer-mismatch).
Anthropic describes one telltale symptom: the sign-in page opens on /authorize at your MCP server's host and fails. That happens when Claude cannot read protected resource metadata and treats your MCP origin as the authorization server.
6. Does the handshake finish in time?
Anthropic lists three causes of an initialize timeout: slow OAuth endpoints, an overly strict Origin check that rejects Anthropic's requests, and a firewall dropping its egress. Time each step:
curl -s -o /dev/null -w 'total %{time_total}s\n' https://auth.acme.example/.well-known/openid-configuration
curl -s -o /dev/null -w 'total %{time_total}s\n' https://mcp.acme.example/.well-known/oauth-protected-resource
Claude's authentication docs give discovery, registration and token endpoints 10 seconds (30 for refresh). Cold starts on serverless platforms are a common reason to miss that window. The MCP handshake itself has a rule that warns above 2.5 seconds and fails above 8: latency.handshake.
7. Does the server list tools?
A reachable server that returns no tools looks broken in other ways, but check it: see count.zero.
What each result means
| Check result | Fix |
|---|---|
| Private or missing A record | Publish a public A record, drop split-horizon answers |
| Redirect to another host | Register the final URL |
| 403 or 429 you did not generate | Allowlist 160.79.104.0/21 for the MCP host and the identity provider |
401 without resource_metadata, or metadata 404 | Serve the pointer and the metadata |
Metadata resource differs from the URL | Make them identical |
| Slow auth endpoints | Remove cold starts from the auth path |
If every check passes
Connect once more with the server logs and the identity provider logs open side by side, and note which of the two saw a request. If your server saw the first request and the authorization server saw nothing, discovery failed. If neither saw anything, the block is in DNS or at the edge.
If you still cannot find it, report it to Anthropic with the reference ID, your server URL and your timestamps. Anthropic's tracker for connector issues is anthropics/claude-ai-mcp on GitHub.
Run a free scan at https://mcpshipyard.com/scan to check every rule at once.
Check your server against these rules
Scan runs the checks from this guide against a live URL and lists each failing rule with its fix.