MCP (Model Context Protocol) server for Invoice Ninja v5 API. Enables AI assistants like Claude to manage clients, invoices, quotes, payments, and time tracking through natural language.
Note: This is a community-developed project and is not officially affiliated with or endorsed by Invoice Ninja. Use at your own discretion.
Model Context Protocol (MCP) is an open standard that allows AI models to securely interact with external tools and data sources. This server implements MCP to provide Invoice Ninja functionality to any compatible AI client.
This MCP server works with any MCP-compatible client:
| Client | Status |
|---|---|
| Claude Code (CLI) | ✅ Tested |
| Claude Desktop | ✅ Supported |
| Cursor | ✅ Supported |
| Windsurf | ✅ Supported |
| Cline (VS Code) | ✅ Supported |
| Any MCP client | ✅ Supported |
list_clients- List all clients with pagination and searchget_client- Get detailed client informationcreate_client- Create new clients with contactssearch_clients- Search clients by name or emaildelete_client- Delete a client
list_invoices- List invoices with filters (status, client)get_invoice- Get invoice detailscreate_invoice- Create invoices with line itemssend_invoice_email- Email invoice to clientmark_invoice_sent- Mark as sent without emailingmark_invoice_paid- Record paymentdelete_invoice- Delete an invoice
list_quotes- List quotes with filtersget_quote- Get quote detailscreate_quote- Create quotes/estimatessend_quote_email- Email quote to clientapprove_quote- Mark quote as approvedconvert_quote_to_invoice- Convert to invoicedelete_quote- Delete a quote
list_tasks- List tasks with filtersget_task- Get task detailscreate_task- Create time tracking tasksupdate_task- Update task detailsstart_task- Start task timerstop_task- Stop task timerlog_task_time- Log time manuallydelete_task- Delete a task
list_products- List products/servicescreate_product- Create a productlist_payments- List paymentsget_payment- Get payment details
test_connection- Test API connectivity and get company info
No installation required. Configure your MCP client to run:
npx invoiceninja-mcpnpm install -g invoiceninja-mcpgit clone https://github.com/ambaloo/invoiceninja-mcp.git
cd invoiceninja-mcp
npm install
npm run build- Log into your Invoice Ninja instance
- Go to Settings → Account Management → API Tokens
- Click Add Token
- Copy the generated token
| Variable | Required | Description |
|---|---|---|
INVOICE_NINJA_URL |
Yes | Your Invoice Ninja instance URL (e.g., https://invoicing.example.com) |
INVOICE_NINJA_TOKEN |
Yes | API token from Invoice Ninja |
INVOICE_NINJA_COMPANY_ID |
No | Company ID for multi-company setups |
Add to your ~/.config/claude-code/mcp.json (Linux/macOS) or %APPDATA%\claude-code\mcp.json (Windows):
{
"mcpServers": {
"invoiceninja": {
"command": "npx",
"args": ["invoiceninja-mcp"],
"env": {
"INVOICE_NINJA_URL": "https://your-invoiceninja-instance.com",
"INVOICE_NINJA_TOKEN": "your-api-token"
}
}
}
}Add to your project's .mcp.json:
{
"mcpServers": {
"invoiceninja": {
"command": "npx",
"args": ["invoiceninja-mcp"],
"env": {
"INVOICE_NINJA_URL": "https://your-invoiceninja-instance.com",
"INVOICE_NINJA_TOKEN": "your-api-token"
}
}
}
}If you have multiple companies in Invoice Ninja, specify the company ID:
{
"mcpServers": {
"invoiceninja": {
"command": "npx",
"args": ["invoiceninja-mcp"],
"env": {
"INVOICE_NINJA_URL": "https://your-invoiceninja-instance.com",
"INVOICE_NINJA_TOKEN": "your-api-token",
"INVOICE_NINJA_COMPANY_ID": "company-hash-id"
}
}
}
}Once configured, you can interact with Invoice Ninja using natural language:
"Create a client named Acme Corp with email john@acme.com"
→ Creates client with contact
"Search for clients named Smith"
→ Returns matching clients
"Show me all my clients"
→ Lists all clients
"Create an invoice for Acme Corp:
- Web Development: $2000
- Monthly Hosting: $150"
→ Creates invoice with line items
"Send invoice #INV-0001 to the client"
→ Emails the invoice
"Mark invoice #INV-0001 as paid"
→ Records payment
"Create a quote for Acme Corp:
- Project Setup: $500
- Development: $3000
Valid until end of month"
→ Creates quote with expiry date
"Convert quote #Q-0001 to an invoice"
→ Creates invoice from quote
"Create a task for Acme Corp: Website Development"
→ Creates task
"Start the timer on task #1"
→ Starts tracking time
"Stop the timer on task #1"
→ Stops and logs time
"Log 2.5 hours to task #1 for yesterday"
→ Manually logs time
# Clone the repository
git clone https://github.com/ambaloo/invoiceninja-mcp.git
cd invoiceninja-mcp
# Install dependencies
npm install
# Build
npm run build
# Run in development mode (with tsx)
npm run dev
# Run the built version
npm startinvoiceninja-mcp/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── client.ts # Invoice Ninja API client
│ ├── schemas/
│ │ └── common.ts # Shared Zod schemas
│ └── tools/
│ ├── clients.ts # Client management tools
│ ├── invoices.ts # Invoice tools
│ ├── quotes.ts # Quote tools
│ ├── payments.ts # Payment & product tools
│ └── tasks.ts # Time tracking tools
├── build/ # Compiled JavaScript
├── package.json
├── tsconfig.json
└── README.md
This server uses the Invoice Ninja API v5. Key implementation details:
- Authentication via
X-API-TOKENheader X-Requested-With: XMLHttpRequestheader required- Multi-company support via
X-API-Company-Idheader - All IDs are hashed strings (not integers)
- Verify your API token is correct
- Check that the token has the necessary permissions
- Ensure
INVOICE_NINJA_URLdoesn't have a trailing slash
- The token may not have access to the requested resource
- For multi-company setups, verify the
INVOICE_NINJA_COMPANY_ID
- Verify
INVOICE_NINJA_URLis correct and accessible - Check if your Invoice Ninja instance is running
- Ensure the configuration file is in the correct location
- Restart your MCP client after configuration changes
- Check that Node.js 18+ is installed
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see LICENSE file for details.
- Invoice Ninja - The invoicing platform
- Model Context Protocol - The MCP standard
- Anthropic - MCP SDK and Claude
Built with Claude Code