Invoice Ninja MCP Server
This MCP server connects an MCP client to a self-hosted Invoice Ninja v5 instance for querying business data; the provided schema is read-only, while the README documents optional gated write tools.
Verify Invoice Ninja URL, token, and reachability with
in_ping.List/search/paginate clients, invoices, quotes, payments, products, expenses, vendors, expense categories, tasks, and projects.
Fetch individual clients, invoices, quotes, and tasks by ID with optional related records (e.g., contacts, line items, client, payments, project).
Filter invoices by client, client status, overdue/payable/upcoming flags, or exact invoice number.
Compute accounts-receivable totals for outstanding/overdue balances and top debtors.
Review time tracking with decoded tracked time, running state, and filters by client, project, or invoiced/uninvoiced status.
When write tools are enabled, create/update business records, perform invoice lifecycle actions, create payments/quotes/expenses, and start/stop/log/invoice tracked time, subject to safe mode and disabled-tool controls.
Provides read and optional write access to an Invoice Ninja v5 instance, including tools for clients, invoices, quotes, payments, products, expenses, tasks, projects, time tracking, and outstanding AR summaries. Write operations are gated by configuration and can be restricted through safe mode or a disabled-tools list.
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., "@Invoice Ninja MCP Server show me my outstanding invoices and top debtors"
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.
Invoice Ninja MCP Server
A self-hosted MCP server for Invoice Ninja v5 — built to talk only to your instance, with no third-party SaaS bridge in the data path. Runs locally over stdio (Claude Desktop / Claude Code) or remotely over streamable HTTP on your own box (e.g. Exoscale Zürich).
Why this exists
The existing options all have a catch:
Option | Problem for a sovereignty-first setup |
Zapier / viaSocket / Pipedream MCP | Hosted on US infra, per-call task billing — your invoice data transits a third party |
| Read-only; writes never implemented; pinned to one IN build |
| Single unverified v1.0.0 release |
Official IN MCP | Requested (issue #11843) but does not exist yet |
This server is standalone (no modification to Invoice Ninja), covers read + write, gates all mutations behind an explicit flag, and deploys anywhere Node runs.
The story behind it — why a chat-driven invoicing workflow, what the write-gating looks like in daily use, and Invoice Ninja REST API examples in curl and Python — is in the blog post Automate invoicing with MCP: my Invoice Ninja server (German: Buchhaltung automatisieren mit MCP).
Related MCP server: invox-mcp
Tools
Read (always on):
in_ping, in_list_clients, in_get_client, in_list_invoices, in_get_invoice,
in_list_quotes, in_list_payments, in_list_products, in_list_expenses, in_get_expense,
in_outstanding_summary (aggregated AR / overdue totals + top debtors),
in_list_tasks, in_get_task, in_list_projects.
Write (only when INVOICE_NINJA_ALLOW_WRITES=true):
in_create_client, in_update_client, in_create_invoice, in_invoice_action
(mark_sent / mark_paid / archive / restore / delete / cancel / email),
in_create_payment, in_create_quote, in_update_quote, in_create_product, in_create_expense,
in_update_expense,
in_create_task, in_start_task, in_stop_task, in_log_time, in_task_action
(archive / restore / delete / invoice), in_create_project.
List results are projected to key fields to keep model context lean; use the
in_get_* tools for full records.
Expenses. in_create_expense takes the supplier invoice number as number, plus payment_date
and the tax fields; it refuses a number another expense already carries (case-insensitive, in any
record state, since Invoice Ninja's own unique rule counts deleted rows) unless allow_duplicate is
set. in_update_expense can renumber, refusing a number held by another expense. Expense list rows
carry state (active / archived / deleted) and documents_count.
Safe mode and a deny list. INVOICE_NINJA_SAFE_MODE=true keeps writes on but leaves out
in_invoice_action, in_quote_action and in_create_payment, and narrows in_task_action to
archive and restore: the model prepares drafts, clients, expenses, tasks and time entries, and
people send, settle, cancel and delete in Invoice Ninja. INVOICE_NINJA_DISABLED_TOOLS names
further tools to leave out, comma-separated. in_ping reports safe_mode next to writes_enabled,
and the token's company (company: {id, name}) where the instance tells.
Time tracking
Invoice Ninja tracks work time through Tasks (a task is a time entry billed at an hourly rate), optionally grouped under Projects. This server exposes the full loop:
Live timer:
in_start_taskappends an open entry;in_stop_taskcloses it. A task with an open entry is running.After the fact:
in_log_timeappends a completed session — passstart+end, orstart+duration_minutes.Seed on creation:
in_create_taskcan taketime_entriesup front.Bill it:
in_task_actionwithaction: "invoice"turns tracked time into an invoice line item.
Read tools decode the raw time_log for you and add tracked_seconds,
tracked_hms (e.g. "1h 30m") and a running flag. Internally, time_log is a
JSON string of [start_epoch, end_epoch] pairs with end = 0 meaning still
running — the server handles that encoding, you work in plain timestamps.
Note: starting/stopping/logging time are writes, so they require
INVOICE_NINJA_ALLOW_WRITES=true.
Setup
npm install
cp .env.example .env # fill in INVOICE_NINJA_URL + INVOICE_NINJA_TOKEN
npm run buildGet the token in Invoice Ninja under Settings → Account Management →
Integrations → API Tokens. INVOICE_NINJA_URL is the bare instance URL — do
not append /api/v1 (it's added for you).
Claude Desktop (stdio)
claude_desktop_config.json:
{
"mcpServers": {
"invoiceninja": {
"command": "node",
"args": ["/abs/path/to/invoiceninja-mcp/dist/index.js"],
"env": {
"INVOICE_NINJA_URL": "https://invoicing.example.ch",
"INVOICE_NINJA_TOKEN": "your-company-token",
"INVOICE_NINJA_ALLOW_WRITES": "false"
}
}
}
}Claude Code
claude mcp add invoiceninja -- node /abs/path/to/invoiceninja-mcp/dist/index.js(set the env vars in the shell or via --env flags)
Container
docker build -t invoiceninja-mcp .
docker run --rm -p 8787:8787 -e HOST=0.0.0.0 -e INVOICE_NINJA_URL=https://invoicing.example.ch \
-e INVOICE_NINJA_TOKEN=... -e INVOICE_NINJA_ALLOW_WRITES=true -e INVOICE_NINJA_SAFE_MODE=true \
-e MCP_BEARER_TOKEN=... invoiceninja-mcpThe image runs node dist/http.js as a non-root user (UID 10001), writes nothing to disk (run it with
a read-only root filesystem) and answers /healthz. CI publishes ghcr.io/tetra-2023/invoiceninja-mcp
with the tags main and sha-<7> from every merge to main, after a container smoke test; pin the digest.
Remote (streamable HTTP, self-hosted)
MCP_BEARER_TOKEN="$(openssl rand -hex 32)" npm run start:httpListens on 127.0.0.1:8787/mcp with /healthz for probes. Terminate TLS at your
proxy. Caddy example:
invoicing-mcp.example.ch {
reverse_proxy 127.0.0.1:8787
}Always set MCP_BEARER_TOKEN for remote exposure — clients send
Authorization: Bearer <token>.
Safety model
Writes are off by default. Read-only is the safe baseline.
The Invoice Ninja address and token come only from the environment; request headers never change the configuration.
No tool reads the server's filesystem (there is no document-upload tool).
Over HTTP, the server refuses to start without
MCP_BEARER_TOKENunless it listens on the loopback; the bearer is compared in constant time.Write tools carry
destructiveHintannotations so the host can prompt before executing lifecycle actions.Reminder: updating a client requires resending the full
contactsarray (with each contactid) — Invoice Ninja replaces contacts wholesale. Thein_update_clientdescription states this; honour it or you'll drop contacts.
Configuration reference
Env var | Default | Purpose |
| — (required) | Instance base URL, no |
| — (required) | Company API token |
| — | Optional |
|
| Enable mutating tools |
|
| With writes on, leave out sending, settling, cancelling, deleting and payments |
| — | Tool names never registered, comma-separated |
|
| Cap on rows per list call |
|
| Per-request timeout |
|
| HTTP transport bind |
| — | Bearer auth for HTTP transport; required unless |
Alternative: bake it into Laravel
Since Invoice Ninja is itself Laravel and laravel/mcp now exists, you could
instead expose these tools from a Laravel control plane and reuse Invoice Ninja's
own models/policies. That couples you to the IN codebase and its release cadence.
This standalone server stays decoupled and works against hosted or self-hosted
instances alike — generally the better choice unless you're already extending IN
in-process.
Roadmap
Recurring invoices + subscriptions
Per-project time & budget reporting (hours logged vs budgeted_hours)
Tax-period reporting tool (quarterly VAT)
outputSchemaon tools for structured-content clients
Origin & Acknowledgments
This repository began as a copy of halviclabs/invoiceninja-mcp at commit 6e51f1d (v0.3.0, 2026-11-04), MIT License, Copyright (c) 2026 Halvic Labs. All credit for the Invoice Ninja API mapping, the tools, the safe mode and the stateless HTTP transport belongs to that project.
This fork is disconnected from upstream. It is deployed by TETRA as a single-instance server behind an MCP gateway and differs from upstream on purpose:
configuration from the environment only (the per-request
X-Invoice-Ninja-*credential headers andINVOICE_NINJA_REQUIRE_REQUEST_CREDENTIALSare removed);no
in_upload_documenttool;bearer required off the loopback, compared in constant time;
image published to
ghcr.io/tetra-2023/invoiceninja-mcpby this repo's CI.
Upstream changes are picked up manually when needed.
License
MIT (see LICENSE).
Original author
Built by Halvic Labs — a Swiss AI-engineering workshop. More on building MCP servers: Write your first MCP server.
MIT licensed.
Available Tools
17 toolsin_get_clientGet clientARead-only
Fetch a single client by id, including its contacts and (optionally) related records.
Inputs: id (required), include.
in_get_expenseGet expenseARead-only
Fetch a single expense by id: every field, its record state (active/archived/deleted) and its attached documents.
Inputs: id (required), include.
in_get_invoiceGet invoiceARead-only
Fetch a full invoice by id, including line items and the client relationship.
Inputs: id (required), include.
in_get_quoteGet quoteARead-only
Fetch a full quote by id, including line items and the client relationship.
Inputs: id (required), include.
in_get_taskGet taskBRead-only
Fetch a single task with full decoded time entries, total tracked time, and running state.
Inputs: id (required), include.
in_list_clientsList clientsCRead-only
List clients with optional search.
Inputs: page, sort, filter, status, +1 more.
in_list_expense_categoriesList expense categoriesCRead-only
List expense categories.
Inputs: page, sort, filter, status, +1 more.
in_list_expensesList expensesARead-only
List expenses. filter is a free-text search across number, amount, notes and vendor/category/client names: compare number exactly yourself. Each row carries state (active/archived/deleted) and documents_count; status=all mixes the three states.
Inputs: page, sort, filter, status, +1 more.
in_list_invoicesList invoicesBRead-only
List invoices. Use flags to narrow: client_id, client_status (draft|sent|paid|unpaid|overdue), overdue, payable, upcoming, number.
Inputs: page, sort, filter, number, +7 more.
in_list_paymentsList paymentsCRead-only
List payments with optional search/client filter.
Inputs: page, sort, filter, status, +2 more.
in_list_productsList productsCRead-only
List products / catalogue items.
Inputs: page, sort, filter, status, +1 more.
in_list_projectsList projectsCRead-only
List projects (groupings for tasks). Filter by client_id.
Inputs: page, sort, filter, status, +2 more.
in_list_quotesList quotesCRead-only
List quotes with optional search.
Inputs: page, sort, filter, status, +1 more.
in_list_tasksList tasks (time entries)BRead-only
List time-tracking tasks. Filter by client_id, project_id, or client_status (invoiced|uninvoiced). Each row includes decoded tracked time and whether it is currently running.
Inputs: page, sort, filter, status, +4 more.
in_list_vendorsList vendorsBRead-only
List vendors (expense counterparties) with optional search.
Inputs: page, sort, filter, status, +1 more.
in_outstanding_summaryAccounts-receivable summaryBRead-only
Aggregate open receivables: totals for outstanding balance and overdue balance, plus the top debtors. Computed from payable/overdue invoice listings.
Inputs: top.
in_pingTest connectionARead-only
Verify the Invoice Ninja URL, token and reachability. Returns ok + a sample row count.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Each tool pairs a distinct resource with a clear list/get action, so list_expenses vs get_expense etc. are easy to separate. The only mild overlap is in_outstanding_summary versus in_list_invoices with payable/overdue flags, since the summary is derived from those listings, but the descriptions make the boundary clear.
Every tool follows the same in_<verb>_<noun> snake_case pattern (in_list_*, in_get_*, in_ping, in_outstanding_summary) with a uniform server prefix. No camelCase or verb-style mixing anywhere in the set.
17 tools is slightly above the ideal 3-15 band, but the server spans many distinct resources (expenses, invoices, quotes, clients, vendors, tasks, projects, products, payments), so each tool earns its place. A few list-only entries could arguably be consolidated, but nothing feels redundant.
The surface is entirely read-only: there is no create, update, archive, or delete for any resource, and no way to record payments or mutate invoices/tasks/expenses in an invoice-management domain. It is also asymmetric—get exists for invoices, quotes, tasks, clients and expenses but not for vendors, products, payments, or projects—leaving agents with dead ends when they need details on those records.
Maintenance
Related MCP Connectors
Manage Invoice Ninja clients, invoices, quotes, expenses, tasks and projects.
Invoice Ninja MCP server for ChatGPT, Claude and any AI agent: create invoice, send invoice, create quote, record payment and list overdue invoices in your own Invoice Ninja account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Invoice Ninja yourself; Cotlet does not store your password and you need no Invoice Ninja API key. About the official Invoice Ninja API: Yes, Invoice Ninja has a full REST API (checked 14 Oct 2026): invoices, quotes, clients, payments, products and more, authenticated with an API token you create in Settings. REST API access comes with the Ninja Pro, Enterprise and Premium plans, and the Free plan has none. Setup and FAQ: https://cotlet.dev/integrations/invoice-ninja-api-mcp-server
Free hosted MCP for invoices, estimates, clients, items and PDFs. OAuth authorization required.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server for Invoice Ninja v5 API. Enables AI assistants to manage clients, invoices, quotes, payments, and time tracking through natural language.3220 npm2MIT
- FlicenseNot gradedqualityCmaintenanceHosted MCP server that enables AI assistants to manage clients, invoices, and expenses via the Invox API, supporting actions like drafting, sending, cancelling, and marking invoices as paid, as well as logging expenses and updating client information.-
- AlicenseBqualityBmaintenanceEnables managing invoices, estimates, customers, and dashboard/account data in a self-hosted invoicing system through 23 MCP tools, while automatically handling undocumented required API fields on writes.23MIT
- AlicenseAqualityCmaintenanceEnables LLM agents and MCP clients to interact with the Blesta billing API. It provides read-only tools for searching clients, invoices, services, transactions, and payment accounts, plus optional write tools for creating invoices, managing services, recording payments, and generating customer-facing payment links.33GPL 3.0