Documentation Index
Fetch the complete documentation index at: https://docs.getbifrost.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
auth_type: "oauth" covers server-level OAuth: the admin authenticates once during MCP client setup, Bifrost stores the resulting token, and every subsequent request to that MCP server uses the same token regardless of which caller hit Bifrost.
If you need each end-user to authenticate themselves (personal Notion workspace, personal GitHub repos, etc.), use Per-User OAuth instead.
This auth type is only valid for HTTP and SSE connections.
What Bifrost handles for you:
- Automatic token refresh before expiration
- PKCE for public clients (no client secret)
- Dynamic Client Registration (RFC 7591)
- OAuth discovery from server URLs (
.well-known/oauth-authorization-server,.well-known/openid-configuration) - Secure token storage (encrypted at rest)
OAuth flow
Bifrost implements the Authorization Code flow:Configuration
- Web UI
- API
- config.json
- Navigate to MCP Gateway and click New MCP Server
- Pick HTTP or SSE as the connection type, fill in the Connection URL
- Set Auth Type to OAuth 2.0
- Fill in the OAuth fields:
- Client ID (optional — leave blank for Dynamic Client Registration)
- Client Secret (optional — omit for PKCE public clients)
- Authorize URL (optional — leave blank to use OAuth discovery)
- Token URL (optional — same)
- Scopes (comma-separated)
- Click Create — Bifrost runs the OAuth dance in a popup
- Sign in and authorize on the upstream provider
- The popup closes and the MCP client is persisted with the token

PKCE for public clients
For applications without a client secret, omitclient_secret and Bifrost will automatically generate PKCE code verifiers:
Dynamic Client Registration (RFC 7591)
If your OAuth provider supports DCR, omitclient_id and client_secret and provide a registration_url (or just a server_url for discovery):
- Discover OAuth endpoints from
server_url(if needed) - Register a new client via
registration_url - Continue with the standard authorize / token exchange flow
OAuth discovery
If onlyclient_id and server_url are provided, Bifrost will probe in order:
<server_url>/.well-known/oauth-authorization-server(RFC 8414)<server_url>/.well-known/openid-configuration- MCP server metadata returned by the server itself
Token management
Status
pending— admin hasn’t authorized yetauthorized— token is valid and activefailed— authorization failed or token is invalid
Automatic refresh
Bifrost refreshes the access token automatically before expiration using the stored refresh token. No action required.Rotation
The MCP client edit flow lets you rotateclient_id / client_secret while preserving the same client ID. connection_type, auth_type, and connection_string are immutable after creation.
Revoke
Provider snippets
GitHub
- Configuration
- Provider setup
- Configuration
- Provider setup
Public URL configuration
Theredirect_uri Bifrost registers and the consent URLs it builds are derived from the request Host header by default. Behind a reverse proxy, override them with:
mcp_external_client_url— public base URL Bifrost uses both for the consent pages it surfaces and as theredirect_uriregistered with upstream providers
Troubleshooting
`authorize_url` not returned on create
`authorize_url` not returned on create
Token refresh fails / tools say `oauth token expired`
Token refresh fails / tools say `oauth token expired`
- Check that the refresh token is still valid (some providers expire refresh tokens after long idle)
- Verify scopes are still sufficient
- Re-authorize:
DELETE /api/oauth/config/{id}then create a new client
Callback hangs at `/api/oauth/callback`
Callback hangs at `/api/oauth/callback`
- Confirm Bifrost is reachable at the registered redirect URI (DNS, firewall, reverse-proxy headers)
- Check
mcp_external_client_urlmatches what was registered upstream - Look at Bifrost logs for
oautherrors
`Invalid redirect URI` from the upstream provider
`Invalid redirect URI` from the upstream provider
You changed Bifrost’s public URL after the upstream client was registered. Clear the stored credentials so Bifrost re-runs DCR with the new URL.
API reference
| Endpoint | Method | Purpose |
|---|---|---|
/api/mcp/client | POST | Create MCP client; returns pending_oauth + authorize_url |
/api/mcp/client/{id}/complete-oauth | POST | Finalize after upstream redirect lands on /api/oauth/callback |
/api/oauth/callback | GET | Upstream provider redirects here; handled internally |
/api/oauth/config/{oauth_config_id}/status | GET | Current OAuth config status + token metadata |
/api/oauth/config/{oauth_config_id} | DELETE | Revoke token + remove OAuth config |
Security notes
- Tokens are stored encrypted at rest (set
BIFROST_ENCRYPTION_KEY) - PKCE is enforced automatically for public clients
- The OAuth
stateparameter is verified server-side for CSRF protection - Use HTTPS — most upstream providers refuse HTTP redirect URIs in production
- Request only the scopes your tools need
Next Steps
- Per-User OAuth — when each user should authenticate themselves
- Headers — when there’s no OAuth, just a static key
- MCP Sessions — per-user credential lifecycle (does not surface server-level OAuth)

