When to Use
Customize OAuth client metadata when:- The OAuth server requires a pre-registered
software_idor specific scopes - You need custom branding during OAuth consent screens (your company name/logo instead of Portkey’s)
- Compliance requires specific contact info, terms of service, or privacy policy URLs
- The MCP server expects specific OAuth client configuration
How It Works
When a user first accesses an OAuth-protected MCP server, Portkey initiates the OAuth flow. As part of this process, Portkey presents client metadata to the authorization server (per RFC 7591 - OAuth 2.0 Dynamic Client Registration).Configuration
When setting up your MCP integration in the MCP Registry, expand Advanced Settings and paste your client metadata into the OAuth Metadata field as a plain JSON object:oauth_metadata.
Available Fields
Default Values
If not customized, Portkey uses:Security Notes
redirect_uris Cannot Be Customized
Theredirect_uris field is never customizable. Portkey always uses its own callback URL for OAuth flows:
Fields That Cannot Be Set
The following fields are excluded from customization:redirect_uris- Must be gateway-controlled for securityjwks_uri- Not yet supportedjwks- Not yet supportedsoftware_statement- Not yet supported
Authorization Parameters That Cannot Be Set
authorization_params cannot override the parameters Portkey and the MCP SDK own, because doing so would break PKCE or the callback correlation:
response_type, client_id, client_secret, code_challenge, code_challenge_method, redirect_uri, state, scope, resource
Any of these keys in authorization_params are ignored and logged as a warning. Use the scope field of oauth_metadata to change requested scopes.
Example: Enterprise Compliance
Your enterprise requires all OAuth registrations to include legal contact information and link to corporate policies:Example: Pre-Registered Client
Some OAuth servers require clients to be pre-registered with a specificsoftware_id:
Example: Custom Scopes
Request specific OAuth scopes from the MCP server:Example: Servers Without Dynamic Client Registration (GitHub)
Some MCP servers like GitHub don’t support OAuth Dynamic Client Registration (DCR). For these servers, create an OAuth App manually and provide the credentials to Portkey. Required fields for non-DCR servers:
Providing a
client_id disables Dynamic Client Registration entirely for that integration — Portkey presents the client you configured instead of trying to register a new one.
GitHub example:
Set the OAuth App’s Authorization callback URL to Portkey’s callback,
<gateway-url>/oauth/upstream-callback. On Portkey’s managed gateway that is https://mcp.portkey.ai/oauth/upstream-callback; on a self-hosted or hybrid deployment, use your own gateway host (the value of MCP_GATEWAY_BASE_URL). This URL is always controlled by the gateway, so a redirect_uri set in your OAuth metadata is ignored.Example: Provider-Specific Authorization Parameters (Google)
Some providers require query parameters on the authorization request that the OAuth spec doesn’t define. Google is the common case: it only returns a refresh token when the authorization request carriesaccess_type=offline, and only re-issues one for a user who has already consented when prompt=consent is also present.
Without a refresh token, Portkey has nothing to renew the connection with, so the user is pushed back through consent once the access token expires (one hour for Google).
Add these with authorization_params:
authorization_params to the upstream authorization URL on each auth flow. Values must be strings; non-string values are ignored.
Connections authorized before this setting was added have no stored refresh token, and Google skips consent for a user who has already granted access — so the setting alone won’t fix them. Remove the affected user’s connection and have them authorize again;
prompt=consent guarantees a refresh token on that pass.authorization_params inside external_auth_config instead.
Troubleshooting
Portkey still attempts Dynamic Client Registration even though I set aclient_id.
Portkey resolved no client ID from your configuration, so it fell back to registration. Check that the JSON in the OAuth Metadata field has client_id at the top level, with no outer oauth_metadata wrapper. If you configured it through the Advanced Configuration box instead, the wrapper is required there — but it must appear exactly once.
Consent succeeds, then the token exchange fails.
The client ID is being presented correctly and the failure is now on the provider side. In order of likelihood: the OAuth App is registered as a confidential/web client while Portkey defaults to token_endpoint_auth_method: "none" (set it explicitly, and supply client_secret); the callback URL registered on the provider doesn’t exactly match <gateway-url>/oauth/upstream-callback; or the app is missing a granted scope or the refresh_token grant, which Portkey requests by default.
Related
Portkey is now PRISMA AIRS AI Gateway. See it in action.
Contact Us

