FreeAgent MCP Server
The FreeAgent MCP Server connects AI assistants to FreeAgent accounting, enabling automated bookkeeping, invoicing, expense management, and financial reporting. Key capabilities:
Banking & Reconciliation: List bank accounts; list, explain, and approve transactions; attach receipts via URL, file, or base64.
Expenses & Mileage: Create expense claims (with receipt, project tagging, auto-match); create mileage claims with HMRC-based estimates; browse expense categories.
Contacts & Invoicing: List and create contacts; list, create, update status (sent/draft/cancelled), and delete invoices.
Bills: List, create (with optional PDF attachment), and delete supplier bills.
Time Tracking: List projects, create tasks, log and manage timeslips.
Financial Reporting: Profit & Loss, Trial Balance, Aged Debtors, Aged Creditors, Tax Timeline, Company Summary.
Extras: Receipt search integration (Gmail/Outlook), custom vendor-to-category mappings, configurable mileage rates, distance API support, flexible deployment (stdio or HTTP with auth).
Provides automatic driving distance calculation between two locations for mileage expense logging.
Click on "Install 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 Servershow me my unexplained bank transactions"
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 Server
A Model Context Protocol server for FreeAgent accounting. Gives Claude (or any MCP client) the ability to reconcile bank transactions with receipts, claim expenses and mileage, raise and chase invoices, record supplier bills, log time against projects, and read the company's financial position.
What access this server requires
FreeAgent
The FreeAgent OAuth credentials grant full access to the connected FreeAgent account. This server uses that access to:
Action | Tools that use it |
Read bank accounts |
|
Read bank transactions and explanations |
|
Update transaction explanations (category, description, approval, attachments) |
|
Create expense claims |
|
Read the chart of accounts and projects |
|
Read and create contacts |
|
Read, raise and change the status of invoices |
|
Read and record supplier bills |
|
Read and log time against project tasks |
|
Read accounting reports |
|
Delete invoices, bills and timeslips |
|
FreeAgent does not offer granular OAuth scopes — authorising an app grants access to all of the above.
Destructive operations. The delete tools are flagged destructiveHint: true so your MCP client can prompt before running them, as is freeagent_update_invoice_status (its mark_as_cancelled transition voids an issued invoice). The server never deletes bank transactions or contacts, and never emails anything to your clients — status transitions change status only.
Outbound fetches. freeagent_explain_transaction accepts a fileUrl to download a receipt. That URL is treated as untrusted input: only http/https are allowed, hosts resolving to loopback, link-local, or private addresses are refused (on the initial request and on every redirect), and downloads are capped at 10 MB.
Truncation. List tools page through results and report mayHaveMore; when true, any total they return covers only the records fetched and is named totalOutstandingForReturned. The freeagent_aged_debtors and freeagent_aged_creditors reports page to exhaustion and return complete: true — treat complete: false as an incomplete figure. Records whose due date is missing or unparseable are counted in a separate unknown_due_date bucket rather than being assumed not yet due.
Email and file sources (external — not provided by this server)
This server has no email tools. For receipt/invoice search to work automatically, connect one or more of the following MCP servers alongside this one:
Gmail (e.g.
mcp__claude_ai_Gmail) — personal emailMicrosoft 365 / Outlook (e.g.
mcp__claude_ai_microsoft-365) — business email
When both are connected, Claude will search all of them automatically for matching receipts before asking you to provide a file manually.
Related MCP server: freee MCP Server
Tools
Banking and expenses
Tool | Description |
| List all bank accounts and their IDs |
| List transactions (unexplained / explained / all / marked_for_review) with date filters |
| Update, approve or attach a receipt to a transaction explanation |
| List the full chart of accounts — all four category groups |
| List projects, for tagging expenses, invoices, bills and time |
| Create an expense claim with optional receipt attachment, project tag and bank-transaction auto-matching |
| Create a mileage claim; FreeAgent calculates the value from the account's mileage rate |
Contacts, invoicing and bills
Tool | Description |
| List clients and suppliers, with an optional name/email filter |
| Create a client or supplier |
| List invoices by view ( |
| Fetch one invoice in full, including line items |
| Raise an invoice with line items — always created as a draft |
| Mark an invoice as sent, draft, scheduled or cancelled (no email is sent) |
| Delete an invoice |
| List supplier bills with the total outstanding |
| Record a supplier bill, with optional PDF attachment and project allocation |
| Delete a bill |
Time tracking
Tool | Description |
| List project tasks (time is always logged against a task) |
| Create a project task with its billing rate |
| List logged time for a date range, with totals per project; |
| Log time against a project task |
| Delete a timeslip |
Reporting
Tool | Description |
| Income, expenses, operating profit, corporation tax estimate and retained profit |
| Balance on every nominal account |
| Unpaid customer invoices bucketed by age (not yet due, 1–30, 31–60, 61–90, 90+ days) |
| Unpaid supplier bills bucketed by age |
| Upcoming VAT, corporation tax and Companies House deadlines with amounts due |
| Company details, VAT registration and accounting year end |
Prerequisites
FreeAgent OAuth credentials
Log in to FreeAgent → Settings → Developer API.
Create an OAuth application. Set the redirect URI to
http://localhost:8080/callback.Note your Client ID and Client Secret.
Run the bundled auth command to complete the OAuth flow and save a refresh token to
.mcp.jsonautomatically:
npx @oxygenbubbles/freeagent-mcp-server authThe command prompts for your Client ID and Client Secret, opens the FreeAgent authorization page in your browser, listens for the callback, exchanges the code for a long-lived refresh token, and writes everything to .mcp.json in the current directory. If .mcp.json already exists, it updates just the freeagent entry.
Installation
git clone https://github.com/OxygenBubbles/freeagent-mcp-server.git
cd freeagent-mcp-server
npm install
npm run buildConfiguration
All settings are read from environment variables.
Required
Variable | Description |
| OAuth client ID |
| OAuth client secret |
| Long-lived refresh token |
Optional
Variable | Description |
| JSON object extending the built-in vendor → category mapping (see below) |
| FreeAgent category URL for mileage expenses (default |
| Fixed pence-per-mile rate used for the advisory estimate (FreeAgent still calculates the filed amount) |
| HMRC high-band rate in pence for the advisory estimate (default |
| HMRC low-band rate in pence for the advisory estimate (default |
| Miles per tax year before the low band kicks in (default |
| OpenRouteService API key for drive-distance lookups |
| Google Maps API key for drive-distance lookups (alternative to ORS) |
| If set, serves over HTTP on this port instead of stdio |
| Bearer token required on every HTTP request. Strongly recommended whenever |
| Set to |
Built-in vendor → category mappings
The server ships with mappings for common vendors, using FreeAgent's standard UK nominal codes:
Web Hosting (268) — IONOS, AWS, Netlify, Vercel, Heroku, DigitalOcean, Cloudflare
Computer Software (269) — OpenAI, Anthropic, GitHub, Stripe, Google, Microsoft, Zoom, Notion, Dropbox, Slack, Adobe, Fastmail, Mailchimp
Accommodation and Meals (285) — Booking.com, Hotels.com, Premier Inn, Travelodge, Airbnb
Travel (365) — Trainline, LNER, Uber
Check these against your own chart of accounts with freeagent_list_categories — nominal codes can be customised per account. Override or extend via VENDOR_CATEGORIES:
VENDOR_CATEGORIES='{"ACME CORP":"/v2/categories/285","NETFLIX":"/v2/categories/269"}'Claude Desktop setup
Add to claude_desktop_config.json:
{
"mcpServers": {
"freeagent": {
"command": "node",
"args": ["/path/to/freeagent-mcp-server/dist/index.js"],
"env": {
"FREEAGENT_CLIENT_ID": "...",
"FREEAGENT_CLIENT_SECRET": "...",
"FREEAGENT_REFRESH_TOKEN": "..."
}
}
}
}Usage examples
List my unexplained Starling transactions for April 2026
Approve explanation 12345678 and attach the base64 receipt
Create an expense for the £22.80 IONOS charge on 3 April — here's the PDF: <base64>
Log 24 miles for a client visit from the office to a customer site on 10 AprilMileage rates
Mileage is a special FreeAgent category: you submit the miles and vehicle type, and FreeAgent calculates the claim value from the mileage rate configured on the account. That figure is what appears in your accounts and HMRC reporting, so the server does not attempt to override it.
ratePence, MILEAGE_RATE_PENCE, cumulativeMilesYTD and the HMRC_* variables produce an advisory estimate returned alongside the filed amount. When the two differ, the response says so:
FreeAgent filed £46.20 using the mileage rate configured on the account; the estimate from 84 miles @ 45p/mile (HMRC) was £37.80.
That is a useful check: HMRC's approved rates are 45p/mile for the first 10,000 business miles in the tax year and 25p above it, and anything paid above the approved rate is a taxable benefit. If the two figures disagree, check the mileage rate in your FreeAgent settings.
Development
npm run dev # watch mode (tsx)
npm run build # compile TypeScript → dist/
npm start # run compiled server
npm test # run unit tests once
npm run test:watch # watch mode for testsClaude Code setup
Create .mcp.json in your project directory (or ~/.mcp.json for global access):
{
"mcpServers": {
"freeagent": {
"command": "node",
"args": ["/path/to/freeagent-mcp-server/dist/index.js"],
"env": {
"FREEAGENT_CLIENT_ID": "...",
"FREEAGENT_CLIENT_SECRET": "...",
"FREEAGENT_REFRESH_TOKEN": "..."
}
}
}
}HTTP mode
Set PORT to run as an HTTP server (for webhooks, iPhone Shortcuts, Power Automate):
PORT=3000 AUTH_TOKEN=a-long-random-string node dist/index.jsAlways set AUTH_TOKEN when exposing HTTP mode — every request must include Authorization: Bearer <AUTH_TOKEN> or it is rejected with 401. Without AUTH_TOKEN the server starts anyway but prints a warning to stderr and accepts all requests; only do that on a trusted loopback interface.
Security
Credentials are environment variables, never in code
FreeAgent tokens are cached in memory and refreshed automatically
Transactions are never approved without a confirmed receipt or explicit instruction
The server never creates new categories — only selects from existing ones
.mcp.jsonis excluded from git via.gitignore
Licence
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceAutomates FreshBooks invoicing and time tracking through Claude, allowing users to send invoices, list invoices, log billable hours, and get financial insights via natural language commands.2
- Alicense-qualityCmaintenanceEnables Claude to interact with freee accounting software through OAuth 2.0 authentication, supporting operations like transaction creation, account management, receipt uploads, and financial statement retrieval.MIT
- AlicenseAqualityAmaintenanceEnables Claude to interact with a Folio business bank account for managing accounts, transactions, receipts, bookkeeping, and payments as drafts.14114MIT
- AlicenseBqualityDmaintenanceEnables Claude Desktop to interact with freee accounting API for expense registration, transaction management, and receipt image processing.151MIT
Related MCP Connectors
Log, query, and edit expenses, budgets, and accounts in Ledgy from any MCP-compatible AI assistant.
Capture receipts, scan Gmail, analyze spending, and create reviewed reports from AI assistants.
Personal finance by conversation: expenses, receipts, statement import, budgets, net worth.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/OxygenBubbles/freeagent-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server