Agent Billing Primitives (Dirtsmith)

io.github.throttler300Published by GitHub account throttler300v1.4.0Updated Nov 4, 2026

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

The publisher's own server: Dirtsmith outside-tools rate sheet

Overview

AI-generated overview

Hosted MCP endpoint for metering billable tool calls and coordinating agents with shared budgets, locks, semaphores and heartbeats.

What you can do
  • Record idempotent billable usage events per tool call and preview invoice lines
  • Set a shared spend budget, then reserve, settle or release amounts atomically
  • Acquire, renew and release named lease locks with TTLs and fencing tokens
  • Limit concurrency with a counting semaphore that hands out permits and fencing tokens
  • Register agent heartbeats and list agents that have gone silent or crashed
When to use it
Useful for MCP server authors who want per-call metering without building it, and for teams running several agents that need a shared budget ceiling, a single-runner lock, a concurrency cap or crash detection.
Requirements
Remote streamable HTTP endpoint; no signup, API key or environment variables. Each call first returns a packet that must be solved within about two seconds and retried with the solution. State is shared by a namespace string of 16 to 128 characters.
Before you install
Free allowance is limited (100 keyless calls per day per IP, then per-tool monthly free calls); further use requires a human to approve a payment link or pay per call, and metered events are billed at published rates. Anyone who knows the namespace can read and change that shared state, so treat it like a password. Terms of Service and Privacy Policy are drafts not yet in effect.

Installation

In SourceWeft

  1. Open Agent Billing Primitives (Dirtsmith) in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.throttler300%2Fmcp-usage-metering/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "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.

Source: README.md at commit c0798af

Tools

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.

Parametersunitssourcemetadatacaller_idtool_namerequiredunit_labeltool_versionrequiredidempotency_keyrequiredend_customer_refrequiredunit_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).

Parametersmemottl_sactionrequiredsourcebudget_idrequiredcaller_idnamespacerequiredlimit_microsamount_microsreservation_ididempotency_keyrequired

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).

Parametersttl_sactionrequiredsourcecaller_idholder_idlock_namerequirednamespacerequiredidempotency_keyrequired

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).

Parametersttl_sactionrequiredsourcecaller_idholder_idmax_slotsnamespacerequiredpermit_idsemaphorerequiredidempotency_keyrequired

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).

Parametersnoteactionrequiredsourcegrace_sagent_idcaller_idnamespacerequiredinterval_sidempotency_keyrequired

Version history

2
  1. v1.4.0LatestNov 4, 2026
  2. v1.1.0Nov 4, 2026

Score

100% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

Other Workers integrations