OAuth Protected Resource Metadata
Discovers OAuth configuration for MCP endpoints.Query Parameters
Resource hint URL. If provided, must match the server’s origin. Determines which MCP endpoint’s metadata to return.
Response
The MCP endpoint URL that requires authorization
Array of OAuth authorization server URLs
Supported bearer token transmission methods (always
["header"])Behavior
- If
resourceparameter is not provided, defaults to/v1/mcp - If
resourcepoints to anonymous MCP endpoints (/v1/mcp/anonymous,/mcp/anonymous), returns 404 - If
resourceorigin doesn’t match server origin, returns 400 - Authorization server URL is sourced from environment:
MCP_AUTHORIZATION_SERVERMCP_AUTHORIZATION_SERVER_URLWORKOS_AUTHKIT_ISSUERWORKOS_AUTHKIT_DOMAIN
Example Request
Error Responses
400 Bad Request
Invalid resource hint:Or resource hint origin mismatch:
404 Not Found
OAuth not configured (self-hosted):Or anonymous endpoint requested:
OAuth required but not configured (cloud):
OAuth Authorization Server Metadata
Proxy endpoint for upstream authorization server metadata.Response
Proxies the response from the configured authorization server’s/.well-known/oauth-authorization-server endpoint.
Typical response structure:
Example Request
Error Responses
404 Not Found
OAuth not configured (self-hosted):
OAuth required but not configured (cloud):
Anonymous Authentication Token
Issues short-lived JWT tokens for anonymous account access.Rate Limiting
30 requests per minute per IP + user agent.Response
Always
"Bearer"ES256-signed JWT token. Contains:
iss- Issuer (deployment URL)sub- Anonymous account IDaud- Audience (executor-anonymous)provider- Always"anonymous"iat- Issued at timestampnbf- Not before (iat - 5 seconds)exp- Expiration timestamp
Unique anonymous account identifier. Format:
anon_<32 hex chars>Token expiration time in milliseconds since Unix epoch
Token Lifetime
Default: 3600 seconds (1 hour). Configurable viaANONYMOUS_AUTH_TOKEN_TTL_SECONDS environment variable.
Example Request
Error Responses
400 Bad Request
Token generation failed:
429 Too Many Requests
Rate limit exceeded:Includes
Retry-After header (seconds).Anonymous auth not configured:
Configuration Requirements
Anonymous token issuance requires:ES256 private key in PEM format. Used to sign tokens. Supports
\n escape sequences.ES256 public key in PEM format. Used by JWKS endpoint. Supports
\n escape sequences.Token lifetime in seconds. Default: 3600 (1 hour).
JSON Web Key Set (JWKS)
Publishes the public key for verifying anonymous tokens.Response
Array of JWK public keys. Contains a single ES256 key:
kid- Key ID (always"anonymous-auth")alg- Algorithm (always"ES256")use- Key usage (always"sig")kty- Key type (always"EC")crv- Curve (always"P-256")x,y- Public key coordinates (Base64URL-encoded)
Example Request
Error Responses
Anonymous auth not configured:
Implementation Details
Source files:- OAuth handlers:
executor/packages/database/convex/http/oauth_handlers.ts:11-86 - Anonymous auth:
executor/packages/database/convex/http/anonymous_auth.ts:91-159 - MCP auth config:
executor/packages/database/convex/http/mcp_auth.ts:10-79 - Rate limiting:
executor/packages/database/convex/http/rate_limit.ts:84-93
Token Verification
Anonymous tokens are verified using the JWKS endpoint. Token claims:provider: "anonymous" claim distinguishes anonymous tokens from WorkOS tokens.