On this page
Works in Claude Code but not claude.ai
Couldn't reach the MCP server One toast covers four different failures: a claude.ai connector reaches your server from Anthropic's infrastructure over the public internet rather than from your machine, so the request dies at whichever hop exists only on that path — DNS, your edge, a redirect, or OAuth discovery.
- MCP specification
- 2026-07-28
Is this you?
Four causes, four checks, in the order Anthropic's own diagnostic checklist runs them. Run all of them from a network outside your own: a check that passes on your VPN proves nothing about the hosted path.
- This error
digreturns nothing, returns onlyAAAA, or returns an address in10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,100.64.0.0/10, loopback or link-local — and a mix of routable and non-routable answers fails the same way. A301,302,307, or308to a different host.403or429in your edge or CDN logs during the Connect attempt that your application never generated.404on the protected-resource document and on both authorization-server documents, which leaves Claude nothing to read.- Then the fix is the next section.
- Working
- One or more
Arecords, every one of them globally routable. No3xxwhoseLocationpoints at another host. Any HTTP response at all from thePOST— a401or a405is fine, a timeout or connection refused is not.200and valid JSON from/.well-known/oauth-protected-resource/mcp, whoseresourcefield matches the canonical form of the URL entered in Claude — lowercased scheme and host, no trailing slash, path included — and200from one of/.well-known/oauth-authorization-serveror/.well-known/openid-configurationon the issuer host yourauthorization_serversnames first. A404on the other one is expected. - Then this isn't your problem — try the error reference.
5 other strings clients print for this
- Authorization with the MCP server failed
- Works in Claude Code or curl but not claude.ai
- works in MCP Inspector or Claude Code CLI but not claude.ai
- Custom connector "Couldn't reach the MCP server" — zero inbound traffic at edge, server verified reachable
- AADSTS9010010 (sometimes surfaced as invalid_target)
Fix it
Identify the hop before you change anything; there are four, in the order Anthropic's own checklist runs them. Public DNS: Claude validates every address your hostname resolves to and rejects anything not globally routable, or a host with no A record, because connectors are IPv4-only. Your edge: find the 403 or 429 in your CDN or WAF logs that your application never generated, and allowlist Anthropic's outbound range, 160.79.104.0/21. A redirect: a 3xx to another host drops the Authorization header, so the failure resurfaces as "Authorization with the MCP server failed" instead. Discovery: confirm your /.well-known documents answer, including on a cross-host authorization server, which Anthropic reaches from that same range. The toast and the page URL carry a time-limited reference id starting ofid_; file it with your server URL and access logs on anthropics/claude-ai-mcp so Anthropic can trace the request server-side.
Have your agent fix this
Copy a prompt that sends your coding agent to this page to find and apply the right fix for your project.
The cause depends on your platform. Pick yours.
Where does the request die?
Claude custom connectors
If your server's access log shows nothing at all during the Connect attempt
- 1 Expect no traffic at all from a rejected name. Claude resolves the hostname and validates the result before it makes any request, rejecting private, carrier-grade NAT, loopback, and link-local addresses, any mix of public and non-public answers, and a hostname with no
Arecord from public DNS. Connectors are IPv4-only, so anAAAA-only host has nothing to dial. - 2 Publish the server on a globally routable IPv4 endpoint: a host with a public IP, a public reverse proxy, or a tunnel. An Anthropic MCP tunnel doesn't close this gap for claude.ai — the docs state that tunnels created through the Console are not available as connectors in claude.ai, and reach Claude Managed Agents and the Messages API only.
- 3 Then collect the reference id. It starts
ofid_and appears in the error toast and in the page URL; file it with your server URL and your server-side access logs on theanthropics/claude-ai-mcptracker. It is what lets Anthropic trace the exact failure server-side, and reference ids expire, so report soon after the failure.
Kubernetes
If the public record points into your cluster's network, or your ingress has a source-IP allowlist
- 1 Check what address your public zone publishes.
networking.gke.io/load-balancer-type: "Internal"on a GKE Service creates a load balancer that, per Google's docs, only clients in the same VPC network or a network connected to it can reach — so if that address is what the zone publishes, claude.ai resolves it, sees a non-routable answer, and stops before sending anything. - 2 Point the public record at an internet-facing ingress and keep the internal name for in-cluster callers. Verify with
dig +short Afrom outside your network, not from a pod and not from a laptop on the VPN. - 3 Add
160.79.104.0/21to whichever source-IP allowlist applies.nginx.ingress.kubernetes.io/whitelist-source-rangesets the allowed client IP source ranges as a comma-separated CIDR list, and ingress-nginx documents that an annotation on an Ingress rule overrides any global restriction — so miss it and the MCP and OAuth paths never reach your pod. Don't treat that allowlist as authentication: the range is shared by every Anthropic customer.
Cloudflare Access
If Cloudflare Access or a WAF rule sits in front of the hostname
- 1 Look for
403or429responses in your edge or CDN logs that your application didn't generate, especially during a Connect attempt. That is the only reliable tell: a WAF rule, a bot-management rule, and a rate limiter all answer before your application does, and all three look identical from claude.ai. Cloudflare Access in front of the hostname is a different failure with the same toast — it authenticates browser sessions, and that shape has its own page in the related errors on this page. - 2 Add a Bypass policy for Anthropic's outbound range using an IP-range selector, which takes CIDR notation:
160.79.104.0/21. Cloudflare documents Bypass as disabling Access enforcement for traffic matching the rule, and that bypassed requests are not logged — so it removes your only gate on that path, and the MCP route needs its own authentication afterwards. - 3 Don't plan on a service token instead. That needs Claude to send
CF-Access-Client-IdandCF-Access-Client-Secret, and claude.ai's request-header authentication is in beta and gated on contacting Anthropic, accepts at most four headers, and restricts names to a reviewed allowlist of standard authentication and routing headers such asauthorization,x-api-key, andx-auth-token.
AWS Load Balancer
If a WAF web ACL, security group, or network ACL sits in front of your load balancer
- 1 Create an IP set holding
160.79.104.0/21and reference it from a rule with an Allow action, ordered ahead of the blocking rules. A web ACL whose default action is Block, or a managed rule group that reads an unattended client as a bot, answers before your target group does. In the console rule builder the Request option to choose isOriginates from an IP address in; in the API the statement isIPSetReferenceStatement. AWS WAF supports every IPv4 and IPv6 CIDR range except/0, and one IP set holds up to 10,000 addresses or ranges. - 2 Check the security group and any network ACL as well. A group scoped to your corporate ranges drops the connection with no HTTP response at all, which claude.ai reports with the same string and which leaves nothing in your WAF logs to find.
- 3 If the listener also carries an
authenticate-oidcaction, treat that as a separate failure with the same toast — a browser redirect an MCP client can't follow. It has its own page in the related errors on this page.
Vercel
If the URL you registered redirects — apex to www, region routing, or a vanity domain to a CDN
- 1 Expect the apex URL to be a redirect rather than an endpoint. Vercel recommends the
wwwsubdomain as the primary domain with a redirect from the non-wwwdomain to it, and its docs say that if someone visits your domain with or without thewwwprefix, Vercel attempts to redirect automatically — so the apex URL a developer naturally pastes into the connector dialog is the redirect. - 2 Read the other error string as this cause. Standard HTTP client security behavior drops the
Authorizationheader on a cross-host redirect, so the redirect target receives an unauthenticated request, returns401, and the connection fails with "Authorization with the MCP server failed". - 3 Register the URL the server actually listens on, not one that redirects to it.
curl -sIthe registered URL: if the status is a3xxand theLocationnames another host, that target is the URL to register. Region routing and vanity-domain-to-CDN redirects behave the same way.
Microsoft Entra ID
If your authorization server is Microsoft Entra ID and the token request fails with AADSTS9010010
- 1 Read this on the other toast: Anthropic documents it under "Authorization with the MCP server failed", because the MCP endpoint was reachable and the token request is what failed. Entra is rejecting the
resourcevalue Claude sends, sometimes surfaced asinvalid_target. Claude setsresourceto your MCP server URL including the path, and Entra issues a token only when that value is listed as an Application ID URI on the app registration representing your protected API. The defaultapi://{client-id}URI alone is not enough. - 2 In the Entra admin center open the API's app registration — not the client's, if they are separate — and under Expose an API add your MCP server URL as an additional Application ID URI (
identifierUrisin the manifest). The value must match exactly, including the path, without a trailing slash. - 3 If your server validates the audience through Azure App Service Authentication, add the API app's Application (client) ID and its
api://URI to the allowed token audiences — theAllowed token audiencessetting, notAllowed client applications, which is a different list. And where the client and the API are separate registrations, confirm the client has an admin-consented API permission for the scope your API exposes.
Zuplo MCP Gateway
If the MCP server genuinely cannot be published to the public internet
- 1 Accept that a claude.ai connector needs a public origin in front of the private server. claude.ai has no private path into your network, and Anthropic's own MCP tunnels don't provide one: they are a research preview, and the docs state that tunnels created through the Console are not available as connectors in claude.ai.
- 2 Put the gateway there: one public HTTPS route per upstream MCP server, reaching a server that exists only inside your VPC or on bare metal over the Zuplo secure tunnel. The tunnel service dials out from inside your network, so nothing is exposed to the internet and no inbound firewall rule is opened.
- 3 Let it answer the discovery half of this error too. For its MCP routes the gateway is both the OAuth 2.1 resource server and the authorization server, publishing an RFC 9728 protected resource metadata document per route and RFC 8414 authorization-server metadata both gateway-wide and per route — so there is no cross-host authorization server for a WAF to block.
Something else
Whatever sits in front of your server, the branch is the hop, and there are only four. Nothing on your network saw the request: the name you registered resolves to something Anthropic won't dial, so fix the public record or publish a routable IPv4 endpoint. Something answered before your application did: find the 403 or 429 in the edge logs and allowlist 160.79.104.0/21 on that component, or exempt the MCP and OAuth paths from the rule. The request arrived without its credential: your URL redirects to another host, so register the target instead. The MCP endpoint answered but discovery didn't: return a 401 carrying WWW-Authenticate: Bearer resource_metadata="…", or serve /.well-known/oauth-protected-resource/<your-mcp-path> on the origin, and remember that discovery requests to a cross-host authorization server arrive from the same egress range — so a WAF in front of your identity provider breaks the connection even when your MCP server is perfectly reachable.
Why it happens
claude.ai connectors run on Anthropic's infrastructure and reach your server over the public internet, so everything that differs between that path and your laptop shows up here and nowhere else: split-horizon DNS answering with an internal address, a hostname that only resolves on the VPN, an edge rule that has never seen Anthropic's egress range, an apex-to-www canonicalization no browser complains about.
Each cause empties a different log, which is what makes the toast hard to read. The pre-flight DNS check sends nothing at all, so no log you own records anything. An edge block leaves your application log empty but puts a 403 or 429 in your CDN's.
A discovery failure is documented as surfacing under this same string even when your MCP endpoint is reachable, with the signature that your MCP server sees the first request while your authorization server sees no traffic at all.
The redirect case is the one the wording misleads on: the request does arrive, without its credential, so the redirect target answers 401 and Claude reports "Authorization with the MCP server failed" instead. Local clients fail fast on a redirect, which is why the same misconfiguration looks instantly broken in MCP Inspector and looks like an auth bug on claude.ai.
The exchange
- claude.ai Anthropic infrastructure
- Your edge CDN, WAF, ingress
- MCP server
- Authorization server
-
Split-horizon or internal DNS is the usual cause: the record that answers from the public internet carries an internal address. A mix of public and non-public answers is rejected too — every address must be globally routable.
Inside claude.ai
Resolve mcp.example.com public DNS — A records only, IPv4-only -
Inside claude.ai
Check every address it got back 203.0.113.9, 10.4.2.11 -
Nothing leaves Anthropic's network, which is why the server looks healthy and the access log is empty. Claude Code and curl connect because they resolve and dial from your machine.
Inside claude.ai
Not every address is globally routable (this step fails) rejected before any request is sentFlow stops here — Your edge and MCP server and Authorization server not reached
Once claude.ai can connect, the route is a public entry point a whole organization shares, and the questions change shape.
-
We allowlisted Anthropic's range. Isn't that our access control?
-
mcp-oauth-inboundNo.
160.79.104.0/21is shared by every Anthropic customer. One MCP OAuth policy per project — the gateway rejects a second — makes identity a token the route validates rather than a CIDR. -
One connector, added once by an admin. Which tools can it see?
-
mcp-capability-filter-inboundOnly what the route shows it — a hidden tool is refused with
MethodNotFoundbefore forwarding. A read-only view and a full-power view can be two routes, or one route withaccessControl: rolesAndGroups; the credential here is the organization's, so a shared connector has one set of roles. -
Everyone shares that connector. Who called
refund_order? -
capability_invocationEvery tool call emits an event carrying the caller, the capability, the upstream, the outcome, and the latency, so a call resolves to a subject rather than to an egress IP.
-
An agent looped on one tool for an hour. What caps it?
-
rate-limit-inboundThe route it calls through:
rateLimitBy: "user"counts the hour of retries against the authenticated identity, so the agent spends its own budget and not another team's.
All of these attach to one MCP route's policies.inbound — the same policy engine on the way in and on the way out. Your MCP server keeps
the code and the authentication it has today.
Stop debugging auth on every MCP server
A gateway in front of your MCP servers handles discovery, audience binding, and token validation once — for every server and every client.