> ## 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.

# OAuth Client Credentials

> Connect to MCP servers that issue tokens to machines, with credentials registered at their authorization server and one token shared by every caller.

## Overview

Some MCP servers are built for machine-to-machine use: no person signs in, and the server expects a client that holds its own credentials. The **OAuth Client Credentials** auth type (`client_credentials`) covers them. You register Bifrost as a client at the server's authorization server, give Bifrost that client ID and a secret or private key, and Bifrost obtains an access token itself.

It follows the [MCP OAuth Client Credentials extension](https://modelcontextprotocol.io/extensions/auth/oauth-client-credentials), and Bifrost declares that extension to the server when it connects.

* **One token per server.** Every caller reaches the server with the same token, like [OAuth 2.0](https://docs.getbifrost.ai/mcp/auth/oauth.md) set up by an admin, but with no sign-in and no browser step.
* **Secret or private key.** Bifrost authenticates with a client secret, or signs a client assertion with a private key (`private_key_jwt`) so no shared secret leaves your deployment.
* **Checked when you save.** Bifrost requests a token while saving, so credentials the authorization server refuses are reported straight away rather than on the first tool call.

| | OAuth 2.0 (`oauth`) | Client Credentials (`client_credentials`) |
| - | - | - |
| Who signs in | An admin, once, in a browser | Nobody |
| Client registration | Bifrost can register itself, or you enter a client | You register the client in advance |
| How Bifrost authenticates | Client secret, or none for a public client | Client secret or private key |
| Token renewal | Refresh token | A new token request with the same credentials |

***

## Prerequisites

* **A client for Bifrost at the server's authorization server**, allowed to use the `client_credentials` grant. How you register one depends on the service.
* **Its credential**: a client secret, or a private key whose public key you register with the authorization server. The key is an RSA or EC key in PEM form.
* **The MCP server is reachable over HTTP or SSE.** STDIO and OpenAPI servers can't use this auth type.

***

## Setup

> [tab] Web UI
>
> 1. Go to **MCP Registry** and click **New MCP Server**.
> 2. Enter the server's name and URL, then choose **OAuth Client Credentials** as the **Authentication type**.
> 3. Under **Client Credentials Configuration**, enter the **Client ID**.
> 4. Under **Authenticate with**, choose:
>    * **Client secret**, then enter the **Client secret**. Leave **Send the secret** on **Automatic** unless the server accepts only one method.
>    * **Private key (private\_key\_jwt)**, then paste the **Private key**. Leave **Signing algorithm** on **Automatic (from the key)** unless the server needs a specific one. For a key entered as an `env.` or `vault.` reference, choose the algorithm yourself (see the table below).
> 5. Leave **Token URL** empty to have Bifrost find it, or enter the server's token endpoint.
> 6. Add **Scopes** if the server needs them, then click **Create**.
>
>    ![OAuth Client Credentials configuration in the New MCP Server form](https://mintcdn.com/bifrost/6YQpAfh9eEN_iaLU/media/ui-mcp-client-credentials.png?fit=max\&auto=format\&n=6YQpAfh9eEN_iaLU\&q=85\&s=ffe49782a1f1675d343000a87128c40b)
>
> To change the credentials later, open the server's **Edit** sheet and go to the **Authentication** tab.

> [tab] config.json
>
> With a client secret:
>
> ```json theme={null}
> {
>   "mcp": {
>     "client_configs": [
>       {
>         "name": "billing",
>         "connection_type": "http",
>         "connection_string": "https://mcp.billing.example.com/mcp",
>         "auth_type": "client_credentials",
>         "tools_to_execute": ["*"],
>         "client_credentials": {
>           "client_id": "env.BILLING_MCP_CLIENT_ID",
>           "client_secret": "env.BILLING_MCP_CLIENT_SECRET",
>           "scopes": ["invoices:read"]
>         }
>       }
>     ]
>   }
> }
> ```
>
> With a private key:
>
> ```json theme={null}
> {
>   "mcp": {
>     "client_configs": [
>       {
>         "name": "billing",
>         "connection_type": "http",
>         "connection_string": "https://mcp.billing.example.com/mcp",
>         "auth_type": "client_credentials",
>         "tools_to_execute": ["*"],
>         "client_credentials": {
>           "client_id": "bifrost-gateway",
>           "private_key": "env.BILLING_MCP_PRIVATE_KEY",
>           "key_id": "bifrost-2026-11"
>         }
>       }
>     ]
>   }
> }
> ```
>
> A client in `config.json` is set up when Bifrost starts. If Bifrost can't find the token endpoint within a few seconds, it skips that client and logs an error naming it; a client of the same name already saved keeps its saved settings.

> [tab] Helm
>
> ```yaml theme={null}
> bifrost:
>   mcp:
>     enabled: true
>     clientConfigs:
>       - name: "billing"
>         connectionType: "http"
>         httpConfig:
>           url: "https://mcp.billing.example.com/mcp"
>         authType: "client_credentials"
>         clientCredentials:
>           clientId: "env.BILLING_MCP_CLIENT_ID"
>           clientSecret: "env.BILLING_MCP_CLIENT_SECRET"
>           scopes: ["invoices:read"]
> ```
>
> The `clientCredentials` keys are the fields below in camelCase: `privateKey`, `keyId`, `authMethod`, `signingAlgorithm`, `assertionAudience`, `tokenUrl` and `resource`.

| Field | Required | Description |
| - | - | - |
| `client_credentials.client_id` | Yes | Bifrost's client ID at the authorization server. Supports `env.` and `vault.` references. |
| `client_credentials.client_secret` | One of these two | The client's secret. Can't be combined with `private_key`. Supports `env.` and `vault.` references. |
| `client_credentials.private_key` | One of these two | PEM RSA or EC private key. Bifrost signs a client assertion with it for each token request, with the client ID as `iss` and `sub`. Register the matching public key with the authorization server. Can't be combined with `client_secret`. Supports `env.` and `vault.` references. |
| `client_credentials.auth_method` | No | How the secret is sent: `client_secret_basic` (HTTP Basic) or `client_secret_post` (request body). When empty, Bifrost uses the request body if the authorization server lists only `client_secret_post`, and HTTP Basic otherwise. Requires `client_secret`. |
| `client_credentials.key_id` | No | `kid` of the client assertion, for authorization servers that pick keys by ID. Requires `private_key`. |
| `client_credentials.signing_algorithm` | No | `RS256`, `RS384`, `RS512`, `PS256`, `PS384`, `PS512`, `ES256`, `ES384` or `ES512`. When empty, Bifrost chooses from the key: the `ES` algorithm for an EC key's curve, and for an RSA key the first RSA algorithm the authorization server lists, otherwise `RS256`. With an `env.` or `vault.` `private_key`, Bifrost can't read the key when you save, so it uses `RS256`; set this field for an EC key, or when the authorization server doesn't accept `RS256`. Requires `private_key`. |
| `client_credentials.assertion_audience` | No | `aud` of the client assertion, for authorization servers that expect their issuer URL rather than the token endpoint (the default). Requires `private_key`. Must be an `https` URL; plain `http` is accepted only on `localhost` or a loopback address, for testing. |
| `client_credentials.token_url` | No | The token endpoint, as an `https` URL. When empty, Bifrost finds it from the MCP server, as described below. |
| `client_credentials.scopes` | No | Scopes to request. |
| `client_credentials.resource` | No | Resource indicator sent with the token request. Left out, Bifrost sends the MCP server's URL. Set it to `""` for an authorization server that refuses the parameter; in the Web UI, turn on **Don't send a resource**. |

***

## How Bifrost gets the token

**When you save**, Bifrost settles everything it needs so later token requests depend only on what you saved:

1. **Token endpoint.** With **Token URL** empty, Bifrost asks the MCP server where its authorization server is and reads that server's metadata. The metadata must list the `client_credentials` grant. If it doesn't, or doesn't say, set **Token URL** yourself to use the endpoint anyway.
2. **Sending the secret, or signing the assertion.** Bifrost picks **Automatic** choices as described in the table above, and checks your choices against what the authorization server lists, when it lists them.
3. **A first token.** Bifrost requests one token. If the authorization server refuses the credentials, the save fails with its reason.

The token URL, send method and signing algorithm Bifrost chose are saved with the server and shown in its details.

**On tool calls**, Bifrost reuses the token for every caller until shortly before it expires, then requests a new one with the same credentials. There is no refresh token and nothing for a person to renew. If the MCP server rejects the token before then, Bifrost requests a new one and connects again.

### Changing the credentials

Editing the client ID, secret, key, scopes or resource takes effect on the next token request. Changing **Token URL** or **Assertion audience** changes where your credential is sent, so Bifrost asks you to enter the secret or private key again before it saves. A credential kept as an `env.` or `vault.` reference is sent as the reference and doesn't need re-entering.

***

## Authorization servers on a private network

Like [OAuth 2.0](https://docs.getbifrost.ai/mcp/auth/oauth.md#oauth-servers-on-localhost-or-a-private-network), Bifrost sends token requests and discovery only to public addresses by default. If the authorization server or the MCP server runs on the same host or inside your network, add its host, IP address or CIDR range to the **OAuth Private Network Allowlist** in **MCP Settings**.

***

## Troubleshooting

### "does not advertise the client\_credentials grant"

The authorization server's metadata doesn't list the `client_credentials` grant, so Bifrost won't assume it is accepted. If you know the server accepts it, set **Token URL** to its token endpoint and save again.

### "could not discover the token endpoint"

Bifrost couldn't find the authorization server from the MCP server, or couldn't read its metadata. Check the server URL, then set **Token URL** yourself. For a server on a private network, see [Authorization servers on a private network](#authorization-servers-on-a-private-network).

### "the token endpoint refused the client credentials"

The authorization server rejected the token request; its reason follows in the message. Check the client ID and secret, that the client may use the `client_credentials` grant, and that the requested scopes are allowed. With a private key, check that the registered public key matches it and that **Key ID** is the one the server registered.

### "the authorization server does not accept ..."

The authorization server lists the ways it accepts client authentication or the signing algorithms it accepts, and your choice isn't one of them. The message names what it accepts: pick one of those under **Send the secret** or **Signing algorithm**, or switch between a secret and a private key.

### "Re-enter it" when saving an edit

**Token URL** or **Assertion audience** changed, so the saved secret or private key isn't sent to the new target until you enter it again.

***

## Next Steps

* **[OAuth 2.0](https://docs.getbifrost.ai/mcp/auth/oauth.md)** - Shared OAuth with an admin sign-in, for servers that need a person's authorization
* **[Token Exchange](https://docs.getbifrost.ai/mcp/auth/token-exchange.md)** - Each caller reaches the server under their own identity
* **[Connections, States & Lifecycles](https://docs.getbifrost.ai/mcp/connections.md)** - How shared clients connect and recover


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.