🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

agentbill-mcp

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agentbill-mcp

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

pipPyPI
Version
0.1.1
Weekly downloads
78
Maintainers
1

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

VariableRequiredDefaultDescription
AGENTBILL_API_KEYYesYour AgentBill API key
AGENTBILL_BASE_URLNohttps://agentbill.fly.devOverride for self-hosted

Keywords

agent-billing

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts