# Agent Billing Primitives (Dirtsmith)

> Agent Billing Primitives (Dirtsmith) is a freemium MCP server for finance and payments. Hosted metering, spend caps, locks, semaphores and heartbeats for MCP agents. It runs as a hosted remote server, so there is nothing to install locally.

- **Kind:** MCP server
- **Pricing:** Freemium
- **Platforms:** API
- **Repository:** https://github.com/throttler300/mcp-usage-metering
- **MCP Registry name:** io.github.throttler300/mcp-usage-metering
- **Categories:** [finance and payments](https://ai-powered.com/categories/finance-and-payments), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-23

## About

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.

## Features

- **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

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
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.

### Claude Code: Or share it with your project (.mcp.json)

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

### Claude Desktop (Customize → Connectors → Add → Add custom connector)

```text
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.

### Cursor (~/.cursor/mcp.json)

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

### VS Code (~/.copilot/mcp-config.json)

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

### ChatGPT (chatgpt.com → Plugins → + → Add custom MCP server)

```text
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.

### Codex: Add with the CLI (Terminal)

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

### Codex: Or add to config.toml (~/.codex/config.toml)

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

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```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

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

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

### Devin Desktop (~/.config/devin/mcp_config.json)

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

### Cline (cline_mcp_settings.json)

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

### Zed (Zed settings.json)

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

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

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

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

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

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

### Kiro (~/.kiro/settings/mcp.json)

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

### Grok Bot (Grok Bot desktop app → Connect apps → Add a custom connector)

```sh
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.

### Other clients (your client's MCP settings (most use this shape))

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

## Tools

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.

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

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/agent-billing-primitives-dirtsmith
