MCP Shipyard
← Rules catalog

Slow OAuth endpoints break MCP sign-in: keep discovery and token under 10 seconds

Claude waits 10 seconds for discovery, registration and token endpoints. Remove cold starts and slow upstream calls from your OAuth path.

majorauth.discovery-latencyClaude

Keep every OAuth endpoint under 3 seconds. The rule auth.discovery-latency is a major finding for Claude. It warns above 3 seconds and fails above 10 seconds for any measured auth endpoint, matching Claude's documented limit.

What you see

  • A scan reports <endpoint> took 11840 ms for one or more discovery, registration or token calls.
  • Sign-in works sometimes and fails at other times, usually first thing after idle time.
  • The failure message varies by cause. Claude's troubleshooting page covers "Couldn't reach the MCP server" and "Authorization with the MCP server failed"; which one appears for a timeout is not verified here.

Why it happens

Claude's authentication page says: "Claude waits up to 10 seconds for a response from your OAuth discovery, registration, and token endpoints, and up to 30 seconds for refresh token requests. If no response arrives within that window, Claude treats the flow as a failure, even if your server eventually completes the request."

Typical causes are cold starts on serverless functions, a token endpoint that calls a slow downstream service before answering, and a WAF or gateway that holds the response while it inspects it.

Check it yourself

for u in \
  https://mcp.acme.example/.well-known/oauth-protected-resource \
  https://auth.acme.example/.well-known/oauth-authorization-server; do
  curl -s -o /dev/null -w "$u %{time_total}s\n" "$u"
done

Run it after 15 minutes of idle time to catch cold starts. Time POST /register and POST /token the same way from a test client.

Fix

  1. Serve metadata documents from memory or a static file.
  2. Keep one instance warm on the identity path.
  3. Return the token response without waiting on non-essential upstream work. Do audit logging and provisioning after the response.
  4. Check the reverse proxy, gateway or WAF in front of the endpoint is not buffering or challenging the request. Anthropic's traffic comes from 160.79.104.0/21.

Verify

Every curl line above should print well under 3 seconds, cold and warm. Re-scan.

Which clients care

Claude, per the rule. The limits come from Claude's documentation. The handshake equivalent for the MCP endpoint itself is covered in latency.handshake.

Source

Claude authentication docs (endpoint latency): https://claude.com/docs/connectors/building/authentication

Run a free scan at https://mcpshipyard.com/scan to check every rule at once.

Check every rule at once

A free scan runs this check and the other 152 against your live URL.

Scan a server