freeagent-mcp-server
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-serverList my unpaid 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-server
MCP server for the FreeAgent accounting API. Provides 76 tools covering invoices, expenses, contacts, projects, timeslips, banking, bills, estimates, credit notes, accounting reports, and more.
Features
OAuth2 Authentication - Built-in browser-based auth flow with automatic token refresh
Company - Company info, business categories, tax timeline
Users - List, get, create, update, and delete users
Contacts - Full CRUD for clients and suppliers
Projects - Create and manage projects
Tasks - Manage project tasks with billing rates
Timeslips - Track time with start/stop timer support
Invoices - Create, send, and manage invoices with status transitions
Estimates - Quotes, estimates, and proposals with approval workflows
Bills - Manage supplier bills
Credit Notes - Issue and manage credit notes
Expenses - Track and categorize expenses
Banking - Bank accounts and transaction management
Categories - Browse accounting categories
Accounting Reports - Profit & loss, balance sheet, trial balance
Related MCP server: qb-mcp
Prerequisites
Sign up for a FreeAgent Developer account
Register an application in the Developer Dashboard
Set the OAuth redirect URI to
http://localhost:3456/callbackNote your Client ID and Client Secret
See the FreeAgent API Quick Start for detailed instructions.
Getting Started
1. Set environment variables
export FREEAGENT_CLIENT_ID="your_client_id"
export FREEAGENT_CLIENT_SECRET="your_client_secret"
# export FREEAGENT_SANDBOX=true # uncomment to use sandbox instead of production2. Authenticate (one-time)
npx freeagent-mcp-server authThis opens your browser to authorize the app. The auth flow supports two modes:
Automatic (default) - A local server on port 3456 catches the OAuth redirect automatically. This is seamless when the port is available and the redirect URI is configured.
Manual paste fallback - If the redirect doesn't work (port busy, firewall, etc.), simply copy the full URL from your browser's address bar and paste it into the terminal. The URL will look like
http://localhost:3456/callback?code=...&state=....
After approval, tokens are saved to ~/.freeagent-mcp/tokens.json and automatically refreshed when they expire.
3. Configure your MCP client
See the Configuration section below.
Installation
Requirements: Node.js 18 or later.
Using npx (recommended)
npx freeagent-mcp-serverGlobal install
npm install -g freeagent-mcp-server
freeagent-mcpTo pin a specific version, append @<version> (e.g. npm install -g freeagent-mcp-server@1.3.0).
Build from source
git clone https://github.com/samaxbytez/freeagent-mcp.git
cd freeagent-mcp
npm install
npm run build
npm startConfiguration
Environment Variables
Variable | Required | Description |
| Yes* | OAuth2 client ID from Developer Dashboard |
| Yes* | OAuth2 client secret from Developer Dashboard |
| No | Set to |
| No | Legacy: direct access token (skips stored token flow) |
| No | Override API base URL |
*Not required if using FREEAGENT_ACCESS_TOKEN directly.
Claude Desktop / Cowork
Add to your claude_desktop_config.json:
{
"mcpServers": {
"freeagent": {
"command": "npx",
"args": ["-y", "freeagent-mcp-server"],
"env": {
"FREEAGENT_CLIENT_ID": "your_client_id",
"FREEAGENT_CLIENT_SECRET": "your_client_secret"
}
}
}
}This works with both Claude Desktop chat and Claude Cowork. Make sure to run npx freeagent-mcp-server auth in your terminal first to complete the one-time OAuth setup.
Claude Code
Add to your .mcp.json:
{
"mcpServers": {
"freeagent": {
"command": "npx",
"args": ["-y", "freeagent-mcp-server"],
"env": {
"FREEAGENT_CLIENT_ID": "your_client_id",
"FREEAGENT_CLIENT_SECRET": "your_client_secret"
}
}
}
}Architecture
freeagent-mcp/
├── src/
│ ├── index.ts # Entry point, server setup
│ ├── auth.ts # OAuth2 flow, token storage & refresh
│ ├── client.ts # FreeAgent API HTTP client
│ ├── utils.ts # Shared utilities (responses, logging)
│ ├── auth.test.ts # Auth module tests
│ ├── client.test.ts # Client tests
│ ├── utils.test.ts # Utils tests
│ └── tools/
│ ├── company.ts # Company info tools (3)
│ ├── users.ts # User management tools (6)
│ ├── contacts.ts # Contact CRUD tools (5)
│ ├── projects.ts # Project management tools (5)
│ ├── tasks.ts # Task management tools (5)
│ ├── timeslips.ts # Time tracking tools (7)
│ ├── invoices.ts # Invoice tools (9)
│ ├── estimates.ts # Estimate tools (7)
│ ├── bills.ts # Bill management tools (5)
│ ├── credit-notes.ts # Credit note tools (5)
│ ├── expenses.ts # Expense tracking tools (5)
│ ├── banking.ts # Banking tools (7)
│ ├── categories.ts # Category tools (2)
│ ├── accounting.ts # Accounting report tools (5)
│ └── tools.test.ts # Tool handler tests
├── package.json
├── tsconfig.json
└── smithery.yamlTools Reference
Company (3 tools)
Tool | Description | API Endpoint |
| Get company information |
|
| List business categories |
|
| Get tax timeline |
|
Users (6 tools)
Tool | Description | API Endpoint |
| List users with optional view filter |
|
| Get a specific user |
|
| Get the authenticated user |
|
| Create a new user |
|
| Update a user |
|
| Delete a user |
|
Contacts (5 tools)
Tool | Description | API Endpoint |
| List contacts with filtering and sorting |
|
| Get a specific contact |
|
| Create a new contact |
|
| Update a contact |
|
| Delete a contact |
|
Projects (5 tools)
Tool | Description | API Endpoint |
| List projects with optional view filter |
|
| Get a specific project |
|
| Create a new project |
|
| Update a project |
|
| Delete a project |
|
Tasks (5 tools)
Tool | Description | API Endpoint |
| List tasks with optional filtering |
|
| Get a specific task |
|
| Create a new task for a project |
|
| Update a task |
|
| Delete a task |
|
Timeslips (7 tools)
Tool | Description | API Endpoint |
| List timeslips with date and status filters |
|
| Get a specific timeslip |
|
| Create a new timeslip |
|
| Update a timeslip |
|
| Delete a timeslip |
|
| Start a timer on a timeslip |
|
| Stop a timer on a timeslip |
|
Invoices (9 tools)
Tool | Description | API Endpoint |
| List invoices with view and contact filters |
|
| Get a specific invoice |
|
| Create a new invoice |
|
| Update an invoice |
|
| Delete an invoice |
|
| Mark invoice as sent |
|
| Mark invoice as draft |
|
| Cancel an invoice |
|
| Email an invoice |
|
Estimates (7 tools)
Tool | Description | API Endpoint |
| List estimates with filters |
|
| Get a specific estimate |
|
| Create a new estimate |
|
| Update an estimate |
|
| Delete an estimate |
|
| Mark estimate as sent |
|
| Mark estimate as approved |
|
Bills (5 tools)
Tool | Description | API Endpoint |
| List bills with view and date filters |
|
| Get a specific bill |
|
| Create a new bill |
|
| Update a bill |
|
| Delete a bill |
|
Credit Notes (5 tools)
Tool | Description | API Endpoint |
| List credit notes with filters |
|
| Get a specific credit note |
|
| Create a new credit note |
|
| Update a credit note |
|
| Delete a credit note |
|
Expenses (5 tools)
Tool | Description | API Endpoint |
| List expenses with date and project filters |
|
| Get a specific expense |
|
| Create a new expense |
|
| Update an expense |
|
| Delete an expense |
|
Banking (7 tools)
Tool | Description | API Endpoint |
| List bank accounts |
|
| Get a specific bank account |
|
| Create a new bank account |
|
| Update a bank account |
|
| Delete a bank account |
|
| List transactions for a bank account |
|
| Get a specific bank transaction |
|
Categories (2 tools)
Tool | Description | API Endpoint |
| List all accounting categories |
|
| Get a specific category by nominal code |
|
Accounting Reports (5 tools)
Tool | Description | API Endpoint |
| Get profit and loss summary |
|
| Get balance sheet |
|
| Get opening balances |
|
| Get trial balance summary |
|
| Get trial balance opening balances |
|
Example Prompts
"Show me the company information from FreeAgent"
"List all active contacts"
"Create a new invoice for contact 12345 dated today with 30 day payment terms"
"How much time did I log this week?"
"Start a timer on timeslip 67890"
"Show my profit and loss for the current year"
"List all overdue invoices"
"Create an expense for lunch at $25 under the entertainment category"
"What's my current balance sheet?"
"List all open bills from suppliers"
Development
# Install dependencies
npm install
# Type check
npm run type-check
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Build
npm run build
# Lint
npm run lint
# Format
npm run formatAdding New Tools
Create a new file in
src/tools/(or add to an existing one)Follow the pattern: export a
registerXxxTools(server, client)functionRegister each tool with
server.tool()orserver.registerTool()Always use
logToolCall(),jsonResponse(), anderrorResponse()Import and call the register function in
src/index.tsAdd tests in
src/tools/tools.test.ts
Troubleshooting
"Missing credentials" error on startup
Set FREEAGENT_CLIENT_ID and FREEAGENT_CLIENT_SECRET environment variables, then run npx freeagent-mcp-server auth to authenticate.
"No stored tokens found"
You need to complete the one-time auth flow first: npx freeagent-mcp-server auth
Authentication times out
If the automatic redirect doesn't work, copy the full URL from your browser's address bar after approving and paste it into the terminal. Ensure your FreeAgent app's redirect URI is set to http://localhost:3456/callback.
Port 3456 is busy The auth flow will automatically fall back to manual paste mode. Just paste the redirect URL from your browser after approving.
401 Unauthorized errors
Your tokens may have been revoked. Re-run npx freeagent-mcp-server auth to re-authenticate.
"FreeAgent API error (403)" Your token may not have the required permission level. Check that your FreeAgent app has the appropriate access scopes.
Sandbox vs Production
By default the server connects to the FreeAgent production API. Set FREEAGENT_SANDBOX=true to use the sandbox.
Tool not found
Ensure you're using the correct tool name with the freeagent_ prefix (e.g., freeagent_list_invoices, not list_invoices).
Empty responses Some endpoints return empty responses for successful DELETE operations. This is expected behavior.
Releasing
Releases are automated from Conventional Commits —
see RELEASING.md. In short: merging feat:/fix: PRs to main
opens a release PR (version bump + changelog); merging that PR publishes to npm.
Changelog
See CHANGELOG.md for the release history. The latest published version is shown by the npm badge at the top of this README.
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/samaxbytez/freeagent-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server