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 集成