Try Bifrost Enterprise free for 14 days.
Request access
Back to Blog
EngineeringFeaturesMCP Gateway

Introducing the Bifrost MCP server: Manage Bifrost from your coding agent

Vrinda Kohli

Nov 30, 2026 · 11 min read

Introducing the Bifrost MCP server: Manage Bifrost from your coding agent

With Bifrost v2.6.0, coding agents such as Claude Code and Cursor can call Bifrost's own API as tools to create virtual keys, read logs, change configuration and send test requests, with your Bifrost credential and permissions.

Platform engineers use Bifrost to add providers, hand out virtual keys and work out why a request failed, via the dashboard or through the management API. They also write the services that call Bifrost, often with a coding agent open in the editor.

But the coding agent isn't aware of Bifrost's own API. Consider a scenario where you're in the middle of shipping a feature with your agent, and you need a new virtual key with a budget. Or you want to know why a provider started failing this morning. Or you just want to check which models a key can reach.

Until now, each of those meant leaving the agent interface, opening the dashboard and clicking through settings, or looking up the right endpoint and writing a cURL command by hand.

With Bifrost v2.6.0, the Gateway now serves its own HTTP API as MCP tools on a new endpoint, /v1/mcp. Connect coding harnesses like Claude Code, Codex or Cursor to it, and your agent can work on the Gateway the way an API client would: with your credential, under your permissions, and nothing more.

Ask your agent to set up, debug and check the Gateway

Because the tools are the API, anything you'd script against Bifrost becomes something you can ask for:

  • Set up access mid-task: "Create a virtual key called 'demo-team' with a $10 monthly budget and 60 requests a minute, allowed only on OpenAI." - The agent calls createVirtualKey and hands you the new key without you leaving the agent interface.
  • Debug from the Gateway logs: "Pull the failed requests to Bedrock from the last hour and group them by error." - The agent reads the logs through the same endpoints the dashboard uses.
  • Audit configuration: "Which virtual keys have no budget set?" or "Diff the provider config against what's in our config.json."
  • Test a change end to end: Update a routing rule, then send a createChatCompletion through the Gateway to confirm the request lands where you expect.
  • Answer questions about your setup: "Which models can the research team's key reach, and what are its rate limits?"

An agent that can chain these calls together can also check its own work: make the change, read it back, run a request, and look at the log row it produced.

0:00
/0:49

Using Bifrost MCP with Claude Code

Your credential, your permissions

The server grants nothing your credential doesn't already allow. /v1/mcp sits behind the same authentication as the management API, and every MCP message needs a management credential, tools/list included. That credential can be any of these:

CredentialHow to send itWhen to use it
Bifrost API keyBifrost EnterpriseAuthorization: Bearer bfst-…SSO deployments, or whenever you want a scoped, revocable credential for an agent
Admin username and passwordAuthorization: Basic <base64 of user:password>Dashboard authentication with a local admin login
Dashboard session tokenAuthorization: Bearer <token>Short-lived scripting with a local login
Setup tokenX-Bifrost-Setup-Token: <token>Before dashboard authentication is turned on

An admin login gives the agent everything the admin can do. On Bifrost Enterprise, a scoped API key is the safer choice.

A tool call isn't a shortcut around the Gateway. It runs through the full middleware chain of the route it reaches, with your forwarded headers, exactly as a direct request to that route would. If you couldn't do it with curl, your agent can't do it with MCP.

Two rules ensure this:

  • A virtual key alone is refused: A request whose only credential is a virtual key gets a 401 telling you to send a management credential alongside it.
  • Cookies are never forwarded: A tool call can't ride a browser's dashboard session, so a web page can't act through /v1/mcp with an admin's cookie.

Give an agent its own key, behind SSO

On a Bifrost Enterprise deployment where people sign in through an identity provider (Okta, Entra ID, Google Workspace or any OIDC provider), there is no admin password to hand to an agent, and the SSO session lives in a browser cookie that /v1/mcp deliberately ignores. The SSO login itself never reaches the agent. You use it once, to create a credential made for the agent:

  1. Sign in to the dashboard with SSO, as you normally would.
  2. Create an API key. Open Settings → API Keys → Create API Key. Pick the scopes the agent needs (for example read access to logs and virtual keys, write access to virtual keys, and inference) and set an expiry.
  3. Copy the bfst-… value. It is shown only once.
  4. Give it to your agent as Authorization: Bearer bfst-….

The key carries its scopes into every call. tools/list shows only the operations the key may use, so the agent never sees a tool it can't call, and each tools/call is checked again by the route it reaches. You can reason about what the agent can do the same way you reason about the key: scope it down for a read-only assistant, give it an expiry for a one-off task, and revoke it from the same page when you're done. Revoking the key cuts the agent off at once, and nobody's SSO login is affected.

This also means an agent never acts as "whoever happens to be signed in in the browser". It acts as one named key, with one set of scopes, and its changes show up in your audit logs.

Decide whether agents can change the Gateway

Letting an agent read your Gateway is one decision. Letting it change your Gateway is another. Bifrost keeps them separate.

Configuration changes through the server are allowed by default. Turn off Allow configuration changes through the Bifrost MCP, and every non-GET operation under /api drops out of the tool list, for every credential. What's left is a read-only management server that still serves inference, batch and file routes, since those are the caller's own requests and not changes to the Gateway.

The switch applies to the whole Gateway, and API key scopes apply to one key. Use both: the switch for a hard organization-wide line, and scopes for what each agent gets inside it.

Every tool also carries MCP annotations, so your client can decide what to confirm with you before running it. Reads are marked read-only. Deletes, and writes that invalidate state such as rotating a virtual key, are marked destructive. Inference, batch and file calls are marked as reaching beyond the Gateway.

How the Bifrost MCP server works

The server reads Bifrost's OpenAPI spec and serves every operation in it as an MCP tool. Each tool is named after its operationId (getConfig, listVirtualKeys, createVirtualKey, createChatCompletion) and takes that operation's parameters and body.

That covers the whole API: configuration, providers, keys, governance, logs and inference. The operations left out are deprecated ones, the ones a request-and-response tool can't carry, such as login or a WebSocket upgrade, and the ones this Gateway doesn't serve. Each call returns one complete result, so createChatCompletion comes back whole instead of as a stream of chunks.

The tool list is built from the published spec when Bifrost starts. When the API gains an operation, the MCP server gains a tool, with no separate list to keep in sync. Air-gapped installs point the OpenAPI URL at a local copy.

Bifrost now has three MCP endpoints, and they do different jobs:

EndpointWhat it serves
/v1/mcpBifrost's own HTTP API, as tools (this post)
/mcpThe tools of the MCP servers you connect to Bifrost, filtered per virtual key
/v1/mcp/tool/executeA plain HTTP endpoint that runs one tool from your connected MCP servers

If /mcp is Bifrost acting as a gateway for other people's tools, /v1/mcp is Bifrost offering its own tools on that endpoint.

Set it up

There are two steps: tell Bifrost its public address, then point your client at it with a credential.

1. Set the Bifrost URL. Open Settings → Client Settings and enter the Gateway's public address in Bifrost URL, for example https://bifrost.example.com, or https://bifrost.example.com/bifrost if you serve it under a base path. In config.json, that's client.bifrost_url. Every tool call goes through this address, never through the Host header the client sent, and until it's set, /v1/mcp answers 503. To keep the server read-only, switch off Allow configuration changes through the Bifrost MCP under Settings → Security (client.bifrost_mcp_allow_writes).

2. Connect a client. The server speaks MCP over Streamable HTTP.

On an SSO deployment, use an API key from Settings → API Keys:

With a local admin login:

Cursor and most other clients take the same URL and header in their mcp.json:

Run /mcp in Claude Code to check the connection. You should see one tool for every operation your credential can use.

Inference under a virtual key

Tool calls forward the headers your client sent, so headers that steer inference work the way they do on a direct request. To have inference tools run under a virtual key, with its budgets, rate limits and routing, send the key in x-bf-vk next to your management credential:

The management credential decides what the agent may do to the Gateway. The virtual key decides how its model calls are governed and billed.

When it doesn't connect

  • 401 means there's no management credential. Usually a virtual key was sent in Authorization, or Basic was used on an SSO-only deployment. Use a bfst- API key.
  • 503 "needs bifrost_url set" means the Bifrost URL isn't configured yet.
  • executeToolCode and getToolDocs but no Bifrost operations such as getConfig means you're connected to /mcp, the MCP gateway with Code Mode, not to /v1/mcp.
  • Write tools missing means the writes switch is off, or your API key's scopes don't include them.

Get started

Upgrade to Bifrost v2.6.0 or later, set the Bifrost URL, connect your agent, and start with something read-only, such as "Which virtual keys are close to their budget?" The Bifrost MCP server docs cover every setting, the full list of operations left out, and troubleshooting.