bifrost-budget
Bifrost Budget is a read-only MCP server that returns the authenticated caller's Bifrost governance usage as normalized dollar quota data.
get_quota: Retrieve the caller's current Bifrost quota snapshot, including budget rows and a summary.
Monetary fields: Returns
current_usage,max_limit, andremainingas dollar amounts with two decimal places (remaining = max_limit - current_usage).Identity-aware: Uses the inbound bearer token to identify the caller, with fallback from JWT
displaynameto UserInfonameorpreferred_username.Secure upstream calls: Governance requests are authenticated with the server's
BIFROST_ADMIN_API_KEY, never the caller's token.Local fallback args: Optional
virtual_keyandapi_base_urlarguments are available for local and non-production fallback use.Non-mutating: Never modifies Bifrost state and does not expose credentials or raw tokens.
Flexible deployment: Can run as a stdio MCP server for desktop clients or as a Streamable HTTP server exposing
/mcpand/healthz.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@bifrost-budgetwhat's my current quota snapshot?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Bifrost Budget is a read-only Model Context Protocol (MCP) server, built with FastMCP, that retrieves the authenticated caller's Bifrost governance usage and returns normalized dollar quota data. It never mutates Bifrost state or returns credentials.
Quickstart with uvx
The fastest way to run the server is with uv's uvx, which downloads and runs the package in an isolated environment with no manual install step:
BIFROST_API_BASE_URL=https://bifrost.example.com \
BIFROST_ADMIN_API_KEY=your-admin-key \
uvx bifrost-budgetAdding it to an MCP client (Claude Desktop, Claude Code, etc.)
Most MCP clients launch servers over stdio. Add an entry like this to the client's MCP server configuration:
{
"mcpServers": {
"bifrost-budget": {
"command": "uvx",
"args": ["bifrost-budget"],
"env": {
"BIFROST_TRANSPORT": "stdio",
"BIFROST_API_BASE_URL": "https://bifrost.example.com",
"BIFROST_ADMIN_API_KEY": "your-admin-key"
}
}
}
}Never commit real values for BIFROST_ADMIN_API_KEY; inject it from your client's secret storage or environment.
Related MCP server: context-surface-analyzer
Install from source
Requirements: Python 3.11+ and uv.
uv venv .venv
. .venv/bin/activate
uv pip install -e '.[dev]'
export BIFROST_API_BASE_URL=https://bifrost.example.com
export BIFROST_ADMIN_API_KEY= # inject from a secret manager; do not commit it
uv run bifrost-budgetThe default Streamable HTTP endpoint is http://localhost:8080/mcp; health is GET /healthz. Set BIFROST_TRANSPORT=stdio for stdio clients (required for most desktop MCP clients).
Configuration
Required: BIFROST_API_BASE_URL and BIFROST_ADMIN_API_KEY. Optional settings include BIFROST_QUOTA_PATH, BIFROST_USERS_PATH, BIFROST_USERINFO_URL (defaults to https://sso-dev.sanlamcloud.co.za/as/userinfo, used when the inbound JWT has no usable displayname claim), BIFROST_TIMEOUT_SECONDS (15), BIFROST_LOG_LEVEL (INFO), BIFROST_HOST (0.0.0.0), BIFROST_PORT (8080), and BIFROST_MCP_PATH (/mcp). The UserInfo override must be an absolute HTTPS URL without credentials, query parameters, or fragments.
In Kubernetes, configure env.adminApiKey.existingSecret in the Helm chart. The chart uses secretKeyRef; it does not accept an admin key value. Do not put credentials in images, command lines, manifests, README examples, or logs.
Authentication and behavior
The inbound Authorization: Bearer credential is used only to identify the caller and, when the JWT has no usable displayname, to call PingIdentity UserInfo. Identity fallback precedence is JWT displayname, UserInfo name, then UserInfo preferred_username.
The governance request always uses BIFROST_ADMIN_API_KEY, never the inbound bearer. The selected identity is URL-encoded in GET /api/governance/users?search=...&limit=20. Legacy virtual-key fallback inputs are intentionally not part of the production flow.
The get_quota response contains budget rows and a summary. Monetary fields current_usage, max_limit, and remaining are dollar amounts represented as JSON numbers with two decimal places. remaining is calculated as max_limit - current_usage using Decimal ROUND_HALF_UP arithmetic. Missing or malformed monetary input produces an explicit error.
Troubleshooting and privacy
Structured JSON logs contain event names, status codes, host/path metadata, query parameter names, counts, durations, reason codes, credential modes, lengths, and keyed fingerprints. They never contain bearer tokens, API keys, cookies, raw headers, identities, claim values, response bodies, or query values. Fingerprints are correlation data and should still be protected.
At the default BIFROST_LOG_LEVEL=INFO, each get_quota call logs exactly one line (get_quota_completed or, on failure, tool_error), plus the one-time service_version/app_start lines at startup. Errors (upstream_quota_error, userinfo_error, auth_source_missing) always log at ERROR regardless of level. Set BIFROST_LOG_LEVEL=DEBUG to see the full per-request trace — credential resolution, the upstream quota/governance/UserInfo requests and responses, and identity matching (governance_user_request, governance_user_response, user_lookup_match, usage_extraction, etc.) — when troubleshooting. Confirm the upstream preserves the caller's Authorization header and that the admin key is available through the runtime secret store.
Immutable container usage
Build locally with docker build -t bifrost-budget:0.4.1 .. The image runs as UID/GID 10001, drops Linux capabilities, and is designed for a read-only root filesystem. In production, use the immutable commit SHA or release tag published by CI rather than latest. CI derives the release tag from pyproject.toml and refuses to publish if that semantic version already exists in GHCR; the SHA and latest tags are intentionally explicit rolling tags:
docker run --read-only --user 10001:10001 -p 8080:8080 \
-e BIFROST_API_BASE_URL=https://bifrost.example.com \
-e BIFROST_ADMIN_API_KEY="$BIFROST_ADMIN_API_KEY" \
ghcr.io/jasonrve/bifrost-budget:<commit-sha>Helm
helm upgrade --install bifrost-budget charts/bifrost-budget \
--namespace bifrost-budget --create-namespace \
--set image.tag=0.4.1 \
--set env.apiBaseUrl=https://bifrost.example.com \
--set env.adminApiKey.existingSecret=bifrost-budget-adminPin image.tag to a reviewed release or commit SHA. The chart enables non-root execution, drops all capabilities, disables privilege escalation, and uses read-only root storage by default.
Development
See DEVELOPER_GUIDE.md for architecture, testing, dependency updates, release workflow, and the security checklist.
Contributing
Contributions are welcome. See CONTRIBUTING.md for how to get set up, and please review SECURITY.md before reporting a vulnerability.
License
MIT, see LICENSE.
Available Tools
1 toolget_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.
| Name | Required | Description | Default |
|---|---|---|---|
| virtual_key | No | ||
| api_base_url | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
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.
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.
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.
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.
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.
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.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.1.0- First observed
get_quota
TDQS
Scored across 1 tool
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.
The single tool name 'get_quota' follows a clear verb_noun convention and is descriptive. There are no other names to create inconsistency.
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.
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
Related MCP Connectors
Query OneLens cloud-cost data in natural language: breakdowns, trends, cost centers. Read-only.
Search, query, and update budgets, transactions, contacts, and purchase orders in Saturation.
- ZopDev MCPOAuthdev.zop
Cloud cost, inventory and governance on AWS/Azure/GCP. Read-only by default, optional scoped writes
Read-only XRP Ledger MCP tools with proof-annotation envelopes and signed daily snapshots.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceProvides 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
- AlicenseNot gradedqualityBmaintenanceEnables 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
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to query multi-cloud cost and usage data through a uniform read-only toolset, including cost summaries, trends, budgets, forecasts, and optimization recommendations.MIT
- AlicenseAqualityCmaintenanceExposes read-only account-health tools for scores, trends, claims checks, risks, pipeline, and next actions, with audience-scoped output for internal or customer views.6MIT