New:Socket for Asana Is Now Available.Learn more
Get Started

mcp-billing

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
Package was removed
Sorry, it seems this package was removed from the registry

mcp-billing

MCP Server for invoice generation, payment tracking, 3-level dunning, German tax compliance (§14 UStG), and billing analytics

latest
Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

mcp-billing

A Model Context Protocol (MCP) server for invoice management, payment tracking, automated dunning, German tax compliance, and billing analytics.

17 tools | 3 resources | Stripe integration | PDF generation | Multi-language (DE/EN/ES)

Features

  • Invoice Management -- Create, send, track, and cancel invoices with auto-generated sequential numbers
  • PDF Generation -- Professional, legally compliant invoices and dunning letters (German §14 UStG) via Puppeteer
  • 3-Level Dunning -- Automated escalation: Payment Reminder (free) → 1st Reminder (5 EUR fee) → 2nd Reminder (10 EUR fee)
  • Tax Compliance -- Kleinunternehmer (§19 UStG), Standard VAT (19%), and Reverse Charge (EU B2B)
  • Stripe Integration -- Sync payments from Stripe, auto-match to invoices, create invoices from subscriptions
  • Credit Notes -- Issue refunds linked to original invoices with auto-status updates
  • Analytics -- MRR/ARR dashboard, revenue forecast, payment success rates, revenue by product
  • Configurable Branding -- All company details, colors, and prefixes via environment variables

Quick Start

Prerequisites

  • Node.js >= 18
  • PostgreSQL database
  • Puppeteer (for PDF generation)

Installation

npm install mcp-billing

Database Setup

Run the SQL migration to create the 7 billing tables:

psql -d your_database -f scripts/create-tables.sql

Or use Prisma:

DATABASE_URL="postgresql://user:pass@localhost:5432/mydb" npx prisma db push

Configuration

All configuration via environment variables:

# Required
DATABASE_URL="postgresql://user:pass@localhost:5432/mydb"

# Branding (all optional, sensible defaults)
BILLING_BRAND_NAME="MyCompany"
BILLING_CONTACT_NAME="John Doe"
BILLING_CONTACT_EMAIL="billing@mycompany.com"
BILLING_WEBSITE_URL="mycompany.com"
BILLING_IBAN="DE89 3704 0044 0532 0130 00"
BILLING_BIC="COBADEFFXXX"
BILLING_INVOICE_PREFIX="INV"          # Default: INV
BILLING_CREDIT_NOTE_PREFIX="CN"       # Default: CN
BILLING_OUTPUT_DIR="./output/invoices" # PDF output directory
BILLING_PAYMENT_TERMS_DAYS="14"       # Default: 14
BILLING_CURRENCY="EUR"                # Default: EUR
BILLING_ACCENT_COLOR="#2563EB"        # Brand color for PDFs

# Product catalog (optional, for subscription-based invoicing)
BILLING_PRODUCTS='{"pro": {"cents": 9900, "label": "Pro Plan"}, "enterprise": {"cents": 29900, "label": "Enterprise Plan"}}'

Running

# Stdio mode (for MCP clients like Claude Desktop)
npx mcp-billing

# HTTP mode (persistent microservice)
MCP_HTTP=1 MCP_PORT=4002 npx mcp-billing

MCP Client Configuration

{
  "mcpServers": {
    "billing": {
      "command": "npx",
      "args": ["mcp-billing"],
      "env": {
        "DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb",
        "BILLING_BRAND_NAME": "MyCompany",
        "BILLING_INVOICE_PREFIX": "INV"
      }
    }
  }
}

Tools (17)

Invoice Management (6)

ToolDescription
billing_create_invoiceCreate from Stripe subscription or manually with company + line items
billing_get_invoiceLookup by ID or invoice number, returns full details with line items
billing_list_invoicesFilter by status, company, date range, or overdue flag
billing_send_invoiceMark invoice as sent
billing_mark_paidRecord manual payment (bank transfer, etc.)
billing_cancel_invoiceCancel with optional reason

PDF Generation (2)

ToolDescription
billing_generate_invoice_pdfProfessional PDF with configurable branding. Supports DE/EN/ES
billing_generate_reminder_pdfDunning PDF with original invoice reference and fees

Payments (2)

ToolDescription
billing_sync_paymentsSync from Stripe, auto-match to invoices
billing_list_paymentsPayment history with filters

Analytics (2)

ToolDescription
billing_dashboardMRR, ARR, outstanding/overdue amounts, payment success rate
billing_revenue_forecastProject revenue forward N months based on churn rate

Dunning (2)

ToolDescription
billing_check_overdueFind overdue invoices, auto-create escalating reminders
billing_send_reminderMark reminder as sent

Tax (1)

ToolDescription
billing_tax_reportNetto/USt/Brutto breakdown by period (month/quarter/year)

Credit Notes (1)

ToolDescription
billing_create_credit_noteIssue refund linked to original invoice

Configuration (1)

ToolDescription
billing_set_tax_configSet tax mode globally or per company

Resources (3)

URIDescription
billing://dashboardLive billing dashboard (JSON)
billing://overdueCurrent overdue invoices (JSON)
billing://tax-configTax configuration (JSON)

Workflows

Monthly Invoicing

  • billing_create_invoice for each active subscription
  • billing_generate_invoice_pdf for each invoice
  • billing_send_invoice to mark as sent

Payment Reconciliation

  • billing_sync_payments to pull from Stripe
  • billing_list_payments to verify
  • billing_mark_paid for manual payments (bank transfers)

Dunning Process

  • billing_check_overdue (run daily/weekly)
  • billing_generate_reminder_pdf for new reminders
  • billing_send_reminder to mark as sent

Tax Reporting

  • billing_tax_report with period type
  • Review Netto/USt/Brutto breakdown
  • Export for tax advisor

Database Schema

7 tables with proper indexes:

  • billing_sequences -- Invoice number sequences
  • billing_tax_configs -- Tax configuration (global + per-company)
  • billing_invoices -- Invoices with full company and tax details
  • billing_invoice_items -- Line items per invoice
  • billing_payments -- Payment records (Stripe + manual)
  • billing_reminders -- Dunning reminders (3 levels)
  • billing_credit_notes -- Credit notes / refunds

All monetary values are stored in cents (19900 = 199.00 EUR).

Transport Modes

ModeFlagUse Case
Stdio(default)Claude Desktop, MCP clients via subprocess
HTTP--http or MCP_HTTP=1Persistent microservice, agent fleets

HTTP mode includes:

  • Health check endpoint (/health)
  • Session management with auto-cleanup (30min TTL)
  • CORS support
  • Graceful shutdown

Tax Modes

ModeVATUse Case
kleinunternehmer0%German small business (§19 UStG)
standard19%Regular German VAT
reverse_charge0%EU B2B (§13b UStG)

License

MIT

Keywords

mcp

FAQs

Package last updated on 10 Jul 2026

Related posts