Home · Guides

Create an invoice PDF from a chat message with an MCP server

Most invoicing tools want you to leave what you are doing, open a web app, fill a form and download a file. If you already have Claude or Cursor open, the whole thing is one sentence: "invoice Acme for 12 hours of API work at 90 EUR plus a 300 EUR setup fee, 23% VAT, due in 14 days, and give me the PDF." The MCP Invoice server allocates the number, computes the tax lines and renders an A4 PDF on your disk.

Install

claude mcp add invoice -- npx -y @theluckystrike/mcp-invoice

For Cursor or Claude Desktop, the same server as a config block:

{
  "mcpServers": {
    "invoice": {
      "command": "npx",
      "args": ["-y", "@theluckystrike/mcp-invoice"]
    }
  }
}

Set your business once

The issuer block printed at the top of every invoice comes from one call. Say it in free text: your business name, address, VAT id, IBAN, default currency EUR, default tax rate 23%, payment terms 14 days. In the audit, every one of those fields was parsed out of a single sentence in a single tool call. After that you never repeat it.

Numbering that cannot repeat

Invoice numbers are allocated in the form INV-YYYY-NNNN and a number is never reused, even if you delete the invoice afterwards. That matters for the same reason it matters in any accounting system: a tax authority reading a gap in the sequence wants an explanation. The prefix defaults to INV; a custom prefix is a Pro feature. Allocation happens under a file lock, so two invoices created in the same second do not collide.

The worked example

Take the request above. Two lines, one tax rate:

invoice_create
  client: "Acme"
  currency: "EUR"
  due_days: 14
  items:
    - description: "API work",   quantity: 12, unit_price: 90,  tax_rate: 23
    - description: "Setup fee",  quantity: 1,  unit_price: 300, tax_rate: 23

The arithmetic: 12 x 90 = 1080.00, plus 300.00, subtotal 1380.00. VAT at 23% on 1380.00 is 317.40. Total 1697.40 EUR. That is the exact figure the audit produced from the natural language prompt, in two tool calls including the PDF render. Amounts are held as integer minor units and each line is rounded before the lines are summed, so the printed total always equals the printed lines added up. Several VAT rates on one invoice produce one tax line per rate, and a discount percent is applied to every line before tax.

The PDF

invoice_pdf renders A4 with pdfkit and returns the file path. The layout is a business name on the left, INVOICE and the number on the right, an issue/due/status block, a BILL TO block, a four column line table carrying per-line tax, right aligned subtotal, discount, tax lines and total, then payment details with IBAN and reference. Long descriptions wrap and long tables page. Nothing about the render touches the network, so the invoice for a client under NDA never leaves the machine.

One thing worth doing before you send: add the client's postal address. If you create an invoice for a name the server has never seen, it adds the client silently with nothing but that name, and BILL TO on the PDF is a bare word. Store the client once with client_add and every later invoice is complete.

Getting paid and chasing

invoice_mark_paid records a payment; a smaller amount than the total marks the invoice partial and reports the balance. overdue_report lists everything unpaid past its due date with days overdue and outstanding totals per currency. If you also track time, see tracking billable hours: the invoice lines the time tracker produces are the items this server wants.

Free tier

Free covers 3 invoices per calendar month, with a small footer line on the PDF; the overdue report is free. Pro ($19 once) removes the count limit and the footer, and adds a logo and a custom number prefix. Details on the MCP Invoice page and in free versus Pro.

Questions

Can I put several VAT rates on one invoice?

Yes. Tax rate is per line item. The totals block prints one tax line per distinct rate, so a 23% line and a 0% reverse-charge line appear separately and the total adds up.

Is the PDF good enough to send to a client's accounts department?

It is a single page A4 with issuer and client blocks, dates, a line table with per-line tax, subtotal, tax lines, total, and payment details with IBAN and reference. Add the client's address with client_add first, otherwise BILL TO shows only the name.

What is the invoice number format and can I change it?

INV-YYYY-NNNN, allocated in sequence and never reused. The prefix is configurable with business_set; a prefix other than INV is a Pro feature.

Does anything get uploaded when the PDF is rendered?

No. Rendering is local with pdfkit, and the invoice records live in ~/.local/share/mcp-servers/invoice/. The server makes no network calls at all.

How exact is the money arithmetic?

Amounts are integer minor units. Each line is rounded once, then lines are summed, so 12 h at 90 EUR plus 300 EUR with 23% VAT gives 1380.00 plus 317.40 = 1697.40 with no floating point residue.

Related

All MCP servers and prices · All guides