agent-invoice

agent-invoice

Enables agents to generate, track, and manage invoices via MCP tools, with CLI support for payment tracking and earnings summaries.

Category
Visit Server

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 currency
  • get_invoice — Get details of a specific invoice
  • mark_paid — Mark an invoice as paid
  • mark_sent — Mark an invoice as sent
  • cancel_invoice — Cancel an invoice
  • apply_discount — Apply a discount to an invoice
  • add_client — Register a new client (with default currency)
  • list_clients — List all clients
  • earnings_summary — Get earnings breakdown (with tax and discount totals)
  • export_invoice — Export an invoice as markdown
  • create_recurring — Create a recurring invoice template
  • list_recurring — List recurring invoice templates
  • generate_from_recurring — Generate an invoice from a recurring template
  • pause_recurring — Pause a recurring invoice
  • resume_recurring — Resume a paused recurring invoice
  • process_due_recurring — Generate invoices for all due recurring templates
  • get_numbering_config — Get the current invoice numbering configuration
  • update_numbering_config — Update invoice numbering (prefix, separator, digits)
  • list_currencies — List all supported currencies

Tax Calculation

Agent Invoice supports two levels of tax:

  1. Line-item tax — Set a tax rate on individual items: --item "Consulting,10,200.00,8.5"
  2. 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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured