MCP Invoice Generator
Generates PDF invoices using Typst templates, enabling customizable invoice layouts with automatic VAT calculation and French formatting.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Invoice GeneratorCreate an invoice for client Acme Corp for 5 days of consulting"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π§Ύ MCP Invoice Generator
Generate PDF invoices via a Model Context Protocol (MCP) server.
This server is primarily designed for local use via stdio. It generates PDF invoices directly on your machine using Typst β a modern, fast typesetting system that replaces traditional HTML/CSS-to-PDF pipelines. Templates are clean, readable .typ files compiled to pixel-perfect PDFs in milliseconds. Billing data (issuers, clients, services) is loaded from a local TOML file, making it easy to manage without any external service or database.
Features
PDF invoice generation β Typst template compiled to PDF
MCP server β
generate_invoiceandget_default_valuestools accessible by an LLMTOML configuration β issuers, clients and services defined in
data/billing.tomlFastMCP β modern MCP server framework
Typst β typesetting system for PDF rendering
pydantic-settings β application settings management
dynaconf β TOML billing data loading
uv β dependency management
ruff β linter & formatter
Dockerfile β multi-stage build ready for production
Related MCP server: DocFiller
Requirements
Getting Started
1. Clone the repository
git clone https://github.com/pirocheto/mcp-invoice-generator
cd mcp-invoice-generator2. Billing data
Copy and fill in the data file:
cp data/billing.toml.example data/billing.tomlThis file is the core data source for invoice generation. It defines the people, companies, and services that can appear on your invoices. The get_default_values tool reads directly from this file, and generate_invoice uses the provided data to populate the PDF.
You can define multiple entries in each section β simply repeat the [[issuers]], [[services]], or [[clients]] block.
[[issuers]]
name = "Jane Doe"
address = "12 rue de la Paix"
city = "Lyon"
postal = "69001"
email = "jane.doe@example.com"
siren = "123 456 789"
siret = "123 456 789 00012"
vat_number = "FR 12 123 456 789"
iban = "FR76 ..."
bic = "BNPAFRPPXXX"
tax_rate = 0.2
[[services]]
name = "consulting"
daily_rate = 600
description = "Professional services β consulting"
[[clients]]
name = "Acme Corp"
address = "42 avenue des Champs-ΓlysΓ©es"
city = "Paris"
postal = "75008"
siren = "987 654 321"
vat_number = "FR 98 987 654 321"3. Environment variables
The application is configured via environment variables (prefixed with APP_) or a .env file at the project root.
Variable | Default | Description |
|
| Name of the MCP server |
|
| Environment ( |
|
| Directory where generated PDFs are saved |
|
| Directory containing Typst invoice templates |
|
| Path to the billing data TOML file |
Relative paths are resolved from the project root. Absolute paths are used as-is.
Installation
Local (stdio)
Clone the repository and point your MCP client (e.g. Claude Desktop, Github Copilot, OpenCode, etc) to it:
{
"mcpServers": {
"invoice-generator": {
"type": "stdio",
"env": {
"APP_DATA_FILE": "./data/billing.toml",
"APP_OUTPUT_DIR": "./outputs",
"APP_TEMPLATE_DIR": "./templates"
},
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/mcp-invoice-generator",
"--",
"fastmcp",
"run"
]
}
}
}Replace
/path/to/mcp-invoice-generatorwith the absolute path where you cloned the repository.
Docker
The project includes a multi-stage Dockerfile optimised for production:
Builder stage β installs dependencies with
uvusing layer cachingRuntime stage β minimal
python:3.13-slimimage with only the virtual environment copied overTypst binary copied from the official
ghcr.io/typst/typstimageRuns as a non-root user (
nonroot, uid 999)Exposes the MCP server via
uvicornon port8000
# Build the image
make build
# Run the container (mounts data/, outputs/ and templates/, exposes port 8000)
make start
data/billing.tomlmust exist before running the container β it is mounted at runtime and is never baked into the image.
MCP Tools
get_default_values β Returns all default billing data from billing.toml, including available issuers, services, and clients.
generate_invoice β Generates a PDF invoice from flat input fields.
Parameter | Type | Default | Description |
|
| β | Invoice number |
|
| today | Invoice date (ISO 8601) |
|
| β | Issuer full name |
|
| β | Issuer street address |
|
| β | Issuer city |
|
| β | Issuer postal code |
|
| β | Issuer email address |
|
| β | Issuer SIREN number |
|
| β | Issuer SIRET number |
|
| β | Issuer VAT number |
|
| β | Issuer IBAN |
|
| β | Issuer BIC / SWIFT code |
|
| β | VAT rate (e.g. |
|
| β | Daily rate in euros (TJM) |
|
| β | Service description line on invoice |
|
| β | Number of days worked |
|
| β | Client company name |
|
| β | Client street address |
|
| β | Client city |
|
| β | Client postal code |
|
| β | Client SIREN number |
|
| β | Client VAT number |
Returns the path to the generated PDF file.
Template
The invoice template is located in templates/invoice.typ and is written in Typst, a modern typesetting language. It receives all invoice fields as named parameters and is compiled to PDF by the typst Python package.
The included template is designed for French freelancers: it is based on a daily rate (TJM), computes subtotal, VAT, and total, and formats all monetary values using French conventions (e.g. 3 000,00 β¬).
To customise the invoice layout, edit templates/invoice.typ directly.
Template parameters
All parameters are passed as flat named arguments to the Typst template function.
Issuer
Parameter | Type | Description |
|
| Full name |
|
| Street address |
|
| City |
|
| Postal code |
|
| Email address |
|
| SIREN number |
|
| SIRET number |
|
| VAT number |
|
| IBAN |
|
| BIC / SWIFT code |
|
| VAT rate (e.g. |
Client
Parameter | Type | Description |
|
| Company name |
|
| Street address |
|
| City |
|
| Postal code |
|
| SIREN number |
|
| VAT number |
Service
Parameter | Type | Description |
|
| Daily rate in euros (TJM) |
|
| Description line on invoice |
|
| Number of days worked |
Invoice
Parameter | Type | Description |
|
| Invoice number |
|
| Invoice date (DD/MM/YYYY) |
Development
make devStarts the server with --reload via dev.fastmcp.json.
Make Commands
Command | Description |
| Start server in development mode with auto-reload |
| Run tests with coverage report |
| Build the Docker image |
| Run the container in production |
| Launch the MCP inspector |
License
MIT β see LICENSE.
Available Tools
2 toolsgenerate_invoiceB
Generate an invoice for a client in PDF format. The invoice is saved to the outputs directory and the path is returned.
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses a key side effect (saving the invoice to the outputs directory) and the return value (the path). However, it does not mention potential errors, overwriting behavior, permissions, or the fact that the operation creates a file, which is only implied. It provides basic transparency but lacks depth.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the main action, and every word earns its place. It is succinct, clear, and free of unnecessary detail, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having an output schema, the description is inadequate for the complexity of the input. It does not explain the structure or purpose of the 'data' parameter, nor does it mention that the data must include issuer, client, and service details. The sole focus on output leaves a significant gap in understanding how to correctly invoke the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description does not explain what data should contain or provide any context for the numerous required fields. The schema's field names are self-explanatory to some degree, but the description adds no value beyond the schema, leaving the agent to guess at the meaning and format of the nested data object.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool generates an invoice for a client in PDF format, and it distinguishes itself from the sibling tool get_default_values by indicating its unique output (PDF saved to outputs directory). It uses a specific verb and resource, making the purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, such as get_default_values. It does not mention any prerequisites, exclusions, or scenarios where a different tool would be more appropriate. Users are left to infer usage from the description alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_default_valuesA
Get the default values for invoices, including available issuers, services, and clients.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description must carry the full burden of behavioral disclosure. The verb 'Get' implies a read-only operation, but the description does not explicitly state the absence of side effects, permissions required, or other behavioral traits. It is adequate but could be more transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, substantive sentence that front-loads the action and resource. Every word earns its place, with no redundancy or filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a no-parameter tool with a simple retrieval function, the description is complete. It lists the key components of the response, and the presence of an output schema covers return value details. No additional context is needed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the baseline is 4. The description adds value by detailing what the default values include (issuers, services, clients), which is helpful context even though there are no input parameters to document.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('Get') and resource ('default values for invoices'), and it enumerates the contents (issuers, services, clients). This distinguishes it from the sibling 'generate_invoice' tool, which focuses on creation rather than retrieval.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage as a preparatory step for generating invoices, but it does not explicitly state when to use this tool over generate_invoice or provide alternative scenarios. The context is clear but lacks explicit when/when-not guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.1.0- First observed
generate_invoice - First observed
get_default_values
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one retrieves configuration defaults, the other generates the invoice. There is no overlap or confusion between them.
Both tools follow a consistent verb_noun pattern with lowercase and underscores ('get_default_values', 'generate_invoice'). The style is uniform across the set.
With only two tools, the server feels thin for an invoice generator, though the core functionality (fetching defaults and generating) is present. It falls at the lower end of acceptable tool counts.
The set covers the essential flow of retrieving defaults and generating an invoice, but lacks auxiliary operations such as listing previously generated invoices or managing invoice data. These are minor gaps that agents can work around.
Maintenance
Related MCP Connectors
Create PDF invoices from your AI chat: clients, numbering, VAT, overdue reports. All data is local.
Generate PDFs from templates via AI chat. Works with Claude, ChatGPT, Cursor, and any MCP client.
MCP server for the PDFGate API. Generate PDFs, manage documents and handle e-signatures.
Create and manage invoices and customers on Jupiter Invoice (MCP, API-key auth).
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server that lets AI agents produce print-ready, typographically correct PDFs using Typst, with a page-as-canvas engine, multiple templates, and per-page layout quality control.MIT
- FlicenseNot gradedqualityDmaintenanceEnables generating PDFs from DOCX/ODT templates using MCP with support for OpenAI or local Ollama models.-
- AlicenseNot gradedqualityDmaintenanceEnables invoice management through MCP, including customer, invoice, and report operations with CLI and web interfaces.MIT
- FlicenseNot gradedqualityCmaintenanceA local-first MCP server for creating PDF invoices from SQLite data, supporting client management and invoice generation.-