Fortnox MCP Server
An MCP (Model Context Protocol) server for integrating with the Fortnox Swedish accounting system. This server enables LLMs to interact with Fortnox for managing invoices, customers, suppliers, accounts, and vouchers.
Quick Start (Claude Desktop)
1. Get your Fortnox credentials
- Register at Fortnox Developer Portal
- Create an application to get your Client ID and Client Secret
- Complete the OAuth2 flow to get a Refresh Token
2. Add to Claude Desktop
Open your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Add this configuration:
{
"mcpServers": {
"fortnox": {
"command": "npx",
"args": ["-y", "fortnox-mcp-server"],
"env": {
"FORTNOX_CLIENT_ID": "your-client-id",
"FORTNOX_CLIENT_SECRET": "your-client-secret",
"FORTNOX_REFRESH_TOKEN": "your-refresh-token"
}
}
}
}
3. Restart Claude Desktop
That's it! You can now ask Claude to manage your Fortnox invoices, customers, and more.
Features
Customer Management
fortnox_list_customers- List and search customersfortnox_get_customer- Get customer detailsfortnox_create_customer- Create new customerfortnox_update_customer- Update customerfortnox_delete_customer- Delete customer
Invoice Management
fortnox_list_invoices- List invoices with filteringfortnox_get_invoice- Get invoice details with line itemsfortnox_create_invoice- Create new invoicefortnox_update_invoice- Update draft invoicefortnox_bookkeep_invoice- Bookkeep invoicefortnox_cancel_invoice- Cancel invoicefortnox_credit_invoice- Create credit notefortnox_send_invoice_email- Send invoice by email
Supplier Management
fortnox_list_suppliers- List and search suppliersfortnox_get_supplier- Get supplier detailsfortnox_create_supplier- Create new supplierfortnox_update_supplier- Update supplierfortnox_delete_supplier- Delete supplier
Account Management
fortnox_list_accounts- List chart of accountsfortnox_get_account- Get account detailsfortnox_create_account- Create new accountfortnox_update_account- Update accountfortnox_delete_account- Delete account
Voucher Management
fortnox_list_vouchers- List vouchers (journal entries)fortnox_get_voucher- Get voucher details with rowsfortnox_create_voucher- Create manual voucherfortnox_list_voucher_series- List available voucher series
Company Information
fortnox_get_company_info- Get company details
Installation
Via npx (Recommended)
No installation needed! Just add the config above to Claude Desktop.
Manual Installation
npm install -g fortnox-mcp-server
From Source
git clone https://github.com/jakobwennberg/fortnox-mcp.git
cd fortnox-mcp
npm install
npm run build
Configuration
Environment Variables
| Variable | Required | Description |
|---|---|---|
FORTNOX_CLIENT_ID | Yes | Your Fortnox app client ID |
FORTNOX_CLIENT_SECRET | Yes | Your Fortnox app client secret |
FORTNOX_REFRESH_TOKEN | Yes | OAuth2 refresh token |
FORTNOX_ACCESS_TOKEN | No | Current access token (auto-refreshed) |
TRANSPORT | No | stdio (default) or http |
PORT | No | HTTP port (default: 3000) |
Getting OAuth Credentials
- Register as a developer at Fortnox Developer Portal
- Create a new application to get Client ID and Client Secret
- Complete the OAuth2 authorization flow to obtain a refresh token
- Set the environment variables
Usage
With Claude Desktop
See Quick Start above.
As HTTP Server
TRANSPORT=http PORT=3000 node dist/index.js
Then connect to http://localhost:3000/mcp
Tool Examples
List Unpaid Invoices
{
"tool": "fortnox_list_invoices",
"arguments": {
"filter": "unpaid",
"limit": 20
}
}
Create Invoice
{
"tool": "fortnox_create_invoice",
"arguments": {
"customer_number": "1001",
"rows": [
{
"description": "Consulting services",
"quantity": 10,
"price": 1000
}
]
}
}
Create Voucher
{
"tool": "fortnox_create_voucher",
"arguments": {
"voucher_series": "A",
"description": "Office supplies",
"transaction_date": "2025-01-24",
"rows": [
{ "account_number": 6110, "debit": 500 },
{ "account_number": 1910, "credit": 500 }
]
}
}
Rate Limiting
The Fortnox API allows 25 requests per 5 seconds. This server includes automatic rate limiting to prevent exceeding this limit.
Development
# Run in development mode with auto-reload
npm run dev
# Build for production
npm run build
# Clean build artifacts
npm run clean
Publishing & Distribution
This server is published to multiple registries for easy installation:
| Registry | URL | Purpose |
|---|---|---|
| npm | npmjs.com/package/fortnox-mcp-server | Package distribution via npx |
| MCP Registry | registry.modelcontextprotocol.io | Official MCP server discovery |
| GitHub | github.com/jakobwennberg/fortnox-mcp | Source code |
How It Works
- User adds config to Claude Desktop with
npx fortnox-mcp-server - Claude Desktop starts the server via npx (downloads latest version from npm)
- Server authenticates with Fortnox using OAuth2 credentials from environment variables
- Claude can now use tools like
fortnox_list_invoices,fortnox_create_customer, etc. - Server handles API calls to Fortnox, including automatic token refresh and rate limiting
Releasing New Versions
To release a new version, use the release script:
# Bug fixes (1.0.0 → 1.0.1)
npm run release:patch
# New features (1.0.0 → 1.1.0)
npm run release:minor
# Breaking changes (1.0.0 → 2.0.0)
npm run release:major
The release script automatically:
- Bumps the version in
package.json - Updates
server.jsonfor the MCP Registry - Builds the project
- Commits and tags the release
- Publishes to npm
- Publishes to MCP Registry
- Pushes to GitHub
Prerequisites for releasing:
npm login- Logged into npmmcp-publisher login github- Logged into MCP Registry- Clean git working directory
Users Get Updates Automatically
When you publish a new version, users running npx -y fortnox-mcp-server will automatically get the latest version the next time they restart Claude Desktop.
License
MIT