π OAuth 2.1 Debugger
Validate the complete OAuth 2.1 setup of any remote MCP endpoint β the same checks real MCP clients perform.
Reference β the OAuth 2.1 handshake MCP clients expect
- 401 challenge.
POST /mcp initializewithout a token β HTTP 401 withWWW-Authenticate: Bearer resource_metadata="β¦". - RFC 9728 protected-resource metadata at
/.well-known/oauth-protected-resource(path-aware variants allowed):{ "resource": "https://mcp.example.com/mcp", "authorization_servers": ["https://auth.example.com"], "scopes_supported": ["read"], "bearer_methods_supported": ["header"] } - RFC 8414 authorization-server metadata at
/.well-known/oauth-authorization-server(or OIDC discovery), withauthorization_endpoint,token_endpoint,registration_endpoint(DCR, RFC 7591) andcode_challenge_methods_supported: ["S256"]. - PKCE S256 + DCR β the client registers itself dynamically and completes the code flow with an S256 challenge.
- CORS β browsers need
Access-Control-Allow-Origin, allow headersContent-Type, Authorization, Mcp-Session-Id, and exposeMcp-Session-Id+WWW-Authenticate.
MCP client OAuth callback URLs & registration modes
Where each mainstream client sends the user back after consent β and how it obtains aclient_id. Use this to configure your authorization server's redirect-URI whitelist or to decide whether you must enable Dynamic Client Registration (DCR).
| Client | Redirect / callback | Client registration |
|---|---|---|
| Claude.ai Web / Mobile | Fixed Anthropic-hosted callback (claude.ai domain) β no local port | Pre-registered or DCR depending on server |
| Claude Desktop | Anthropic-hosted callback via the desktop app | DCR / pre-registered |
| Claude Code (CLI) | Local loopback on a random port: http://localhost:<port>/callback | DCR (RFC 7591) or CIMD β must allow localhost redirect URIs |
| Cursor | Local loopback listener + cursor:// URI handler | DCR; wildcard/loopback redirect URIs needed |
| VS Code | Local loopback + vscode:// URI handler | DCR |
| ChatGPT Connectors | OpenAI cloud-side callback β no localhost | Pre-registered by OpenAI |
| Kiro (AWS IDE) | Local loopback callback | DCR |
Practical guidance: allow http://localhost/http://127.0.0.1 redirect URIs with any port for CLI/IDE clients, support DCR (registration_endpoint) so unknown clients can self-register, and keep HTTPS redirect URIs for cloud clients like ChatGPT.
RFC 9728 PRM & CIMD overview
Protected Resource Metadata (PRM) is the JSON document your MCP server publishes at/.well-known/oauth-protected-resource (optionally path-suffixed). It tells clients whichauthorization_servers to talk to and which scopes_supported exist, and it is advertised through the WWW-Authenticate: Bearer resource_metadata="β¦" parameter on the initial 401. Every OAuth-protected remote MCP endpoint should serve it β the debugger above checks it for you.
CIMD (Client ID Metadata Document) is the MCP ecosystem's newer alternative to Dynamic Client Registration: instead of calling a registration_endpoint to mint aclient_id, the client's client_id is itself an HTTPS URL pointing to a JSON metadata document describing the client (name, redirect URIs, logo). Servers fetch and cache that document β no per-client database writes and no DCR endpoint to defend against registration spam. Adopt CIMD if you control the authorization server and want registration-free onboarding; keep DCR enabled as well for the many clients that still rely on it.
Need Managed OAuth 2.1 or Edge Hosting for Your MCP Server?
Debugging a home-grown OAuth setup is exactly what these managed providers eliminate β their official remote MCP endpoints are listed in our directory:
Or compare which clients already handle OAuth 2.1 correctly in our MCP Clients Compatibility Matrix. Building your own server? Scaffold an OAuth 2.1-ready Cloudflare Workers MCP in 60 seconds β its generated endpoint passes this debugger out of the box.