
Gvnr
dev.gvnr由 gvnr.dev 發布官方發布者v1.8.1更新於 Oct 24, 2026
Budget & cost control for AI agents — per-agent spend caps + rate limits before each call.
概覽
託管式 MCP 端點,讓 AI 代理在每次呼叫 LLM 前檢查支出上限、速率限制、冪等性與人工核准。
- 可以做什麼
- 檢查放行與對帳:呼叫前詢問是否通過代理的美元額度與操作配額,模型回應後再依實際用量修正估算落差。
- 管理支出額度:為每個代理建立、讀取或刪除每日或每次工作階段的美元上限。
- 管理速率額度:依代理、供應商、模型分配每分鐘請求份額並在執行時檢查。
- 去重複重試:用呼叫端提供的鍵判斷某次呼叫是否為首次。
- 發起並輪詢人工核准:建立核准請求並查詢待處理、通過、拒絕或逾時狀態。
- 查詢帳戶剩餘的治理操作配額。
- 適用情境
- 適用於自主代理呼叫付費 LLM 介面、需要硬性阻止支出失控、依代理設定預算、協調速率、去重複重試,或在敏感操作前加入人工確認的情境。它是自架閘道器的託管替代方案,且不代理模型流量。
- 執行需求
- 遠端 streamable HTTP 端點,無需本機安裝。每次呼叫都需要在 Authorization 標頭提供 bearer API 金鑰,須先開通帳戶取得。治理操作配額需以 Base 主網上的 USDC 儲值(x402 或交易雜湊驗證);新帳戶含 25 次試用操作。需要能連線至該端點的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Gvnr,將其新增到工作區。
- 連接 Authorization token 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
交給代理程式安裝
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/dev.gvnr%2Fgvnr/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。
{
"mcpServers": {
"gvnr": {
"type": "http",
"url": "https://gvnr.dev/mcp",
"headers": {
"Authorization": "Bearer <YOUR_TOKEN>"
}
}
}
}README
Gvnr
[Tests] [Release] [License: MIT] [MCP Registry] [gvnr MCP server] [smithery badge]
Spend caps, rate coordination, idempotency, and a human-in-the-loop gate for AI agents — enforced before the call, not after the invoice. One MCP endpoint, settled via x402 (USDC on Base). No proxy, no self-hosting, no infrastructure to deploy.
Listed on the Official MCP Registry as dev.gvnr/gvnr.
The problem
Agents cost 10–12× more than estimated in production. System prompts, retry loops, and tool calls multiply fast — a runaway agent can generate a $47,000 bill in 11 days. The usual fix, self-hosting a gateway like LiteLLM, means running infrastructure most developers won't set up.
Gvnr is the hosted alternative: an external authority your agent checks before it spends. Your agent asks "am I clear to make this call?" and acts on the answer.
How it works
Gvnr is not an LLM proxy — your tokens never pass through it, and you pay your model provider directly. Gvnr governs the decision to spend, in two independent meters:
1. The governance-operation quota — what you buy from Gvnr.
Your account holds a balance of governance operations (operations_remaining). One budget_clear burns one op. You top this up with USDC; it's decoupled from your LLM spend. get_balance reports it.
2. The spend envelope — a USD cap you set, per agent.
set_envelope(agent_id, limit_usd, window) gives an agent a daily or per-session USD ceiling. Gvnr tracks estimated spend against it and denies once it's exceeded — this is the runaway guardrail. No dollars move; it's an accounting limit you control.
A budget_clear is approved only when both hold: the account has ops left in the quota, and the agent is under its envelope. The loop:
- Your agent calls
budget_clear(agent_id, model, estimated_tokens)before each LLM request. - Gvnr checks the op quota and the agent's envelope, and returns
{ approved: true, ... }or{ approved: false, reason }. - If denied, your agent skips (or escalates via
request_approval). - After the LLM responds, call
reconcile(...)with the real token counts so the envelope tracks actual cost, not the estimate.
Quick start
1. Provision an account
New accounts include 25 free trial ops — enough to run the full loop (set an envelope, budget_clear, reconcile) before you fund anything. Your api_key is the credential for every call; account_id is just an internal reference for support. Account creation is credential-only by design (agent-native) — email is optional, set separately via POST /v1/account/notification-email, and used only for human approval notices.
2. Top up your governance-op quota
Pay-as-you-go: 1,000 ops per $1, any amount (try the whole rail for $1), USDC on Base. Open the pay page, name your amount, and pass your API key:
Send USDC to the address shown and paste your tx hash — ops are credited proportional to the amount received, after on-chain verification. Programmatic clients can submit the hash directly:
Or settle in one round-trip with an x402 client (Base MCP, AgentKit, x402-fetch) — name your own amount:
3. Set a spend envelope for your agent
4. (optional) Set a rate envelope per (agent, provider, model)
5. Before each LLM request: budget_clear, then rate_check
6. (optional) Dedupe retries with idempotency_check
7. After the LLM responds, reconcile against actual usage
reconcile adjusts the spend envelope by the drift between your estimate and actual cost (the op quota is untouched). You don't pass the model again — reconcile reuses the one from your prior budget_clear. Anthropic, OpenAI, and Gemini all return usage fields with real token counts — pass those in to keep the envelope honest.
Human-in-the-loop approvals
When an agent hits a denial or a sensitive action, pause for a human instead of failing:
The agent proceeds on approved, skips on denied, and handles timeout (no decision before expires_at) however it likes.
MCP setup
Add to Claude Desktop or any MCP-compatible client:
Claude Code
MCP tools
REST API
All endpoints except POST /v1/account require Authorization: Bearer bg_YOUR_KEY.
TypeScript users: generate full types from the live OpenAPI spec — npx openapi-typescript@latest https://gvnr.dev/openapi.json -o types/gvnr.d.ts. See TYPESCRIPT.md for the integration pattern (typed fetch, x402 topups, discriminated response unions).
Account & top-up
Budget
Rate · Idempotency · Approval
Clearance response
Denial reasons: no_credits (op quota exhausted) · no_envelope (agent has no envelope) · envelope_exceeded
Status codes
A denial is not an HTTP error — it's a 200 with a flag, so check the body, not the status:
Billing — governance ops, not your tokens
Gvnr charges for governance operations, not LLM usage. Your model tokens are billed by your provider; Gvnr never sees them.
Top-ups are pay-as-you-go at 1,000 ops/$1 in USDC on Base mainnet — name any amount on /pay and ops are credited proportionally after on-chain verification. No minimum, no subscription; the amounts below are just one-tap presets:
Works with Base MCP, AgentKit, and any x402 client. The 402 challenge follows x402 v2 — payment requirements (network, USDC asset, amount, payTo) are returned in the payment-required response header (the body is empty), so an x402 client settles it automatically; you only hand-parse it if you're rolling your own.
Envelope windows
daily— resets at UTC midnight each daysession— never resets (use for one-shot tasks; caller-managed)
Supported models
Model pricing is a static lookup on the hot path — no external calls. The estimate deducted from the envelope is rate(model) × estimated_tokens ÷ 1,000,000 (output rate for chat models, input rate for embeddings), reconciled to actual afterward. These are the per-million-token rates (USD):
Embedding / input-only models are billed on input tokens — pass input tokens as estimated_tokens to budget_clear. Unknown models fall back to a conservative $15 / $75 default.
Network
Runs on Base mainnet (X402_NETWORK=eip155:8453), settling real USDC. There's no minimum to try it: top up as little as $1 (1,000 governance ops) to exercise the full live rail end-to-end — no testnet needed.
License
MIT — see LICENSE.
The canonical hosted service is https://gvnr.dev. Self-hosted instances are unaffiliated.
Acknowledgments
gvnr was designed and built by mightbesaad in close partnership with Claude Code (Anthropic) — chiefly Claude Opus 4.8. From the substrate architecture and the billing model to the code in this repository, it was a genuine collaboration. Thank you.
來源:README.md,提交 2a074f1
工具
0版本歷史
1- v1.8.1最新Sep 16, 2026
評分
已滿足適用檢查項的 85%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通必需25 分
- 已宣告認證方式必需10 分
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分