Skip to main content
Glama
fortnox-mcp

fortnox-mcp

by Walma-Labs

fortnox-mcp

Open-source MCP server for Fortnox, the Swedish accounting system. Ask Claude, ChatGPT, Cursor or any MCP client about your books in plain language: unpaid invoices, the result for the quarter, what you owe suppliers, cash in the bank.

  • Read-only by default. Write tools are not even registered unless you turn them on.

  • Reports Fortnox has no endpoint for: income statement, balance sheet, receivables and payables ageing, monthly totals per account. Built from one SIE export per financial year, so they match the books exactly.

  • The whole API for reading. 24 curated tools, plus fortnox_get for any of Fortnox's ~140 other read endpoints (assets, contracts, employees, price lists, warehouse…), checked against an allowlist generated from Fortnox's published OpenAPI document. Nothing that sends, prints or deletes is reachable.

  • Drafts, not actions. With writes enabled, the server can create customers, offers, orders and unbooked, unsent invoice drafts. Every write returns a preview first and needs confirm: true. Bookkeeping, payments, sending and deleting stay in Fortnox, with a person.

  • Built for Fortnox's quirks: rotating refresh tokens saved before use, a shared refresh for concurrent calls, requests paced under Fortnox's 25-per-5-seconds limit, CP437 SIE decoding.

Built and maintained by Walma. The setup guide is Fortnox MCP on walma.ai.

Tools

Area

Tools

Company

get_company_info, list_financial_years

Customer invoices

list_invoices, get_invoice, list_invoice_payments

Supplier invoices

list_supplier_invoices, get_supplier_invoice

Registers

list_customers, get_customer, list_suppliers, get_supplier, list_articles, list_orders, list_offers, list_projects, list_cost_centers

Bookkeeping

list_accounts, list_vouchers, get_voucher

Reports

income_statement, balance_sheet, account_totals_by_month, receivables_aging, payables_aging

Everything else (read)

list_endpoints, fortnox_get

Writes (opt-in, drafts)

create_customer, create_invoice_draft, create_offer, create_order

Related MCP server: bokio-mcp

Setup

1. Create a Fortnox app

  1. Sign up as an integration developer at apps.fortnox.se/integration-developer. You get a free test company to try against.

  2. Create an app. Set the redirect URI to http://localhost:8765/callback.

  3. Enable the scopes you need. The default set is companyinformation bookkeeping invoice customer supplierinvoice supplier article payment settings. Each scope also has to be covered by a licence on the Fortnox account that approves it, so ask only for what you use.

  4. Note the client ID and client secret.

2. Connect your company

git clone https://github.com/Walma-Labs/fortnox-mcp.git
cd fortnox-mcp && npm install

FORTNOX_CLIENT_ID=… FORTNOX_CLIENT_SECRET=… node dist/cli.js login

Open the printed URL, sign in to Fortnox and approve. Tokens are saved to ~/.config/fortnox-mcp/tokens.json (mode 600). The server refreshes them on its own; a connection used at least once every 45 days never needs a new login. node dist/cli.js status shows which company is connected.

3. Add it to your client

Claude Code

claude mcp add fortnox \
  -e FORTNOX_CLIENT_ID=… -e FORTNOX_CLIENT_SECRET=… \
  -- node /path/to/fortnox-mcp/dist/cli.js

Claude Desktop / Cursor (claude_desktop_config.json, .cursor/mcp.json)

{
  "mcpServers": {
    "fortnox": {
      "command": "node",
      "args": ["/path/to/fortnox-mcp/dist/cli.js"],
      "env": {
        "FORTNOX_CLIENT_ID": "…",
        "FORTNOX_CLIENT_SECRET": "…"
      }
    }
  }
}

Then ask, for example:

  • Vilka kundfakturor är förfallna, och hos vilka kunder?

  • Show the income statement for Q3 compared with Q2.

  • What did we spend on external services (5000–6999) per month this year?

  • Hur mycket har vi på företagskontot, och vad ska betalas till leverantörer de närmaste två veckorna?

Configuration

Variable

Meaning

FORTNOX_CLIENT_ID, FORTNOX_CLIENT_SECRET

From your app in the Developer Portal

FORTNOX_REDIRECT_URI

Default http://localhost:8765/callback; must match the portal exactly

FORTNOX_SCOPES

Space-separated scopes requested at login (default above)

FORTNOX_ACCOUNT_TYPE

service for a service account (approver must be a system administrator)

FORTNOX_TOKEN_FILE

Default ~/.config/fortnox-mcp/tokens.json

FORTNOX_ACCESS_TOKEN

A ready access token instead of the token file; no refresh

FORTNOX_ENABLE_WRITES

true registers the draft-only write tools

HTTP

node dist/http.js serves streamable HTTP (stateless) on PORT (default 8080). With FORTNOX_TOKEN_FROM_HEADER=true each request carries its own token in X-Fortnox-Access-Token, for hosts that run OAuth per customer. The HTTP server has no authentication of its own: put an authenticating gateway in front of it and never expose it publicly.

Safety model

  • Read tools carry readOnlyHint; write tools are absent unless FORTNOX_ENABLE_WRITES=true.

  • Writes return a dry-run preview of the exact request body. The model is instructed to show it and wait for approval before calling again with confirm: true.

  • A POST is never retried after a server error, since Fortnox may already have created the document.

  • fortnox_get only reaches paths in src/paths.ts, generated from Fortnox's OpenAPI document by scripts/gen-paths.py, minus endpoints that send (email, e-print, e-invoice), return files, or belong to the bank and developer programmes.

  • Tokens never reach the model; error text is scrubbed of anything that looks like a credential.

Your accounting data goes from Fortnox to the MCP client you use and from there to that client's model provider. If that matters (it usually does for bookkeeping), run the client through a gateway with an EU region and a log. That is what Walma AI Hub does.

Development

npm install
npm test        # vitest, no network or credentials needed
npm run build

To refresh the endpoint allowlist after Fortnox changes its API:

curl -sL https://apps.fortnox.se/apidocs -o /tmp/apidocs.html
python3 scripts/gen-paths.py /tmp/apidocs.html > src/paths.ts

Status

Built from Fortnox's API reference and the patterns of Walma's own production Fortnox integration (OAuth, rotating tokens, SIE). The test suite covers the wire protocol, pagination, the allowlist, token rotation and the reports. Not yet verified end to end against a live Fortnox test company; issues and pull requests are welcome.

Not affiliated with or endorsed by Fortnox AB.

License

MIT © Walma AI AB

Available Tools

26 tools
account_totals_by_monthAccount totals by monthA
Read-onlyIdempotent

Monthly net movement for an account range, e.g. 3000–3999 for revenue per month, 5000–6999 for external costs, 7000–7699 for personnel, 1930–1930 for the business account. Revenue accounts (3xxx+) are sign-flipped so income reads positive.

NameRequiredDescriptionDefault
to_dateYes
from_dateYes
account_toYes
account_fromYes
balance_sheetBalance sheet (balansräkning)B
Read-onlyIdempotent

Assets, equity and liabilities on a date, per account, plus the year's result not yet closed to equity. Cash and bank are the 19xx accounts.

NameRequiredDescriptionDefault
dateNoDefault today
fortnox_getRead any Fortnox endpointA
Read-onlyIdempotent

GET a Fortnox API path that matches one of the templates from list_endpoints, with {placeholders} filled in, e.g. /3/assets or /3/employees/12. Read-only: nothing that sends, prints or changes data is reachable.

NameRequiredDescriptionDefault
pathYesConcrete path, e.g. /3/pricelists/A
queryNoQuery parameters, e.g. {"limit": 100}
get_company_infoCompany, financial years and locked periodA
Read-onlyIdempotent

Who the connected Fortnox company is (name, org number, address, VAT number), its financial years, and the locked period (the date through which the books are closed). Call this first to orient.

NameRequiredDescriptionDefault

No parameters

get_customerGet customerB
Read-onlyIdempotent

One customer in full: addresses, terms of payment, VAT type, default references.

NameRequiredDescriptionDefault
customer_numberYes
get_invoiceGet customer invoiceB
Read-onlyIdempotent

One customer invoice in full: rows, Net (excl. VAT), VAT, Balance, due date, references, booked/sent state.

NameRequiredDescriptionDefault
document_numberYes
get_supplierGet supplierB
Read-onlyIdempotent

One supplier in full, including bank details as registered in Fortnox.

NameRequiredDescriptionDefault
supplier_numberYes
get_supplier_invoiceGet supplier invoiceA
Read-onlyIdempotent

One supplier invoice in full, with its accounting rows. given_number is Fortnox's own serial number for it.

NameRequiredDescriptionDefault
given_numberYes
get_voucherGet voucherC
Read-onlyIdempotent

One voucher with its debit/credit rows.

NameRequiredDescriptionDefault
numberYes
seriesYes
financial_yearNo
income_statementIncome statement (resultaträkning)A
Read-onlyIdempotent

Profit and loss for any date range, grouped by BAS account class with per-account lines: revenue, goods, external costs, personnel, depreciation, financial items, tax. Revenue positive, costs negative. Built from the SIE export, so it matches the books exactly, including manual vouchers.

NameRequiredDescriptionDefault
to_dateYes
from_dateYes
list_accountsList accountsB
Read-onlyIdempotent

Chart of accounts (kontoplan) for a financial year, with opening (BalanceBroughtForward) and closing (BalanceCarriedForward) balances.

NameRequiredDescriptionDefault
only_usedNoSkip accounts with zero balances (default true)
financial_yearNoFinancial year id from list_financial_years; default the current year
list_articlesList articlesC
Read-onlyIdempotent

Article (product/service) register with prices and stock.

NameRequiredDescriptionDefault
maxNoMax rows to return (default 100, up to 2000)
filterNo
descriptionNo
list_cost_centersList cost centersC
Read-onlyIdempotent

Cost centers (kostnadsställen).

NameRequiredDescriptionDefault

No parameters

list_customersList customersC
Read-onlyIdempotent

Customer register. Search by name, org number or email.

NameRequiredDescriptionDefault
maxNoMax rows to return (default 100, up to 2000)
nameNo
emailNo
filterNo
organisation_numberNo
list_endpointsList Fortnox read endpointsA
Read-onlyIdempotent

Search the read-only Fortnox endpoints fortnox_get can call (assets, contracts, employees, salary, time, warehouse, price lists, currencies, …). Returns path templates and summaries.

NameRequiredDescriptionDefault
searchNoWord to match in the path or summary, e.g. 'asset', 'salary', 'price'
list_financial_yearsList financial yearsA
Read-onlyIdempotent

All financial years (räkenskapsår) with id and date range. The id is what SIE and voucher calls take.

NameRequiredDescriptionDefault

No parameters

list_invoice_paymentsList customer invoice paymentsB
Read-onlyIdempotent

Payments registered against customer invoices (inbetalningar). Optionally for one invoice.

NameRequiredDescriptionDefault
maxNoMax rows to return (default 100, up to 2000)
invoice_numberNo
list_invoicesList customer invoicesA
Read-onlyIdempotent

Customer invoices (kundfakturor), newest first unless sorted otherwise. Filter by status (unpaid, unpaidoverdue, fullypaid, unbooked, cancelled), invoice date range and customer. Total includes VAT; Balance is the amount still unpaid according to Fortnox.

NameRequiredDescriptionDefault
maxNoMax rows to return (default 100, up to 2000)
filterNo
sort_byNo
to_dateNoInvoice date to (inclusive)
from_dateNoInvoice date from (inclusive)
sort_orderNo
customer_numberNo
list_offersList offersD
Read-onlyIdempotent

Quotes/offers (offerter).

NameRequiredDescriptionDefault
maxNoMax rows to return (default 100, up to 2000)
filterNo
to_dateNo
from_dateNo
customer_numberNo
list_ordersList ordersC
Read-onlyIdempotent

Customer orders. Filter invoicenotcreated shows orders not yet invoiced.

NameRequiredDescriptionDefault
maxNoMax rows to return (default 100, up to 2000)
filterNo
to_dateNo
from_dateNo
customer_numberNo
list_projectsList projectsC
Read-onlyIdempotent

Projects, used to tag invoices, vouchers and costs.

NameRequiredDescriptionDefault
maxNoMax rows to return (default 100, up to 2000)
list_supplier_invoicesList supplier invoicesB
Read-onlyIdempotent

Supplier invoices (leverantörsfakturor). Filter by status (unpaid, unpaidoverdue, fullypaid, unbooked, cancelled, pendingpayment, authorizepending = awaiting attest), date range and supplier.

NameRequiredDescriptionDefault
maxNoMax rows to return (default 100, up to 2000)
filterNo
to_dateNo
from_dateNo
supplier_numberNo
list_suppliersList suppliersC
Read-onlyIdempotent

Supplier register.

NameRequiredDescriptionDefault
maxNoMax rows to return (default 100, up to 2000)
list_vouchersList vouchersA
Read-onlyIdempotent

Vouchers (verifikationer) by date range or series. Rows are not included; use get_voucher for one, or the report tools for totals.

NameRequiredDescriptionDefault
maxNoMax rows to return (default 100, up to 2000)
seriesNoVoucher series, e.g. A
to_dateNo
from_dateNo
financial_yearNo
payables_agingAccounts payable ageing (leverantörsreskontra)B
Read-onlyIdempotent

Unpaid supplier invoices bucketed by days past due, per supplier, with the most overdue.

NameRequiredDescriptionDefault
as_ofNoDefault today
receivables_agingAccounts receivable ageing (kundreskontra)A
Read-onlyIdempotent

Unpaid customer invoices bucketed by days past due (not due, 1–30, 31–60, 61–90, 90+), per customer, with the most overdue invoices.

NameRequiredDescriptionDefault
as_ofNoDefault today

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 26 tool updatesv0.1.0
    • First observedaccount_totals_by_month
    • First observedbalance_sheet
    • First observedfortnox_get
    • First observedget_company_info
    • First observedget_customer
    • First observedget_invoice
    • First observedget_supplier
    • First observedget_supplier_invoice
    • First observedget_voucher
    • First observedincome_statement
    • First observedlist_accounts
    • First observedlist_articles
    • First observedlist_cost_centers
    • First observedlist_customers
    • First observedlist_endpoints
    • First observedlist_financial_years
    • First observedlist_invoice_payments
    • First observedlist_invoices
    • First observedlist_offers
    • First observedlist_orders
    • First observedlist_projects
    • First observedlist_supplier_invoices
    • First observedlist_suppliers
    • First observedlist_vouchers
    • First observedpayables_aging
    • First observedreceivables_aging

TDQS

B3/5.0

Scored across 26 tools

Disambiguation4/5

Most tools target distinct resources or actions, with clear list-vs-get pairs for invoices, suppliers, customers, vouchers, and supplier invoices. The generic list_endpoints/fortnox_get pair overlaps somewhat with the specific list/get tools, which could cause occasional misselection, but descriptions distinguish their intended use.

Naming Consistency4/5

The resource tools consistently use snake_case with list_* for collections and get_* for single records, which is predictable. Report tools use noun phrases such as income_statement and balance_sheet, and fortnox_get uses a provider-prefixed verb-last form, creating minor deviations from the dominant pattern.

Tool Count3/5

26 tools is on the heavy side for an MCP server, and the generic fortnox_get tool means some specific list/get tools could be consolidated. However, the broad Fortnox accounting domain legitimately covers many resources, so most tools have a defensible place.

Completeness4/5

The server provides broad read-only coverage across core accounting resources, including registers, transactions, reports, aging, and a generic read-only endpoint fallback. Some resources lack dedicated get/list tools, but agents can usually work around this via list_endpoints/fortnox_get; write operations are absent but appear intentionally out of scope.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    An MCP server for integrating with the Fortnox Swedish accounting system. Enables LLMs to manage invoices, customers, suppliers, orders, accounts, vouchers, and provides business intelligence analytics.
    51
    68 npm
    47
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables MCP clients to read and write Bokio accounting data for one company through 85 tools covering invoices, customers, suppliers, journal entries, chart of accounts, fiscal years, items, tags, uploads, SIE export, and bank payments.
    40
    96 npm
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Exposes Visma e-conomic REST API as 73 MCP tools for managing customers, suppliers, products, invoices, quotes, orders, accounting, and reference data, with secure authentication, allowlist, read-only mode, and audit logging.
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables MCP-capable clients to read and write directly in epago accounting, including chart of accounts, transactions, invoices, payments, receipts, and tax reports.
    MIT