Agent Billing Primitives (Dirtsmith)

io.github.throttler300由 GitHub 帳號 throttler300 發布v1.4.0更新於 Nov 4, 2026

Usage metering, spend cap (reserve before pay), lease lock, semaphore, heartbeat for agents. Free tr

發布方自己的服務:Dirtsmith outside-tools rate sheet

已驗證Streamable HTTP可網頁執行雲端與基礎設施開發者工具商業與電商

概覽

AI 產生的概覽

託管型 MCP 端點,用於計量可計費的呼叫,並以共享預算、鎖、號誌與心跳協調多個代理。

可以做什麼
  • 依工具呼叫記錄冪等的可計費用量事件,並預覽帳單明細
  • 設定共享支出預算,並以原子方式預留、結算或釋放金額
  • 取得、續期與釋放帶 TTL 與柵欄權杖的具名租約鎖
  • 以計數號誌限制並行數,發放許可與柵欄權杖
  • 登錄代理心跳,並列出已靜默或崩潰的代理
適用情境
適合想按呼叫收費但不想自建計量系統的 MCP 伺服器作者,也適合執行多個代理、需要共享預算上限、單一執行鎖、並行上限或崩潰偵測的團隊。
執行需求
遠端 streamable HTTP 端點;無需註冊、API 金鑰或環境變數。每次呼叫會先回傳一個資料封包,須在約兩秒內解出並以答案重試。狀態依 16 至 128 字元的命名空間共享。
安裝前請注意
免費額度有限(每個 IP 每天 100 次免金鑰呼叫,之後依工具計算每月免費次數);繼續使用需由人工核准付款連結或按次付費,計量事件依公布費率計費。任何知道命名空間的人都能讀取與變更該共享狀態,應視同密碼保管。服務條款與隱私政策仍為草案,尚未生效。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Agent Billing Primitives (Dirtsmith),將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.throttler300%2Fmcp-usage-metering/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "agent-billing-primitives-dirtsmith": {
      "type": "http",
      "url": "https://gap-functions.bfurrow26.workers.dev/mcp"
    }
  }
}

README

MCP Usage Metering + agent coordination (Dirtsmith)

Free first call, one step, no key, no signup: curl -s https://gap-functions.bfurrow26.workers.dev/try returns a tiny packet, the solve rule, and a one-liner. POST the answers back to /try and you get the real tool result. ?tool=agent_lease_lock (or any tool below) for the others.

Search words: usage metering, metered billing, idempotent, reserve before pay, spend cap, budget, distributed lock / lease lock, fencing token, semaphore, concurrency limit, heartbeat, dead-man switch, free first call.

Hosted tool that records one billable usage event per MCP tool call, idempotently, and returns an invoice preview. Built for MCP server authors who want to charge per call without building metering.

  • Endpoint (MCP): https://gap-functions.bfurrow26.workers.dev/mcp (all URLs in config.json)
  • Tool list: GET /mcp/tools · Health: GET /health
  • Contract: schema/mcp_usage_metering.v1.0.0.json (strict input, required idempotency_key, versioned 1.0.0)

Pricing and buying (no signup, no key)

  • Call the tool directly. Each IP gets 100 free keyless calls per day.
  • After that, tools/call returns isError: true with error_code: PAYMENT_REQUIRED. structuredContent.payment holds a one-click approve_and_pay_url for your human and a grant_token. Your agent asks you once, you click buy, then the agent retries the same call with header X-Grant-Token (or uses the /u/<grant_token>/mcp URL form). Same token forever.
  • Usage after purchase: $0.15 per 1,000 events ($0.00015/event), 10,000 free events per month per account.
  • Replays with the same idempotency_key are never billed twice.

Inputs

Required: tool_name, tool_version (semver), end_customer_ref, idempotency_key (8–128 chars). Optional: units, unit_label, unit_price_cents, metadata.

Legal

Terms of Service and Privacy Policy are DRAFT, pending counsel review, not yet in effect — see legal/.

License

MIT (this repository: docs and schema). Operated by Dirtsmith LLC.

More tools on the same endpoint (added 2026-11-03)

The same MCP URL (https://gap-functions.bfurrow26.workers.dev/mcp) also serves:

  • agent_spend_ledger: hosted shared budget ledger. Actions: set_budget, reserve, settle, release, status. Reserve is atomic: concurrent agents on one budget can never exceed the ceiling. Reservations expire after ttl_s (default 900 s). Amounts are integer micro-USD. $9.00 per 1,000 calls after 1,000 free calls a month.
  • agent_lease_lock: hosted lease lock. Actions: acquire, renew, release, status, with ttl_s and a monotonic fencing_token. $0.90 per 1,000 calls after 1,000 free calls a month.
  • agent_semaphore: hosted counting semaphore. Actions: acquire (with max_slots, holder_id, ttl_s), release (by permit_id), status. At most N permits at once; each permit carries a monotonic fencing_token; full returns NO_SLOT_FREE with retry_after_s. $0.90 per 1,000 calls after 1,000 free calls a month.
  • agent_heartbeat_registry: hosted dead-man switch. Actions: beat (with agent_id, interval_s, grace_s, optional note), status, list_stale (agents past interval + grace, up to 100). $0.90 per 1,000 calls after 1,000 free calls a month. State is shared by namespace (16-128 chars). Any agent that knows the namespace can read and change that state, so treat it like a password. We store only its hash. Buying works the same way as metering: no signup or key, one approve-and-pay link when the free calls run out.

來源:README.md,提交 c0798af

工具

5

mcp_usage_metering

Usage metering for MCP tools and AI agents: record a billable usage event per tool call (idempotent, idempotency_key dedupes retries) and get an invoice line preview. Per-call billing, usage-based pricing, metered billing for MCP servers. Every call requires one solved task: a tiny data packet, OR (this tool only) a public item: one line of public-domain text plus a deterministic format conversion (snake_case, word count, uppercase) with a known answer, returned as item_alternative; answer it within 2 s via item:{item_id, answer}. Verified answers are stored and readable at GET /items. Free first call, no API key (GET /try). Pay-ahead: every response carries next_work_packet; pass work_answer {work_packet_id, labels} on your next call (under 2 s) instead of solving a fresh packet. That work is our own internal classification (Buyer Zero), not customer data.

輸入參數unitssourcemetadatacaller_idtool_name必填unit_labeltool_version必填idempotency_key必填end_customer_ref必填unit_price_cents

agent_spend_ledger

Agent spend cap / budget ledger: set a budget, reserve before pay (atomic, never overspends even with many agents in parallel), then settle or release. Idempotent, shared by namespace. Spending limit, budget guard, cost control for AI agents. Every call requires a tiny solved packet (returned in the reply, 2 s, one try); free first call, no API key (GET /try?tool=agent_spend_ledger).

輸入參數memottl_saction必填sourcebudget_id必填caller_idnamespace必填limit_microsamount_microsreservation_ididempotency_key必填

agent_lease_lock

Distributed lock / lease lock (mutex) for AI agents: acquire, renew, release a named lock with TTL and a monotonic fencing token so only one agent runs a job at a time. Idempotent, shared by namespace, no Redis needed. Every call requires a tiny solved packet (returned in the reply, 2 s, one try); free first call, no API key (GET /try?tool=agent_lease_lock).

輸入參數ttl_saction必填sourcecaller_idholder_idlock_name必填namespace必填idempotency_key必填

agent_semaphore

Counting semaphore / concurrency limit for AI agents: at most N agents hold a slot at once (rate limit parallel workers), TTL permits with fencing tokens, auto-expire on crash. Idempotent, shared by namespace. Every call requires a tiny solved packet (returned in the reply, 2 s, one try); free first call, no API key (GET /try?tool=agent_semaphore).

輸入參數ttl_saction必填sourcecaller_idholder_idmax_slotsnamespace必填permit_idsemaphore必填idempotency_key必填

agent_heartbeat_registry

Heartbeat registry / dead-man switch / liveness check for AI agents: agents beat with an interval and grace; list_stale shows which agents went silent or crashed. Idempotent, shared by namespace. Every call requires a tiny solved packet (returned in the reply, 2 s, one try); free first call, no API key (GET /try?tool=agent_heartbeat_registry).

輸入參數noteaction必填sourcegrace_sagent_idcaller_idnamespace必填interval_sidempotency_key必填

版本歷史

2
  1. v1.4.0最新Nov 4, 2026
  2. v1.1.0Nov 4, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Workers 整合