Skip to main content
Use 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

With resource set, Redop:
  1. Serves RFC 9728 Protected Resource Metadata at /.well-known/oauth-protected-resource (and the path-suffixed form for /mcp)
  2. Returns HTTP 401 with WWW-Authenticate: Bearer resource_metadata="…" when a tool/resource/prompt call is missing or has an invalid token
  3. Returns HTTP 403 with error="insufficient_scope" when scopes are missing
  4. 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)

Or with jwt({ jwksUri, resource }) when you already know the JWKS URL:

Client handshake (Claude)

  1. Client calls a protected method without a token
  2. Redop responds 401 + WWW-Authenticate pointing at protected resource metadata
  3. Client fetches PRM → learns authorization_servers
  4. Client runs OAuth (PKCE) against that issuer
  5. Client retries with Authorization: Bearer <access_token>

Notes

  • Prefer MCP 2026-07-28 (stateless) for hosted/edge deployments
  • resource should be the exact public MCP URL the user pastes into Claude
  • Discovery tries /.well-known/oauth-authorization-server then /.well-known/openid-configuration (OIDC providers like Clerk)

See also