# fortnox

Wires the Fortnox accounting system into your AI agent: invoices, customers, suppliers, vouchers and reports. Handy when the books live in Fortnox.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 45
- Author: erp-mafia
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/erp-mafia/fortnox-mcp
- Updated: 2026-04-28
- HTML: https://affpapa.org/en/nevibecode/mcp/fortnox

## What it does

The server exposes Fortnox to an agent over MCP. It covers customers and suppliers, invoice creation and editing, credit notes, emailing invoices, sales orders, supplier invoices and the chart of accounts. A separate group of tools handles analytics: invoice totals for a period, top customers by revenue, an unpaid invoice report, cash flow forecasting, a sales funnel from offers to invoices, period comparisons and gross margin trends.

Two modes are available. Remote mode needs only the URL `https://fortnox-mcp.vercel.app/mcp` plus a browser authorization — no credentials of your own. Local mode is for self-hosting and reads `FORTNOX_CLIENT_ID`, `FORTNOX_CLIENT_SECRET` and `FORTNOX_REFRESH_TOKEN` from the Fortnox developer portal. Transport defaults to `stdio`; switch it to `http` and set `PORT` if you prefer.

Local runs go through `npx -y fortnox-mcp-server`. The refresh token matters only for the first start, since it gets persisted afterwards and the access token refreshes on its own. Self-hosting the remote variant means setting `AUTH_MODE=remote`, `SERVER_URL` and `JWT_SECRET` — skip them and the server will not come up.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `FORTNOX_CLIENT_ID`, `FORTNOX_CLIENT_SECRET`, `FORTNOX_REFRESH_TOKEN` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add fortnox -e FORTNOX_CLIENT_ID=<FORTNOX_CLIENT_ID> -e FORTNOX_CLIENT_SECRET=<FORTNOX_CLIENT_SECRET> -e FORTNOX_REFRESH_TOKEN=<FORTNOX_REFRESH_TOKEN> -- npx -y fortnox-mcp-server
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add fortnox --env FORTNOX_CLIENT_ID=<FORTNOX_CLIENT_ID> --env FORTNOX_CLIENT_SECRET=<FORTNOX_CLIENT_SECRET> --env FORTNOX_REFRESH_TOKEN=<FORTNOX_REFRESH_TOKEN> -- npx -y fortnox-mcp-server
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "fortnox": {
            "command": "npx",
            "args": [
                "-y",
                "fortnox-mcp-server"
            ],
            "env": {
                "FORTNOX_CLIENT_ID": "<FORTNOX_CLIENT_ID>",
                "FORTNOX_CLIENT_SECRET": "<FORTNOX_CLIENT_SECRET>",
                "FORTNOX_REFRESH_TOKEN": "<FORTNOX_REFRESH_TOKEN>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "fortnox": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "fortnox-mcp-server"
            ],
            "env": {
                "FORTNOX_CLIENT_ID": "<FORTNOX_CLIENT_ID>",
                "FORTNOX_CLIENT_SECRET": "<FORTNOX_CLIENT_SECRET>",
                "FORTNOX_REFRESH_TOKEN": "<FORTNOX_REFRESH_TOKEN>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e FORTNOX_CLIENT_ID=<FORTNOX_CLIENT_ID> -e FORTNOX_CLIENT_SECRET=<FORTNOX_CLIENT_SECRET> -e FORTNOX_REFRESH_TOKEN=<FORTNOX_REFRESH_TOKEN> fortnox npx -y fortnox-mcp-server
```
Replace <…> with your own values

## When to use it
- raise an invoice and email it to the customer
- list customers with unpaid invoices
- issue a credit note for a wrong invoice
- create a manual voucher against the chart of accounts
- rank top customers by revenue for a quarter

## Example prompts
- Show unpaid invoices from last month
- Create an invoice for a customer and email it
- Compare this year's revenue with last year

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [CCXT](https://affpapa.org/en/nevibecode/mcp/ccxt.md) — MCP server · ★ 44583
- [Finance Toolkit](https://affpapa.org/en/nevibecode/mcp/finance-toolkit.md) — MCP server · ★ 5458
- [EdgarTools](https://affpapa.org/en/nevibecode/mcp/edgartools.md) — MCP server · ★ 2814
- [LetsFG — Flights & Hotels](https://affpapa.org/en/nevibecode/mcp/letsfg-flights-hotels.md) — MCP server · ★ 2188
- [AutoTS](https://affpapa.org/en/nevibecode/mcp/autots.md) — MCP server · ★ 1434

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
