oauth(...) when your MCP server is a protected resource in front of an external authorization server (Clerk, WorkOS, Auth0, or any OAuth 2.1 / OIDC issuer).
What Redop provides
Withresource set, Redop:
- Serves RFC 9728 Protected Resource Metadata at
/.well-known/oauth-protected-resource(and the path-suffixed form for/mcp) - Returns HTTP 401 with
WWW-Authenticate: Bearer resource_metadata="…"when a tool/resource/prompt call is missing or has an invalid token - Returns HTTP 403 with
error="insufficient_scope"when scopes are missing - Verifies Bearer JWTs via authorization-server discovery + JWKS
initialize, server/discover, and list methods stay public so clients can discover the server before authenticating.
Example (Claude / Clerk / WorkOS shape)
jwt({ jwksUri, resource }) when you already know the JWKS URL:
Client handshake (Claude)
- Client calls a protected method without a token
- Redop responds
401+WWW-Authenticatepointing at protected resource metadata - Client fetches PRM → learns
authorization_servers - Client runs OAuth (PKCE) against that issuer
- Client retries with
Authorization: Bearer <access_token>
Notes
- Prefer MCP
2026-07-28(stateless) for hosted/edge deployments resourceshould be the exact public MCP URL the user pastes into Claude- Discovery tries
/.well-known/oauth-authorization-serverthen/.well-known/openid-configuration(OIDC providers like Clerk)