agent-invoice
Enables agents to generate, track, and manage invoices via MCP tools, with CLI support for payment tracking and earnings summaries.
README
Agent Invoice
MCP server + CLI for autonomous agents to generate, track, and manage invoices.
Built for the agentic economy — by Nyx Builds.
Why?
Agents do work. Agents need to get paid. But there's no standard way for an autonomous agent to:
- Generate an invoice for completed work
- Track payment status across clients
- Maintain a ledger of earnings
- Integrate billing into their workflow via MCP
- Bill in multiple currencies with tax calculations
- Set up recurring invoices for retainer clients
Agent Invoice fixes this. It's a self-contained billing system designed for AI agents.
Features
- 📄 Invoice Generation — Create professional invoices with line items, due dates, and client info
- 💰 Tax Calculation — Per-line-item and invoice-level tax rates with automatic computation
- 💱 Multi-Currency — 15+ currencies (USD, EUR, GBP, JPY, etc.) with proper symbols and decimal handling
- 🔄 Recurring Invoices — Set up weekly, biweekly, monthly, quarterly, or yearly billing templates
- 🏷️ Custom Numbering — Configurable invoice numbering (prefix, separator, digits)
- 📊 Payment Tracking — Monitor which invoices are pending, paid, or overdue
- 📒 Earnings Ledger — Running total of all income, tax, and discounts across invoices
- 🔌 MCP Server — Full Model Context Protocol integration so any agent can bill via their standard tool interface
- 💻 CLI — Command-line interface for direct use or scripting
- 💾 JSON Storage — Simple file-based storage, no database required
- 📤 Export — Export invoices as JSON or Markdown
Quick Start
CLI Usage
# Create a client (with EUR as default billing currency)
agent-invoice client add "Acme Corp" --email billing@acme.com --currency EUR
# Create an invoice with tax
agent-invoice create \
--client "Acme Corp" \
--item "Code review,40,150.00,8.5" \
--item "Bug fixes,10,200.00" \
--tax-rate 8.5 \
--due 30
# Apply a discount
agent-invoice discount INV-0001 50.00
# List all invoices in EUR
agent-invoice list --currency EUR
# Mark an invoice as paid
agent-invoice pay INV-0001
# Show earnings summary
agent-invoice earnings
# Set up a recurring monthly invoice
agent-invoice recurring create \
--client "Acme Corp" \
--item "Retainer,1,500.00" \
--frequency monthly
# Generate an invoice from a recurring template
agent-invoice recurring generate REC-ABC123
# Process all due recurring invoices
agent-invoice recurring process
# Configure invoice numbering
agent-invoice numbering set --prefix BIL --separator / --digits 3
# List supported currencies
agent-invoice currencies
MCP Server
Start the MCP server for integration with any MCP-compatible agent:
agent-invoice serve
The server exposes these tools:
create_invoice— Generate a new invoice (with tax, currency, discounts)list_invoices— List all invoices with optional filtering by status, client, or currencyget_invoice— Get details of a specific invoicemark_paid— Mark an invoice as paidmark_sent— Mark an invoice as sentcancel_invoice— Cancel an invoiceapply_discount— Apply a discount to an invoiceadd_client— Register a new client (with default currency)list_clients— List all clientsearnings_summary— Get earnings breakdown (with tax and discount totals)export_invoice— Export an invoice as markdowncreate_recurring— Create a recurring invoice templatelist_recurring— List recurring invoice templatesgenerate_from_recurring— Generate an invoice from a recurring templatepause_recurring— Pause a recurring invoiceresume_recurring— Resume a paused recurring invoiceprocess_due_recurring— Generate invoices for all due recurring templatesget_numbering_config— Get the current invoice numbering configurationupdate_numbering_config— Update invoice numbering (prefix, separator, digits)list_currencies— List all supported currencies
Tax Calculation
Agent Invoice supports two levels of tax:
- Line-item tax — Set a tax rate on individual items:
--item "Consulting,10,200.00,8.5" - Invoice-level tax — Set a default tax rate for items without their own:
--tax-rate 8.5
Items with their own tax rate override the invoice-level rate. The grand total is computed as:
Subtotal + Total Tax - Discount = Grand Total
Multi-Currency
Set a default currency per client, or override per invoice:
# Client with EUR default
agent-invoice client add "Berlin GmbH" --currency EUR
# Override to GBP for a specific invoice
agent-invoice create --client "Berlin GmbH" --currency GBP --item "Work,100.00"
Supported currencies: USD, EUR, GBP, JPY, CAD, AUD, CHF, CNY, INR, BRL, KRW, MXN, SGD, SEK, NZD
Recurring Invoices
Create templates that generate invoices on a schedule:
# Monthly retainer
agent-invoice recurring create --client "Acme" --item "Retainer,1,500.00" --frequency monthly
# Weekly support
agent-invoice recurring create --client "Beta" --item "Support,1,200.00" --frequency weekly
# Generate manually
agent-invoice recurring generate REC-ABC123
# Process all due (run daily via cron)
agent-invoice recurring process
# Pause/resume
agent-invoice recurring pause REC-ABC123
agent-invoice recurring resume REC-ABC123
Custom Invoice Numbering
# View current config
agent-invoice numbering show
# Change prefix and format
agent-invoice numbering set --prefix BIL --separator / --digits 3
# Generates: BIL/001, BIL/002, ...
# Year-based numbering
agent-invoice numbering set --prefix 2026 --separator - --digits 5
# Generates: 2026-00001, 2026-00002, ...
Installation
pip install agent-invoice
Or with uv:
uv pip install agent-invoice
Architecture
agent-invoice/
├── src/agent_invoice/
│ ├── __init__.py
│ ├── models.py # Pydantic data models (Invoice, Client, RecurringInvoice, etc.)
│ ├── store.py # JSON file storage with numbering config
│ ├── service.py # Business logic (tax, currency, recurring, discounts)
│ ├── cli.py # Click CLI with 20+ commands
│ └── mcp_server.py # MCP server with 20 tools
├── tests/
│ ├── test_models.py
│ ├── test_store.py
│ ├── test_service.py
│ └── test_cli.py
└── data/ # Default storage location
Data Storage
Invoices, clients, and recurring templates are stored as JSON files in ~/.agent-invoice/ by default. Set the AGENT_INVOICE_DIR environment variable to customize the location.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。