
freeagent-mcp
io.github.tomkp/freeagent-mcp
FreeAgent accounting: invoices, bills, expenses, banking and reports. Read-only unless you allow it
Documentation
freeagent-mcp
Talk to your books. · tomkp.github.io/freeagent-mcp
An open-source Model Context Protocol server for FreeAgent, the UK online accounting service for freelancers, sole traders, partnerships and small limited companies. It lets Claude and other AI assistants read and, if you allow it, update your contacts, invoices, estimates, bills, expenses, bank transactions, projects and timesheets, and read your accounts, all from one small binary or Docker container.
"How's the business looking this month?" You have £18,240 across two bank accounts, with 14 transactions waiting to be explained. Customers owe you £7,800 on three invoices; INV-042 to Example Client Ltd (£2,400) is 12 days overdue. You owe £312 on two bills, both due next week. Profit so far this accounting year is £41,300. Your VAT return for the quarter to 31 October is due on 7 December. Want me to draft a chaser for INV-042, or work through the unexplained transactions?
Ask about your business in plain English. The assistant picks from 90 tools to look things up and, if you allow it, make changes. For example:
- 🩺 "Give me a health check of the business."
- 🏦 "Go through my unexplained bank transactions and suggest how to explain each one."
- 🧾 "Here's a receipt for a train ticket to Leeds. I paid it personally; claim it as an expense."
- 📬 "Which invoices are overdue? Draft a chasing email for each customer."
- 📊 "What was my profit last quarter, and what were the biggest costs?"
- ⏱️ "Invoice Example Client Ltd for the unbilled time on the website project."
Highlights
- ✋ You approve every change. With writes on, the server shows you exactly what it's about to change (
category: 285 → 250, the email it's about to send) and waits for you to accept it in your MCP client. The model can't answer for you. - 🛡️ Safe by default. Read-only unless you turn on writes. Deleting needs a second switch, and anything that emails a customer (sending invoices, scheduling them, FreeAgent's reminder and thank-you emails) needs a third. The switches also hold inside request bodies (flags such as
send_reminder_emails, nested_destroyentries) and in the raw API tool. Tools that aren't allowed aren't registered at all, and destructive ones are labelled so your MCP client asks before running them. freeagent-mcp never turns on Direct Debit collection. - 🔍 Preview and audit. Every tool that changes something takes
dry_run: trueto show the request it would send, with a field-by-field diff for updates, without sending it.FREEAGENT_AUDIT_LOGrecords each change as JSON Lines. - 🔄 Stays logged in. FreeAgent issues a new refresh token on every refresh. freeagent-mcp saves each one before using the new access token and never refreshes twice at once (even across processes sharing the token file), so it keeps working across restarts.
- 🚦 Rate-limit aware. Stays under FreeAgent's 120 requests a minute itself, and waits out a
429rather than failing. - 🏦 Built around how FreeAgent works. Invoices and bills are marked paid by explaining bank transactions, so
freeagent_explain_bank_transactioncovers categorised spending, invoice receipts, bill payments, transfers and money to or from directors, andexplain_bank_transactionswalks the model through your unexplained ones. - 📎 Receipts and PDFs. Attach receipts to bills and expenses, download attachments as images the assistant can read, and fetch invoice, estimate and credit note PDFs.
- 🎛️ Tunable. Expose only the toolsets you need. List tools take
search,fieldsandlimitso the model fetches only what it needs. - 🧪 Tested. The test suite runs against a mock FreeAgent API and OAuth server.
- 📊 Charts when they help. Ask how profit, cash or debtors have moved and an assistant that can draw charts, such as Claude Desktop, shows one with its answer.
- 🐳 A bundle, a binary or Docker. A one-file install for Claude Desktop, a single binary for anything that speaks stdio, or Streamable HTTP for a long-running service (with a required bearer token).
Get started
You need a FreeAgent account and Claude. Setting up takes about five minutes, most of it creating an app in FreeAgent: FreeAgent has no shared sign-in for tools like this, so each person connects through an app of their own.
First, create a FreeAgent app. Sign in to the FreeAgent Developer Dashboard, create an app (any name), and add http://localhost:8976/callback to its OAuth redirect URIs. Keep the page open: you'll need its OAuth identifier and OAuth secret.
Claude Desktop
- Download freeagent-mcp.mcpb and open it. Claude Desktop offers to install it.
- Choose Install, paste the identifier and secret when Claude asks for them, and switch the extension on.
- Start a new chat and ask Claude to log in to FreeAgent. It gives you a link; open it, log in and click Approve.
Then ask "How's my business doing?". It works on macOS and Windows.
If Claude says it can't see your FreeAgent data, or suggests a different connector, the extension is switched off. Open Settings → Extensions, switch FreeAgent on and start a new chat.
Claude Code
With Homebrew, on macOS or Linux:
brew install tomkp/tap/freeagent-mcp
freeagent-mcp setup
setup asks for the identifier and secret, gives you a link to log in to FreeAgent and approve the app, saves both where only you can read them, and adds the server to Claude Code.
Anything else
Windows and Linux downloads, building from source, Docker, the FreeAgent sandbox and other assistants such as Cursor are covered in Installing.
Turning on changes
Out of the box the assistant can look but not touch. To let it make changes, set these where the server gets its settings: the extension's settings in Claude Desktop (Allow changes, Allow deleting, Allow emailing customers), -e flags on claude mcp add, or .env with Docker.
FREEAGENT_ALLOW_WRITES=true # create and update contacts, invoices, bills, expenses, explanations, timeslips…
FREEAGENT_ALLOW_DELETES=true # also allow deleting records and invoice/bill lines (needs writes)
FREEAGENT_ALLOW_EMAIL=true # also allow emailing customers (needs writes)
FREEAGENT_TOOLSETS=account,reference,contacts,invoices,banking # optional: expose fewer tools
FREEAGENT_AUDIT_LOG=stderr # optional: log every change (or an absolute file path)
FREEAGENT_CONFIRM=all # the default: you accept each change in a dialog (or deletes,email, or none)
Ask for a dry run first when it matters: "Explain that transaction as a bill payment, but show me a dry run first."
About permissions. FreeAgent's OAuth has no scopes: the server can do whatever the FreeAgent user who clicked Approve can do. The switches above are enforced by freeagent-mcp itself. For a hard limit enforced by FreeAgent, approve the app as a FreeAgent user with a lower permission level (for example Banking, which can't reach payroll or tax filing). Read Security before turning on writes for your real books.
What it can do
| Toolset | What's covered |
|---|---|
account | Login status and OAuth login, the current user, company details, the tax timeline and a one-call business overview |
reference | Accounting categories (nominal codes) and users |
contacts | Customers and suppliers: list, look up, create, update, delete; notes |
invoices | Sales invoices and credit notes: list, create drafts, update, mark as sent/draft/written off, duplicate, email, PDFs, delete; recurring invoice profiles |
estimates | Estimates, quotes and proposals: create, update, mark as sent/approved/rejected, convert to an invoice, email, PDFs |
bills | Supplier bills with lines and attachments; downloading attachments |
expenses | Out-of-pocket expense claims with receipts, and mileage |
banking | Bank accounts and balances, transactions, explanations (categorise, match invoices and bills, transfers, director payments), statement upload |
projects | Projects, tasks, timeslips and timers |
accounting | Profit and loss, balance sheet, trial balance, cash flow, ledger transactions, journals, aged debtors and creditors, VAT and corporation tax returns (read-only) |
raw | An escape hatch that calls any FreeAgent API endpoint, with the same switches. Off unless listed by name in FREEAGENT_TOOLSETS |
See the tool reference for every tool and argument. Ready-made prompts (business_health_check, explain_bank_transactions, review_guessed_explanations, record_receipt, chase_overdue_invoices, create_invoice, period_summary, invoice_unbilled_time) chain the tools together for common jobs.
Documentation
| 📦 Installing | Every way to install it, including Docker, the sandbox and other MCP clients |
| ⚙️ Configuration | Every environment variable, login and tokens, sandbox, Docker, MCP clients |
| 🧰 Tool reference | Every tool and prompt, generated from the code |
| 🛡️ Security | Threat model, permission levels, what the switches cover |
| 🛠️ Development | Architecture, adding a tool, testing |
| 🤝 Contributing · Reporting a vulnerability · Changelog |
Known gaps
- Attachments on bank transaction explanations aren't supported: FreeAgent is moving them to a separate endpoint (API version
2026-09-01). Attach receipts to bills and expenses instead. - Payroll, self assessment, stock, capital assets, price lists and bank feeds have no dedicated tools; use the
rawtoolset to read them. - Users, permissions, Direct Debit collection and the filing status of tax returns are deliberately out of reach, even through
raw.
Acknowledgements
The architecture, safety model and much of the plumbing (OAuth token handling, dry runs, audit log, HTTP transport) are adapted from crunch-mcp by Matt Oddie, an MCP server for Crunch Accounting, under the MIT licence.
License
freeagent-mcp is an independent community project. It is not affiliated with, endorsed by or sponsored by FreeAgent Central Ltd. "FreeAgent" is a trademark of FreeAgent Central Ltd.
https://github.com/tomkp/freeagent-mcp/releases/download/v0.1.0/freeagent-mcp.mcpb# mcpb: https://github.com/tomkp/freeagent-mcp/releases/download/v0.1.0/freeagent-mcp.mcpb