Skip to main content
Glama

billy-mcp — Billy (billy.dk) MCP Server for Claude & AI Assistants

Connect Claude, Cursor, VS Code, and any MCP-compatible AI assistant to Billy — the Danish accounting platform (billysbilling). Create invoices, book journal entries, check account balances, reconcile bank lines, and attach receipts — with built-in human-approval write protection so your AI never books anything without your sign-off.

npm version license: MIT MCP

Billy accounting · Billy.dk API · Danish bookkeeping (bogføring/regnskab) · AI bookkeeping agent · Model Context Protocol server · Claude Desktop integration

What can it do?

Ask your AI assistant things like:

  • "Create an invoice for Acme ApS: 10 consulting hours at 1.200 DKK, due in 14 days"

  • "What's the balance of account 5211 this quarter?" (trial balance from live postings)

  • "Book last month's payroll as a journal entry — draft it, I'll approve"

  • "Void these 34 duplicate entries" (one call, one approval, per-item results)

  • "Upload this receipt PDF and attach it to journal entry #67"

  • "Which invoices are overdue and unpaid?"

40 tools covering invoices, supplier bills, contacts, products, bank payments, manual journal entries (daybook transactions), postings, trial balance, bank reconciliation, file attachments, a sandboxed batch-scripting tool, and a raw API escape hatch for everything else.

Related MCP server: @cynco/mcp

Quick start

1. Get a Billy access token

Log into mit.billy.dk → Settings → Access tokens → Create access token. Tokens are per-company and don't expire.

2. Add to your MCP client

Claude Desktop (claude_desktop_config.json) / Cursor / any JSON-config host:

{
  "mcpServers": {
    "billy": {
      "command": "npx",
      "args": ["-y", "billy-mcp"],
      "env": {
        "BILLY_ACCESS_TOKEN": "<your token>"
      }
    }
  }
}

Claude Code (CLI):

claude mcp add billy -e BILLY_ACCESS_TOKEN=<your token> -- npx -y billy-mcp

VS Code (.vscode/mcp.json):

{
  "servers": {
    "billy": {
      "command": "npx",
      "args": ["-y", "billy-mcp"],
      "env": { "BILLY_ACCESS_TOKEN": "${input:billy-token}" }
    }
  }
}

That's it — no clone, no build. npx fetches the published package.

From source (development)

git clone https://github.com/thourum/billy-mcp.git
cd billy-mcp
npm install
cp .env.example .env      # paste your token
npm run dev               # run over stdio
npm run inspector         # try tools in the MCP Inspector UI

Write protection — safe for real financial data

Every write (create/update/approve/void/pay/upload) is gated by BILLY_WRITE_MODE:

Mode

Behavior

read-only

Write tools are not registered at all; raw requests reject non-GET

confirm (default)

Each write pauses and shows you a native approval dialog (MCP elicitation) with the full payload — the AI cannot approve its own writes

full

Writes execute without approval

Fail-closed: if your MCP host doesn't support elicitation dialogs, confirm mode blocks writes with instructions instead of executing them. Irreversible operations (approve invoice, void entry, bank payments) are additionally flagged destructiveHint so hosts can add their own guardrails. Declining, dismissing, or leaving the checkbox unticked = nothing is booked.

Environment variables

Variable

Required

Description

BILLY_ACCESS_TOKEN

yes

Billy API access token (sent as X-Access-Token)

BILLY_WRITE_MODE

no

read-only, confirm (default), or full

BILLY_ORGANIZATION_ID

no

Auto-resolved when the token maps to one company

BILLY_BASE_URL

no

Defaults to https://api.billysbilling.com/v2

BILLY_LOCALE

no

en_US, da_DK, fr_FR, nl_NL, de_DE

Tools

Organization & contacts — get_organization, list_contacts, get_contact, create_contact, update_contact, list_contact_persons, create_contact_person

Products — list_products, get_product, create_product, update_product

Invoices — list_invoices, get_invoice, create_invoice (embedded lines, draft or approve-immediately), approve_invoice, delete_invoice

Bills (expenses) — list_bills, get_bill, create_bill

Payments — create_bank_payment (mark invoices/bills paid), list_bank_payments, list_balance_modifiers

Journal entries (daybook) — create_daybook_transaction (client-side debit/credit balance validation + idempotency-key safe retry), void_daybook_transaction, batch_void_daybook_transactions (N voids, one approval), list_daybook_transactions, list_daybooks

Reporting & reconciliation — get_account_balances (trial balance / per-account balance from postings), list_postings, list_transactions, list_accounts, get_account, list_bank_lines, list_bank_line_matches

Files & attachments — upload_file (pdf/jpg/png/gif), attach_file (link to invoice/bill/journal entry), list_files, list_attachments

Power tools — execute_script (sandboxed JS batch runner with server-enforced mutation log + dry_run), billy_raw_request (any Billy v2 endpoint)

Built for LLM agents, not just humans

  • Compact responses by default (~90% fewer tokens); pass verbose: true for full payloads

  • appliedFilters transparency: Billy silently ignores unknown query params — every list tool reports which filters ran server-side vs client-side, so the agent never mistakes "filter ignored" for "no results"

  • Pre-flight validation: imbalanced journal entries are rejected client-side with per-currency debit/credit totals before an approval is ever requested

  • Idempotent retries: idempotencyKey on journal entries dedupes safely after timeouts

  • Batch with one approval: execute_script runs loops (e.g. 34 voids) with a full audit log returned even when the script fails mid-run

FAQ

Is this an official Billy integration? No — community project using Billy's public REST API v2.

Does it work with Billy's free plan? Yes, any account that can create access tokens at mit.billy.dk.

Can the AI spend my money? In default confirm mode, no write happens without you clicking approve in a dialog the model can't touch. Use read-only for pure analysis sessions.

Which AI apps are supported? Anything speaking Model Context Protocol over stdio: Claude Desktop, Claude Code, Cursor, Windsurf, VS Code (GitHub Copilot), Zed, and more.

Development

npm run typecheck   # tsc --noEmit
npm run build       # compile to dist/
npm run inspector   # interactive tool testing

Stack: TypeScript, MCP TypeScript SDK v2, Zod v4 schemas. Billy API reference mirrored in docs/billy-api.md.

License

MIT


Keywords: Billy MCP server, billy.dk API, billysbilling integration, Danish accounting AI, bogføring automatisering, regnskab AI, Claude accounting, MCP accounting server, AI bookkeeping Denmark, fakturering API.

Available Tools

40 tools
approve_invoiceA
Destructive

Approve a draft Billy invoice (draft -> approved is the only allowed state change). Approval books the invoice; it cannot be reverted to draft.

Inputs: id (required), verbose.

attach_fileA

Attach an uploaded file to a Billy record (daybook transaction, invoice, or bill). Get the fileId from upload_file or list_files. Example: attach a receipt to journal entry #67 → ownerType 'daybookTransaction', ownerId ''.

Inputs: fileId (required), ownerId (required), ownerType (required), verbose, +1 more.

batch_void_daybook_transactionsA
Destructive

Void many daybook transactions in one call with ONE user approval for the whole batch. Continues past individual failures and reports per-id results. Irreversible.

Inputs: ids (required), verbose.

billy_raw_requestA
Destructive

Escape hatch: call any Billy API v2 endpoint not covered by a dedicated tool. Examples: GET /currencies, /countries, /taxRates, /salesTaxReturns, /invoiceReminders, /files, /bankLines, /postings, /users. Write requests must wrap the body in a singular resource key, e.g. { "daybookTransaction": {...} }. WARNING: POST/PUT/DELETE have real accounting effects — prefer dedicated tools when available. Non-GET methods require BILLY_WRITE_MODE=confirm (user approval) or full; in read-only mode only GET is allowed. CAUTION: Billy SILENTLY IGNORES undocumented query params (no error, just unfiltered results) — cross-check filters against docs/billy-api.md before relying on them.

Inputs: path (required), body, query, method, +1 more.

create_bank_paymentA
Destructive

Record a bank payment in Billy to mark an invoice or bill as (partially) paid. Creates a bankPayment associated with the subject via 'invoice:' or 'bill:'. For invoices money is deposited (debit); for bills it is withdrawn (credit). WARNING: this posts a real accounting transaction.

Inputs: entryDate (required), subjectId (required), cashAmount (required), subjectType (required), +7 more.

create_billA

Create a supplier bill (expense) in Billy with one or more lines coded to expense accounts. Created as draft by default; pass state=approved to book it immediately.

Inputs: lines (required), contactId (required), entryDate (required), state, +6 more.

create_contactB

Create a new contact (customer or supplier) in Billy. Returns the created contact including its ID.

Inputs: name (required), countryId (required), type, email, +11 more.

create_contact_personA

Add a contact person (name and/or email) to an existing Billy contact. Emails are used to mail invoices.

Inputs: contactId (required), name, email, verbose, +1 more.

create_daybook_transactionA

Create a manual journal entry (daybook transaction) in Billy with balanced debit/credit lines. Validates balance client-side before asking for approval. Supports safe-retry deduplication via idempotencyKey. Created as draft by default; state=approved books it immediately.

Inputs: lines (required), entryDate (required), state, verbose, +6 more.

create_invoiceA

Create an invoice (or credit note) in Billy with one or more lines. Created as draft by default; pass state=approved to approve immediately (approval assigns the invoice number and books it). Amounts are in the invoice currency.

Inputs: lines (required), contactId (required), entryDate (required), currencyId (required), +8 more.

create_productA

Create a product in Billy, optionally with per-currency unit prices. Returns the created product including its ID.

Inputs: name (required), prices, verbose, accountId, +3 more.

delete_invoiceA
Destructive

Delete a Billy invoice (drafts only; approved invoices must be voided/credited instead). Returns meta.deletedRecords.

Inputs: id (required), verbose.

execute_scriptA
Destructive

Run a short JavaScript (ES2022, top-level await allowed) batch script against the Billy API — use for loops, aggregation and reconciliation instead of many single tool calls (e.g. void 30 entries, post 7 monthly journals, sum postings). In scope: billy (get(path,query?), post(path,body), put(path,body), del(path), request(method,path,{body,query}), fetchAll(path,resourceKey,query?,maxRecords?) [GET-only], getOrganizationId()) and console.log. Return a value or log results. Safety: every mutating HTTP call is logged server-side and the mutation log is ALWAYS returned, even if the script throws; dry_run=true simulates writes without executing them (and skips the approval prompt); in read-only mode non-GET calls are blocked; in confirm mode ONE user approval is requested upfront showing the full script. Limits: default 30s timeout, 50 API calls per run, output capped. Billy gotchas: POST/PUT bodies need singular-key wrapping ({ daybookTransaction: {...} }); Billy silently ignores undocumented query filters; use apiType as idempotency key on daybook transactions.

Inputs: script (required), dry_run, timeout_ms, max_api_calls.

get_accountA
Read-only

Get a single account from the Billy chart of accounts by ID.

Inputs: id (required).

get_account_balancesA
Read-only

Account balances / trial balance computed from postings. Ask "what is the balance of account 5211" → accountNos: ["5211"]. Omit account filters for a full trial balance. Bound with minEntryDate/maxEntryDate for speed — the tool fetches and aggregates all matching postings server-side.

Inputs: accountIds, accountNos, maxEntryDate, minEntryDate, +2 more.

get_billA
Read-only

Get a single Billy bill by ID, including its lines, balance and paid status.

Inputs: id (required).

get_contactA
Read-only

Get a single Billy contact by its ID, including full address and settings.

Inputs: id (required).

get_invoiceA
Read-only

Get a single Billy invoice by ID, including its lines, balance and paid status.

Inputs: id (required).

get_organizationA
Read-only

Get the Billy organization (company) details: name, base currency, VAT settings, default payment terms, fiscal year, invoice numbering. Call this first to learn the organization ID and base currency used by other tools.

Inputs: id.

get_productA
Read-only

Get a single Billy product by ID, plus its per-currency prices.

Inputs: id (required).

list_accountsA
Read-only

List the chart of accounts in Billy. Use this to find account IDs for bill lines, product revenue accounts, and bank accounts for payments (look for isPaymentEnabled/isBankAccount).

Inputs: q, page, verbose, pageSize, +4 more.

list_attachmentsA
Read-only

List attachments (file↔record links). Filter by owner to see what's attached to a specific record; ownerReference is applied client-side within the page.

Inputs: page, verbose, pageSize, ownerReference.

list_balance_modifiersA
Read-only

List balance modifiers (payment associations) in Billy. Filter by subjectReference like 'invoice:' or 'bill:' to see which payments settled a specific invoice or bill. NOTE: subjectReference is not documented server-side; it is also enforced client-side within the fetched page.

Inputs: page, verbose, pageSize, subjectReference.

list_bank_line_matchesA
Read-only

List bank line matches (bank reconciliation groupings). isApproved filter applied client-side within the page.

Inputs: page, verbose, pageSize, accountId, +1 more.

list_bank_linesA
Read-only

List imported bank lines. Date and matched filters are applied client-side within the fetched page.

Inputs: page, matched, verbose, pageSize, +3 more.

list_bank_paymentsA
Read-only

List bank payments recorded in Billy. Useful to review what payments exist for reconciliation. NOTE: Billy only supports organizationId server-side for this endpoint; contactId/cashAccountId/date filters are applied client-side within the fetched page.

Inputs: page, verbose, pageSize, contactId, +3 more.

list_billsA
Read-only

List supplier bills (expenses) in Billy with filters for supplier, state, paid status, date range and free-text search.

Inputs: q, page, state, isPaid, +10 more.

list_contact_personsB
Read-only

List contact persons (names/emails used for sending invoices) belonging to a Billy contact.

Inputs: contactId (required), page, verbose, pageSize.

list_contactsA
Read-only

List contacts (customers and suppliers) in Billy. Supports free-text search and filtering. Use this to find a contact ID before creating invoices or bills.

Inputs: q, page, phone, verbose, +5 more.

list_daybooksA
Read-only

List daybooks in Billy. Find the daybook ID used for manual journal entries.

Inputs: page, verbose, pageSize.

list_daybook_transactionsA
Read-only

List daybook transactions (manual journal entries) in Billy, filterable by state and entry date range.

Inputs: q, page, state, pageSize, +4 more.

list_filesA
Read-only

List files uploaded to Billy (receipts, invoices PDFs, etc.). Files are append-only via the API.

Inputs: page, verbose, pageSize.

list_invoicesA
Read-only

List invoices in Billy with filters for customer, state, date range and free-text search. Returns invoices plus meta.paging.

Inputs: q, page, state, isPaid, +8 more.

list_postingsA
Read-only

List ledger postings (individual debit/credit entries). For balances/aggregates use get_account_balances instead. Date/void/text filters are applied client-side within the fetched page — narrow with accountId.

Inputs: page, text, verbose, isVoided, +4 more.

list_productsA
Read-only

List products in Billy. Use this to find a product ID before creating invoice lines. Supports free-text search.

Inputs: q, page, verbose, pageSize, +2 more.

list_transactionsA
Read-only

List booked transactions. transactionNo/voucherNo filters are applied CLIENT-SIDE (Billy silently ignores them as query params) by scanning up to 5000 records — bound with dates when possible.

Inputs: page, verbose, isVoided, pageSize, +4 more.

update_contactA

Update an existing Billy contact. Only provided fields are changed.

Inputs: id (required), name, type, phone, +10 more.

update_productA

Update an existing Billy product. Only provided fields are changed. Providing prices replaces all existing prices.

Inputs: id (required), name, prices, verbose, +5 more.

upload_fileA
Destructive

Upload a local file (pdf/jpg/jpeg/png/gif ONLY — Billy rejects other types with a 422) to Billy and get its file ID. Files are append-only: they cannot be deleted or modified via the API afterwards. Use attach_file to link the uploaded file to a record.

Inputs: path (required), verbose, fileName.

void_daybook_transactionA
Destructive

Void a daybook transaction (journal entry) in Billy. Irreversible — voided entries cannot be reinstated.

Inputs: id (required), verbose.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 40 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is potential confusion between list_daybook_transactions, list_transactions, and list_postings, which all deal with accounting entries. The descriptions help, but an agent might struggle to pick the right one.

    Naming Consistency4/5

    Tool names predominantly follow a verb_noun pattern (e.g., create_invoice, list_contacts). However, billy_raw_request and execute_script break the convention, and the mix of 'list_' and 'get_' for single vs. multiple items is consistent.

    Tool Count3/5

    40 tools is a large number for a server focused on a single accounting application. While each tool serves a specific purpose, the count is on the high end, potentially overwhelming for an agent.

    Completeness4/5

    The tool surface covers core accounting workflows (contacts, invoices, bills, payments, journal entries, files). Notable gaps like sales tax returns or inventory are absent, but the raw_request tool provides an escape hatch.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      C
      maintenance
      Enables AI assistants to manage invoices, contacts, purchases, journal entries, and other accounting operations via the Fiken API.
      100
      20 npm
      8
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to read and write Cynco accounting data, including querying books, creating invoices, reconciling transactions, and generating financial reports.
      1
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables AI assistants to query and manage self-hosted accounting data—invoices, balances, and books—through natural language, with read-only tools by default and optional scoped write operations.
      30
      2
      AGPL 3.0