Skip to content
MCP server

Agent Billing Primitives (Dirtsmith)

Hosted metering, spend caps, locks, semaphores and heartbeats for MCP agents

Agent Billing Primitives (Dirtsmith) is a freemium MCP server for finance and payments. It runs as a hosted remote server, so there is nothing to install locally.

Pricing
Freemium
Platforms
API
Runs
Remotely
Version
1.4.0
Listing updated

Similar MCP servers

Install

Add with the CLI

Run in a terminal

claude mcp add --transport http mcp-usage-metering https://gap-functions.bfurrow26.workers.dev/mcp

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

Or share it with your project

Add to .mcp.json

{
  "mcpServers": {
    "mcp-usage-metering": {
      "type": "http",
      "url": "https://gap-functions.bfurrow26.workers.dev/mcp"
    }
  }
}

Claude Code setup guide

In Customize → Connectors → Add → Add custom connector

https://gap-functions.bfurrow26.workers.dev/mcp

Paste this URL, choose how to sign in, then click Add and Connect. On Team and Enterprise an Owner adds it in Organization settings → Connectors.

Claude Desktop setup guide

Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "mcp-usage-metering": {
      "url": "https://gap-functions.bfurrow26.workers.dev/mcp"
    }
  }
}

Use .cursor/mcp.json in a project to share it with the project.

Cursor setup guide

Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to ~/.copilot/mcp-config.json

{
  "mcpServers": {
    "mcp-usage-metering": {
      "type": "http",
      "url": "https://gap-functions.bfurrow26.workers.dev/mcp"
    }
  }
}

Or put the same entry in .mcp.json at your workspace root to share it.

VS Code setup guide

In chatgpt.com → Plugins → + → Add custom MCP server

https://gap-functions.bfurrow26.workers.dev/mcp

Paste this URL, set up sign-in, accept the warning and install the plugin. Then type @ in a chat to use it.

ChatGPT setup guide

Add with the CLI

Run in a terminal

codex mcp add mcp-usage-metering --url https://gap-functions.bfurrow26.workers.dev/mcp

Or add to config.toml

Add to ~/.codex/config.toml

[mcp_servers.mcp-usage-metering]
url = "https://gap-functions.bfurrow26.workers.dev/mcp"

Codex setup guide

Add to Grok Bot desktop app → Connect apps → Add a custom connector

https://gap-functions.bfurrow26.workers.dev/mcp

Enter a Name (for example "Agent Billing Primitives (Dirtsmith)"), choose Type: Remote HTTPS, paste this as the Server URL and choose Add plugin.

Full Grok Bot setup guide

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "mcp-usage-metering": {
      "type": "http",
      "url": "https://gap-functions.bfurrow26.workers.dev/mcp"
    }
  }
}
  • Gemini CLI and Antigravity

    Gemini CLI

    Add to ~/.gemini/settings.json

    {
      "mcpServers": {
        "mcp-usage-metering": {
          "httpUrl": "https://gap-functions.bfurrow26.workers.dev/mcp"
        }
      }
    }

    Or run: gemini mcp add -s user --transport http mcp-usage-metering https://gap-functions.bfurrow26.workers.dev/mcp

    Antigravity

    Add to ~/.gemini/config/mcp_config.json

    {
      "mcpServers": {
        "mcp-usage-metering": {
          "serverUrl": "https://gap-functions.bfurrow26.workers.dev/mcp"
        }
      }
    }

    Use .agents/mcp_config.json to add it to one workspace only.

    Gemini CLI and Antigravity setup guide

  • Devin Desktop (formerly Windsurf)

    Add to ~/.config/devin/mcp_config.json

    {
      "mcpServers": {
        "mcp-usage-metering": {
          "url": "https://gap-functions.bfurrow26.workers.dev/mcp",
          "transport": "http"
        }
      }
    }

    On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

    Devin Desktop setup guide

  • Cline

    Add to cline_mcp_settings.json

    {
      "mcpServers": {
        "mcp-usage-metering": {
          "type": "streamableHttp",
          "url": "https://gap-functions.bfurrow26.workers.dev/mcp"
        }
      }
    }

    Open it from the MCP Servers icon → Configure → Configure MCP Servers.

    Cline setup guide

  • Zed

    Add to Zed settings.json

    {
      "context_servers": {
        "mcp-usage-metering": {
          "url": "https://gap-functions.bfurrow26.workers.dev/mcp"
        }
      }
    }

    Open it with zed: open settings file. Merge context_servers into the settings you already have.

    Zed setup guide

  • JetBrains AI Assistant and Junie

    AI Assistant

    Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add

    {
      "mcpServers": {
        "mcp-usage-metering": {
          "url": "https://gap-functions.bfurrow26.workers.dev/mcp"
        }
      }
    }

    Junie

    Add to ~/.junie/mcp/mcp.json

    {
      "mcpServers": {
        "mcp-usage-metering": {
          "url": "https://gap-functions.bfurrow26.workers.dev/mcp"
        }
      }
    }

    Use .junie/mcp/mcp.json to share it with a project.

    JetBrains AI Assistant and Junie setup guide

  • Kiro

    Add to ~/.kiro/settings/mcp.json

    {
      "mcpServers": {
        "mcp-usage-metering": {
          "url": "https://gap-functions.bfurrow26.workers.dev/mcp"
        }
      }
    }

    Use .kiro/settings/mcp.json to add it to one workspace only.

    Kiro setup guide

Using several servers? Build one config file with the MCP config generator.

About Agent Billing Primitives (Dirtsmith)

The first thing to know is how you try it: a keyless curl to the /try endpoint returns a small puzzle packet, and posting the answers back gives the real tool result. Each IP gets 100 free keyless calls a day, after which a call returns a PAYMENT_REQUIRED error carrying a one-click approve-and-pay link for the human and a grant token the agent sends on retry in an X-Grant-Token header.

The original tool records one billable usage event per MCP tool call, idempotently, and returns an invoice preview. It is meant for MCP server authors who want to charge per call without building metering. Required inputs are the tool name, a semver tool version, an end-customer reference and an idempotency key of 8 to 128 characters, and replays with the same key are never billed twice. Pricing is $0.15 per 1,000 events with 10,000 free events a month.

Four coordination tools share the endpoint. agent_spend_ledger keeps a shared budget with atomic reservations that settle or release, in integer micro-USD. agent_lease_lock hands out leases with a monotonic fencing token. agent_semaphore limits concurrent holders. agent_heartbeat_registry acts as a dead-man switch that lists stale agents. State is keyed by a namespace of 16-128 characters that works like a password, and only its hash is stored. The README says the terms and privacy policy are drafts not yet in effect.

Tools this server provides (4)

Taken from the project documentation; the running server may differ.

From the tool list in its README, going by the names, 4 names don't say.

From the server's own tool labels and tool names; not verified by us.

agent_spend_ledger
Shared budget ledger with set_budget, reserve, settle, release and status actions.
agent_lease_lock
Lease lock with acquire, renew, release and status actions and a fencing token.
agent_semaphore
Counting semaphore with acquire, release and status actions.
agent_heartbeat_registry
Dead-man switch with beat, status and list_stale actions.

What it does

Idempotent usage metering
Records one billable event per tool call and returns an invoice preview.
Spend ledger
Reserves, settles and releases amounts atomically so concurrent agents cannot exceed a budget.
Lease lock
Provides acquire, renew and release with a monotonic fencing token.
Counting semaphore
Caps concurrent holders and returns a retry hint when full.
Heartbeat registry
Lists agents that are past their interval and grace period.
Buy without signup
Free calls run out into a one-click payment link and a reusable grant token.

Good for

  • Charge per call for an MCP server without building metering
  • Stop several agents from overspending one shared budget
  • Keep two agents from working on the same resource at once
  • Limit how many agents run a job concurrently
  • Detect an agent that stopped sending heartbeats

Pricing

Freemium

100 free keyless calls per IP per day; then $0.15 per 1,000 metering events ($0.90 to $9.00 per 1,000 for other tools)

Agent Billing Primitives (Dirtsmith) FAQ

How much does metering cost?

$0.15 per 1,000 events after 10,000 free events a month per account, plus 100 free keyless calls per IP per day.

What do the coordination tools cost?

The spend ledger is $9.00 per 1,000 calls after 1,000 free a month; the lock, semaphore and heartbeat tools are $0.90 per 1,000 after 1,000 free.

Are repeated requests billed twice?

No. Replays with the same idempotency key are never billed twice.

Who can see my coordination state?

Anyone who knows your namespace can read and change it, so treat it like a password.

How do I add Agent Billing Primitives (Dirtsmith) to Claude Code?

Run this command in your terminal: claude mcp add --transport http mcp-usage-metering https://gap-functions.bfurrow26.workers.dev/mcp

What are the best alternatives to Agent Billing Primitives (Dirtsmith)?

The closest alternatives to Agent Billing Primitives (Dirtsmith) are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

Where this comes from

  • Description: written from the project's README.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers