freeagent-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@freeagent-mcp list my open FreeAgent invoices"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Sign in at https://dev.freeagent.com with your FreeAgent login.
Go to My Apps, then Create New App.
Fill in:
Name: anything, for example
My FreeAgent MCPOAuth Redirect URIs:
http://localhost:8765/callback
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 ci3. 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.jsonOn 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.tsWith writes turned on:
claude mcp add freeagent -s user -e FREEAGENT_ALLOW_WRITES=1 -- node /path/to/freeagent-mcp/src/index.tsClaude 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 loginand 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 |
| GET any v2 endpoint, for example |
| Company details and the signed-in user |
| Sales invoices, with view and date filters |
| Purchase bills |
| Clients and suppliers |
| Expense claims |
| Bank accounts and balances |
| Transactions for one bank account |
| Profit and loss, balance sheet, trial balance, cashflow |
| POST, PUT or DELETE any endpoint. Only when |
API reference: https://dev.freeagent.com/docs
Settings
All settings are environment variables.
Variable | Default | Meaning |
| off |
|
|
|
|
| off |
|
| none | Use these in place of |
|
| Must match the app on the developer portal |
|
| Where |
| off |
|
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 |
| 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 |
| Do step 3. |
| The redirect URI in |
| 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 startLicense
MIT. See LICENSE.
Available Tools
9 toolsfreeagent_bank_accountsList bank accountsARead-only
List bank accounts with balances.
Inputs: no named parameters.
freeagent_bank_transactionsList bank transactionsBRead-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 billsCRead-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 detailsCRead-only
Company info and the current user.
Inputs: no named parameters.
freeagent_contactsList contactsBRead-only
List contacts. view: all, active, clients, suppliers, active_projects, completed_projects, open_clients, open_suppliers, hidden.
Inputs: sort, view.
freeagent_expensesList expensesCRead-only
List expense claims. view: recent, recurring.
Inputs: view, project, to_date, from_date.
freeagent_getFreeAgent GETARead-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 invoicesBRead-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 reportARead-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
Scored across 9 tools
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.
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.
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.
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
Related MCP Connectors
Connect Claude or Cursor to books, invoices, bills, payroll, and sealed closes.
Zoho Books, FreeAgent and FreshBooks MCP for AI apps: one answer across all your companies.
MCP server for Codat — companies, connections, invoices, bills and financial statements.
Connect Xero to AI agents with secure read or write access across multiple organisations.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP server for the FreeAgent accounting API, enabling LLMs to securely access and manage accounting data including contacts, invoices, bills, bank transactions, and more.5 npm1MIT
- AlicenseAqualityAmaintenanceEnables Claude to manage FreeAgent accounting tasks such as listing bank transactions, explaining and approving them with receipts, creating expenses, and logging mileage.2880 npm1MIT
- AlicenseNot gradedqualityBmaintenanceA 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.10MIT
- FlicenseNot gradedqualityDmaintenanceAn 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.-