Skip to main content

AgentBill MCP server. Add spend controls and billing to any AI agent in 3 lines.

Project description

agentbill-mcp

AgentBill MCP server. Add spend controls and usage billing to any AI agent in 3 lines.

What it does

Exposes two tools to any MCP-compatible agent host (Claude Code, Cursor, Windsurf, etc.):

  • preflight(agent_id, customer_id, estimated_units, ceiling) — check if a customer has budget before starting work. Blocks if exhausted.
  • record_event(agent_id, units, customer_id, metadata) — bill a customer after work completes. Idempotent.

Install

uvx agentbill-mcp

No install needed. uvx runs it directly.

Configure

Claude Code

Add to ~/.claude/settings.json:

{
  "mcpServers": {
    "agentbill": {
      "command": "uvx",
      "args": ["agentbill-mcp"],
      "env": {
        "AGENTBILL_API_KEY": "sk_live_your_key_here"
      }
    }
  }
}

Cursor / Windsurf / other MCP clients

Add to your MCP config:

{
  "agentbill": {
    "command": "uvx",
    "args": ["agentbill-mcp"],
    "env": {
      "AGENTBILL_API_KEY": "sk_live_your_key_here"
    }
  }
}

Get your API key at agentbill.dev/dashboard.

Usage

Once configured, any agent using this MCP server can:

# Before running a task:
preflight(agent_id="research_agent", customer_id="user_123", estimated_units=5)

# After completing the task:
record_event(agent_id="research_agent", units=5, customer_id="user_123")

The server blocks the run if the customer has no remaining budget. No code changes needed in your agent.

Environment variables

Variable Required Default Description
AGENTBILL_API_KEY Yes Your AgentBill API key
AGENTBILL_BASE_URL No https://agentbill.fly.dev Override for self-hosted

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentbill_mcp-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentbill_mcp-0.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file agentbill_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: agentbill_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for agentbill_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7ab49bec4b26d2281df7ccc04a496b13cdf3d07325643c77529ecf94ee86eba5
MD5 84eecfff52f1b7f08e3a7d5149ae4ae3
BLAKE2b-256 7e0f676b5efb626e7de3b773286321f7cffcd3e55cf43ae7edfb7d826dda2687

See more details on using hashes here.

File details

Details for the file agentbill_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agentbill_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for agentbill_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8ab7abb04e55b6f3fb7328f352fad6a26f878ff37f72a3edb3d380267b3f879
MD5 faf298a219bb248d52f50925c128c406
BLAKE2b-256 a31009b99a39ba964adc19758265d5d2ec08406795d3377c9c0862eb3fdcb6fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page