Skip to main content
Glama
freeagent-mcp

freeagent-mcp

by DevGuildLtd

freeagent-mcp

An MCP server for the FreeAgent accounting API (v2). It lets Claude, Cursor or any other MCP client read your FreeAgent data, and optionally change it.

It runs on your own computer over stdio. There is no hosted service and no build step.

Compatibility

Supported

Node.js

24 or newer (runs the TypeScript source directly)

OS

macOS (tested), Linux, Windows

MCP clients

Claude Code, Claude Desktop, Cursor, VS Code, and any other client that runs stdio servers

FreeAgent

Any company account. UK, US and universal companies use the same API. Accountancy Practice API is not supported.

Check your Node version with node -v. Install Node 24 from https://nodejs.org or with nvm install 24.

Related MCP server: FreeAgent MCP Server

1. Create your own FreeAgent app

Every person creates their own app. Do not share a client secret.

  1. Sign in at https://dev.freeagent.com with your FreeAgent login.

  2. Go to My Apps, then Create New App.

  3. Fill in:

    • Name: anything, for example My FreeAgent MCP

    • OAuth Redirect URIs: http://localhost:8765/callback

  4. Save. Copy the OAuth identifier and the secret. FreeAgent shows the secret only once.

To test without real data, also create a sandbox company at https://signup.sandbox.freeagent.com/signup and set FREEAGENT_SANDBOX=1 (see below).

2. Install

git clone https://github.com/DevGuildLtd/freeagent-mcp.git
cd freeagent-mcp
npm ci

3. Save the app credentials

Create ~/.config/freeagent-mcp/app.json:

{
  "clientId": "YOUR_OAUTH_IDENTIFIER",
  "clientSecret": "YOUR_SECRET",
  "redirectUri": "http://localhost:8765/callback"
}

On macOS or Linux, make it private:

chmod 700 ~/.config/freeagent-mcp && chmod 600 ~/.config/freeagent-mcp/app.json

On Windows the folder is %USERPROFILE%\.config\freeagent-mcp.

Instead of the file you can set FREEAGENT_CLIENT_ID and FREEAGENT_CLIENT_SECRET in the client config (see step 4). This works well with a password manager, for example op run from 1Password.

4. Add it to your MCP client

Use the full path to your clone in place of /path/to/freeagent-mcp.

Claude Code

claude mcp add freeagent -s user -- node /path/to/freeagent-mcp/src/index.ts

With writes turned on:

claude mcp add freeagent -s user -e FREEAGENT_ALLOW_WRITES=1 -- node /path/to/freeagent-mcp/src/index.ts

Claude Desktop, Cursor, VS Code and others

Add this to the client's MCP config file. For Claude Desktop that is claude_desktop_config.json (Settings, Developer, Edit Config). For Cursor it is ~/.cursor/mcp.json.

{
  "mcpServers": {
    "freeagent": {
      "command": "node",
      "args": ["/path/to/freeagent-mcp/src/index.ts"],
      "env": {
        "FREEAGENT_ALLOW_WRITES": "0"
      }
    }
  }
}

VS Code uses "servers" in place of "mcpServers" in .vscode/mcp.json.

If the client cannot find node (common with nvm and Claude Desktop), put the full path from which node in command.

5. First use and login

Ask your client something like "list my open FreeAgent invoices".

The first FreeAgent call opens the FreeAgent approval page in your browser. Sign in if you need to and click Approve. The call then goes on. You have 3 minutes. If the browser does not open, the tool error shows the link.

By default the tokens stay in memory only. Nothing goes to disk, and you approve again in each new session. To stay logged in across sessions:

npm run login

and set FREEAGENT_TOKEN_STORE=file in the client config. Tokens then go to ~/.config/freeagent-mcp/tokens.json and refresh on their own. Any program running as your user can read that file.

Tools

Tool

What it does

freeagent_get

GET any v2 endpoint, for example invoices, categories, users/me. Can follow all pages.

freeagent_company

Company details and the signed-in user

freeagent_invoices

Sales invoices, with view and date filters

freeagent_bills

Purchase bills

freeagent_contacts

Clients and suppliers

freeagent_expenses

Expense claims

freeagent_bank_accounts

Bank accounts and balances

freeagent_bank_transactions

Transactions for one bank account

freeagent_report

Profit and loss, balance sheet, trial balance, cashflow

freeagent_write

POST, PUT or DELETE any endpoint. Only when FREEAGENT_ALLOW_WRITES=1.

API reference: https://dev.freeagent.com/docs

Settings

All settings are environment variables.

Variable

Default

Meaning

FREEAGENT_ALLOW_WRITES

off

1 adds the freeagent_write tool

FREEAGENT_TOKEN_STORE

memory

file keeps tokens in tokens.json

FREEAGENT_SANDBOX

off

1 uses api.sandbox.freeagent.com and a separate token file

FREEAGENT_CLIENT_ID, FREEAGENT_CLIENT_SECRET

none

Use these in place of app.json

FREEAGENT_REDIRECT_URI

http://localhost:8765/callback

Must match the app on the developer portal

FREEAGENT_CONFIG_DIR

~/.config/freeagent-mcp

Where app.json and tokens live

FREEAGENT_NO_BROWSER

off

1 stops the browser from opening. Use the link from the error.

Security

  • The server acts as the FreeAgent user who approves it, with that user's full permission level. FreeAgent apps have no scopes. For a safer setup, approve with a FreeAgent user that has a lower permission level.

  • Writes are off by default. With writes on, an agent can create, change and delete records, and some actions cannot be undone, for example filing a VAT return or emailing an invoice.

  • To cut off access, remove the app from your FreeAgent account settings, or revoke the secret on the developer portal.

Troubleshooting

Problem

Fix

Cannot listen on localhost:8765

Another session is waiting for approval, or another program uses the port. Finish that login, or change the port in both the app's redirect URI and FREEAGENT_REDIRECT_URI.

ENOENT ... app.json

Do step 3.

redirect_uri error on the approval page

The redirect URI in app.json must match the one on the developer portal exactly.

node: bad option or syntax error in .ts

Node is older than 24.

HTTP 429

FreeAgent allows 120 requests per minute and 3600 per hour. The server waits and tries again.

Development

npm run typecheck
FREEAGENT_SANDBOX=1 npm start

License

MIT. See LICENSE.

Available Tools

9 tools
freeagent_bank_accountsList bank accountsA
Read-only

List bank accounts with balances.

Inputs: no named parameters.

freeagent_bank_transactionsList bank transactionsB
Read-only

List transactions for one bank account. view: all, unexplained, explained, manual, imported, marked_for_review.

Inputs: bank_account (required), view, to_date, from_date.

freeagent_billsList billsC
Read-only

List purchase bills. view: all, open, overdue, open_or_overdue, paid, recurring, hire_purchase, cis.

Inputs: view, contact, project, to_date, +1 more.

freeagent_companyCompany detailsC
Read-only

Company info and the current user.

Inputs: no named parameters.

freeagent_contactsList contactsB
Read-only

List contacts. view: all, active, clients, suppliers, active_projects, completed_projects, open_clients, open_suppliers, hidden.

Inputs: sort, view.

freeagent_expensesList expensesC
Read-only

List expense claims. view: recent, recurring.

Inputs: view, project, to_date, from_date.

freeagent_getFreeAgent GETA
Read-only

Read any FreeAgent API v2 endpoint. path is relative to /v2, for example invoices, invoices/123, bank_transactions, accounting/profit_and_loss/summary, categories, users/me. Docs: https://dev.freeagent.com/docs. List endpoints return 25 items per page by default; set all_pages to follow pagination.

Inputs: path (required), query, all_pages, max_pages.

freeagent_invoicesList invoicesB
Read-only

List sales invoices. view: all, recent_open_or_overdue, open, overdue, open_or_overdue, draft, paid, scheduled_to_email, thank_you_emails, reminder_emails, last_N_months.

Inputs: view, contact, project, to_date, +2 more.

freeagent_reportAccounting reportA
Read-only

Run a report: profit_and_loss, balance_sheet, trial_balance, cashflow. Dates are optional for most; cashflow needs both.

Inputs: report (required), to_date, from_date, as_at_date, +1 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 9 tools

    Disambiguation2/5

    The generic freeagent_get tool can read any API v2 endpoint, which subsumes the specialized invoice, bill, contact, bank transaction, and expense list tools. freeagent_report also overlaps with freeagent_get for report endpoints, making tool selection ambiguous despite the curated views on the specialized tools.

    Naming Consistency4/5

    All tools use the same freeagent_ prefix and snake_case convention, mostly following a resource-noun pattern. Minor deviation exists because freeagent_get uses a verb and freeagent_report is action-oriented, but the overall naming remains predictable.

    Tool Count4/5

    Nine tools is a reasonable count for a FreeAgent integration and fits within the typical well-scoped range. However, the generic freeagent_get somewhat duplicates the specialized list tools, making a few tools feel redundant rather than strictly necessary.

    Completeness3/5

    The surface covers broad read access through freeagent_get plus curated list/report tools, so read-side coverage is strong. It lacks any create, update, or delete operations for invoices, bills, contacts, expenses, or other FreeAgent resources, leaving notable lifecycle gaps.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server for the FreeAgent accounting API, enabling LLMs to securely access and manage accounting data including contacts, invoices, bills, bank transactions, and more.
      5 npm
      1
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      Enables Claude to manage FreeAgent accounting tasks such as listing bank transactions, explaining and approving them with receipts, creating expenses, and logging mileage.
      28
      80 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      A Model Context Protocol server for the FreeAgent accounting API, enabling LLMs to manage contacts, invoices, estimates, bills, expenses, timeslips, projects, tasks, bank accounts, and more.
      10
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that connects Claude to FreeAgent accounting data, allowing natural language queries for financial information like bank transactions, invoices, and reports. It also includes a command-line tool for direct API access.
      -