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
- Docs: agentbill.dev
- Python SDK:
pip install agentbill-sdk - GitHub: github.com/marketinglior-pixel/agentbill
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentbill_mcp-0.1.1.tar.gz.
File metadata
- Download URL: agentbill_mcp-0.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96cd80e879410400c0d46de5d1552615b6145310167d15fef9be29b30e5a0023
|
|
| MD5 |
6c335f469ac764da0dc7d9e022da5efb
|
|
| BLAKE2b-256 |
269b790eee93e39bd6020206c75682802bb1107c6bbd3ab6efc19b6fa3f3bf30
|
File details
Details for the file agentbill_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: agentbill_mcp-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1de7fbad12ebe72b55c3e5d250c41703342153eb45a9a199ebad691d757e3726
|
|
| MD5 |
d677b47fb07cb4f04b1ec10b38a82ba6
|
|
| BLAKE2b-256 |
995679205bdcc59a6429f0722ec1f5ac50fad666fb239472a7f71c994ae19e10
|