Skip to main content
Glama
Jasonrve

bifrost-budget

by Jasonrve

Bifrost Budget

Bifrost Budget is a read-only MCP server that retrieves the caller's quota snapshot from Bifrost and returns normalized budget data with derived remaining values.

This repository includes:

  • a Python MCP server implemented with the official MCP SDK

  • a quota normalization layer that flattens upstream Bifrost responses into a stable shape

  • a container image and Helm chart for deployment

  • CI that runs tests and builds a multi-arch Docker image

Architecture

The server exposes one primary tool:

  • get_quota — fetches the caller's Bifrost quota snapshot from GET /api/governance/virtual-keys/quota

Authentication is read-only and self-service:

  • production callers should send an Authorization header to Bifrost, and this service forwards that authenticated request directly when the caller's own budget snapshot is requested

  • the server derives safe caller identity fields from JWT claims for tracing and routing context, but it no longer depends on a JWT-to-virtual-key exchange map

  • for local development or explicit non-production fallback, pass virtual_key to the tool directly, send x-bf-vk in the MCP request headers with a virtual key, or set BIFROST_VIRTUAL_KEY in the runtime environment

The tool never returns the raw virtual key. It only returns derived quota data.

Related MCP server: financial-trading-risk-aiops-assistant

Configuration

Required:

  • BIFROST_API_BASE_URL — base URL for the Bifrost API, for example https://bifrost.example.com

Optional:

  • BIFROST_QUOTA_PATH — defaults to /api/governance/virtual-keys/quota

  • BIFROST_TIMEOUT_SECONDS — defaults to 15

  • BIFROST_LOG_LEVEL — defaults to INFO; controls the structured application logs

  • BIFROST_TRANSPORTstreamable-http (default) or stdio

  • BIFROST_HOST — defaults to 0.0.0.0

  • BIFROST_PORT — defaults to 8080

  • BIFROST_MCP_PATH — defaults to /mcp

  • BIFROST_VIRTUAL_KEY — fallback caller key for local development or explicit non-production use only

Local development

uv venv .venv
. .venv/bin/activate
uv pip install -e '.[dev]'
pytest

Run the server over HTTP:

export BIFROST_API_BASE_URL=https://bifrost.example.com
export BIFROST_VIRTUAL_KEY=vk_...
uv run bifrost-budget

In production, prefer the caller's Authorization header path and do not rely on a static BIFROST_VIRTUAL_KEY unless you are intentionally using a fallback.

Run the server over stdio:

export BIFROST_TRANSPORT=stdio
export BIFROST_API_BASE_URL=https://bifrost.example.com
uv run bifrost-budget

Logging

The server emits structured JSON logs to standard output for:

  • startup

  • auth source selection

  • tool invocation

  • upstream quota requests and responses

  • errors

The logs intentionally omit raw virtual keys and Authorization values; they record only the chosen auth path, a non-reversible token fingerprint for correlation, and safe JWT claim fields such as issuer, subject, and tenant when the token is already a JWT.

Container

Build:

docker build -t bifrost-budget:local .

Run:

docker run --rm -p 8080:8080 \
  -e BIFROST_API_BASE_URL=https://bifrost.example.com \
  -e BIFROST_VIRTUAL_KEY=vk_... \
  bifrost-budget:local

The environment-based key above is a fallback example for local/dev or explicit non-production use. Production deployments should rely on the caller's Authorization header path.

Health check:

curl http://localhost:8080/healthz

Helm deployment

Chart path: charts/bifrost-budget

Install:

helm upgrade --install bifrost-budget charts/bifrost-budget \
  --namespace bifrost-budget \
  --create-namespace \
  --set image.tag=latest \
  --set ingress.enabled=true \
  --set ingress.className=traefik \
  --set ingress.hosts[0].host=bifrost-budget.example.internal \
  --set env.apiBaseUrl=https://bifrost.oly.workside.win

If you need an explicit fallback key for local/dev or other non-production use, add a secret and wire it into env.virtualKey.existingSecret:

kubectl create secret generic bifrost-budget-vk \
  --from-literal=BIFROST_VIRTUAL_KEY=vk_...

Then install with --set env.virtualKey.existingSecret=bifrost-budget-vk.

The chart configures readiness and liveness probes against /healthz and exposes the MCP server on port 8080.

Kubernetes examples

The Helm chart is the primary production path, but these plain Kubernetes manifests show the same container wiring in a copy-paste friendly form. They use the GHCR image published by CI and keep auth header-first, so no static Bifrost token is required for production use.

Deployment:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: bifrost-budget
spec:
  replicas: 2
  selector:
    matchLabels:
      app.kubernetes.io/name: bifrost-budget
  template:
    metadata:
      labels:
        app.kubernetes.io/name: bifrost-budget
    spec:
      containers:
        - name: bifrost-budget
          image: ghcr.io/jasonrve/bifrost-budget:latest
          ports:
            - name: http
              containerPort: 8080
          env:
            - name: BIFROST_API_BASE_URL
              value: https://bifrost.example.com
            - name: BIFROST_TRANSPORT
              value: streamable-http
            - name: BIFROST_MCP_PATH
              value: /mcp
            - name: BIFROST_TIMEOUT_SECONDS
              value: "15"

Service:

apiVersion: v1
kind: Service
metadata:
  name: bifrost-budget
spec:
  type: ClusterIP
  selector:
    app.kubernetes.io/name: bifrost-budget
  ports:
    - name: http
      port: 80
      targetPort: http
      protocol: TCP

These examples mirror the chart's container port, service port, and /healthz-based probes; use the Helm chart when you want the full production defaults.

Usage from an MCP client

Clients can call get_quota and provide the upstream credential in one of four ways:

  1. production path: caller's Authorization header

  2. fallback request header: x-bf-vk

  3. fallback tool argument: virtual_key

  4. fallback environment variable: BIFROST_VIRTUAL_KEY

The fallback paths are intended for local/dev or explicit non-production use.

The response includes normalized budget rows and a summary with derived totals and remaining values.

If your upstream Bifrost deployment uses a separate enterprise token-exchange layer, configure that outside this server and pass the resulting caller Authorization header through unchanged; this service intentionally no longer remaps callers to virtual keys.

Repository layout

  • src/bifrost_budget/ — server, client, normalization, and settings

  • tests/ — unit and integration tests

  • Dockerfile — production container image

  • charts/bifrost-budget/ — Helm chart

  • .github/workflows/ci.yml — test + image build pipeline

Available Tools

1 tool
get_quotaGet Bifrost quota snapshotA

Return the caller's Bifrost quota snapshot by calling the configured quota endpoint with the caller's Authorization header when present. Explicit virtual_key, x-bf-vk, and BIFROST_VIRTUAL_KEY remain available for local and non-production fallback use.

ParametersJSON Schema
NameRequiredDescriptionDefault
virtual_keyNo
api_base_urlNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses that the tool calls a configured endpoint, uses the caller's Authorization header when present, and falls back to explicit virtual_key/x-bf-vk/BIFROST_VIRTUAL_KEY in non-production environments. It stops short of describing precedence, error behavior, or rate limits, but the core behavioral profile is visible.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one dense sentence that front-loads the core behavior and then adds only relevant auth context. Every clause earns its place, and there is no filler or repetition of the title or schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with two optional parameters and an output schema, the description covers the main behavior and authentication fallback well. However, api_base_url is left completely unexplained, and the precedence between Authorization header and virtual_key is not stated. These are clear gaps for an agent trying to call the tool correctly in edge cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It does explain virtual_key as an explicit fallback credential, but it never mentions api_base_url or how it relates to the 'configured quota endpoint.' The agent is left to guess whether api_base_url overrides configuration, which is a significant semantic gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'Return the caller's Bifrost quota snapshot by calling the configured quota endpoint.' It clarifies that the result is caller-specific and not a global quota, going well beyond the title. Even without sibling tools, an agent knows exactly what operation this performs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context for how authentication works: it uses the caller's Authorization header when present, with virtual keys available 'for local and non-production fallback use.' It does not explicitly list when not to use the tool or mention alternatives, but with no siblings and a clear read-only purpose, the usage context is strong.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.9/5.0
Disambiguation5/5

There is only one tool, so there is no possibility of confusing it with another. Its description clearly scopes it to retrieving a Bifrost quota snapshot.

Naming Consistency5/5

The single tool name 'get_quota' follows a clear verb_noun convention and is descriptive. There are no other names to create inconsistency.

Tool Count3/5

One tool is minimal and feels thin for a server named 'bifrost-budget'. It may be acceptable as a narrow quota-check adapter, but the count is borderline.

Completeness2/5

The tool surface only supports reading a quota snapshot, with no create, update, delete, or list operations. This leaves significant gaps if the server is meant to support budget or quota management workflows.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Provides read-only visibility into Snowflake warehouse cost and query performance, including credit usage by warehouse, expensive queries, and heuristic right-sizing recommendations.
    6
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides read-only MCP tools for market snapshots, position risk, order reconciliation, and daily report previews with deterministic financial calculations, evidence chains, and audit trails.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables deterministic analysis of a single Agent tool-catalog snapshot and comparison of two snapshots through read-only JSON-RPC tools, reporting digests, schema statistics, duplicates, collisions, budget checks, and diffs.
    Apache 2.0
  • -
    license
    Not graded
    quality
    C
    maintenance
    Enables read-only access to Addepar portfolio and ownership data for financial reporting, with transparent provenance caveats and compliance-oriented audit logging.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Jasonrve/bifrost-budget'

If you have feedback or need assistance with the MCP directory API, please join our Discord server