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 Servercreate an invoice for $500 to Acme Corp"
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 (MCP) server for the FreeAgent accounting API. Enables LLMs to manage contacts, invoices, estimates, bills, expenses, timeslips, projects, tasks, bank accounts, and more.
By my own admission, most of this project is vibe coded.
Features
Broad FreeAgent coverage: contacts, invoices (incl. transitions and discounts), estimates (incl. transitions), bills, recurring invoices, price list items, expenses, timeslips, projects, tasks, bank accounts, bank transaction explanations, categories, company info, and users
Intent-bundle tools:
reconcile_bank_transaction,log_expense, andinvoice_from_timeslipscollapse multi-call sequences into single tool calls and resolve human-friendly hints (names, codes, references) to FreeAgent URLs server-sideOptional tool-search mode (
FREEAGENT_TOOL_SEARCH=true): collapses the tool catalog behind two meta-tools (freeagent_search_tools,freeagent_call_tool) so clients only pay the tool-definition token cost for tools they actually useMCP elicitation:
create_invoicefalls back to a form elicitation whencontactis omitted (on clients that support it)Two deployment modes: local (stdio) or cloud (Vercel serverless via Streamable HTTP)
OAuth 2.0: stateless JWT-based auth for serverless, or direct token for local use
Tool annotations:
readOnlyHint,destructiveHint,idempotentHint,openWorldHinton every toolZod validation: strict input schemas with
.describe()on all fieldsDual response formats: Markdown (human-readable) or JSON (structured)
Pagination: proper header parsing with
x-total-countandLinkheadersRate limit handling: clear error messages with retry-after guidance
Sandbox support: test safely against FreeAgent's sandbox environment
Related MCP server: KikoBooks MCP Server
Deployment Options
Local (stdio) - for Claude Desktop
Install and build:
bun install bun run buildSet environment variables:
export FREEAGENT_ACCESS_TOKEN="your_access_token" export FREEAGENT_USE_SANDBOX="true" # optionalAdd to Claude Desktop config (
~/Library/Application Support/Claude/claude_desktop_config.json):{ "mcpServers": { "freeagent": { "command": "node", "args": ["/path/to/freeagent-mcp-server/dist/index.js"], "env": { "FREEAGENT_ACCESS_TOKEN": "your_token", "FREEAGENT_USE_SANDBOX": "true" } } } }
Vercel (Streamable HTTP) - for cloud access
See VERCEL_DEPLOYMENT.md for full instructions. Key points:
Uses
StreamableHTTPServerTransportin stateless mode (no sessions)OAuth 2.0 with PKCE via JWT-encoded tokens (no database needed)
Handles
POST(tool calls),GET(SSE streaming), andDELETE(returns 405 - stateless)Set
PRODUCTION_URLenv var for stable OAuth callback URLs
Required env vars: FREEAGENT_CLIENT_ID, FREEAGENT_CLIENT_SECRET
Tool-Search Mode (optional)
By default the server registers every catalog tool directly, which makes all ~50 tool definitions part of the MCP client's tools/list response. For clients with many connected MCP servers — where tool-definition tokens add up quickly — set:
export FREEAGENT_TOOL_SEARCH=trueIn this mode the server exposes only two meta-tools:
Tool | Purpose |
| Search the catalog and return JSONSchema for matching tools. Query forms: |
| Invoke any catalog tool by name with validated arguments ( |
The full catalog is still reachable — it's just loaded on demand. This mirrors the deferred-loading pattern used by Claude Code's internal ToolSearch.
Available Tools
See TOOLS.md for per-tool parameters and examples. Summary:
Contacts
Tool | Description | Read-only |
| List contacts with pagination and sorting | Yes |
| Get contact details by ID | Yes |
| Create a new contact | No |
Invoices
Tool | Description | Read-only |
| List invoices with status/contact/project filters | Yes |
| Get invoice details (renders computed discount amount) | Yes |
| Create a draft invoice (supports | No |
| mark_as_sent / mark_as_cancelled / mark_as_draft / mark_as_scheduled / convert_to_credit_note | No |
| Intent bundle: draft an invoice from a contact's unbilled timeslips | No |
Estimates
Tool | Description | Read-only |
| List estimates with status/contact/project filters | Yes |
| Get estimate details (renders computed discount amount) | Yes |
| Draft an estimate (supports | No |
| mark_as_sent / mark_as_approved / mark_as_rejected / mark_as_cancelled / mark_as_draft / convert_to_invoice | No |
Bills
Tool | Description | Read-only |
| List supplier bills with filters | Yes |
| Get bill details | Yes |
| Record a supplier bill | No |
Recurring Invoices
Tool | Description | Read-only |
| List recurring invoice templates | Yes |
| Get template details | Yes |
Price List Items
Tool | Description | Read-only |
| List catalog items | Yes |
| Get catalog item details | Yes |
| Add a catalog item | No |
Expenses
Tool | Description | Read-only |
| List expenses with date/view filters | Yes |
| Get expense details (inc. mileage info) | Yes |
| Create expense or mileage claim (with attachments) | No |
| Update an existing expense | No |
| Intent bundle: log a regular expense with a positive | No |
Timeslips
Tool | Description | Read-only |
| List time entries with filters | Yes |
| Get timeslip details | Yes |
| Create a time entry | No |
| Update a timeslip (incl. | No |
Bank Accounts & Transactions
Tool | Description | Read-only |
| List all bank accounts | Yes |
| Get bank account details | Yes |
| List transactions for an account | Yes |
| Get bank transaction details | Yes |
| List transaction explanations | Yes |
| Get explanation details | Yes |
| Explain/categorize a bank transaction | No |
| Update a transaction explanation | No |
| Intent bundle: explain a transaction with a category name / invoice ref / bill ref | No |
Projects & Tasks
Tool | Description | Read-only |
| List projects with status/contact filters | Yes |
| Get project details | Yes |
| Create a new project | No |
| List tasks with project/status filters | Yes |
| Get task details | Yes |
| Create a task within a project | No |
Categories, Company & Users
Tool | Description | Read-only |
| List accounting categories | Yes |
| Get category by nominal code | Yes |
| Get company information | Yes |
| List all users | Yes |
Development
Prerequisites
Bun (used for package management and running scripts)
Node.js 22.x
Setup
bun installScripts
Command | Description |
| Compile TypeScript |
| Watch mode (auto-recompile) |
| Run the compiled server |
| Run ESLint |
| Run tests |
| Run tests in watch mode |
| Run tests with coverage |
Project Structure
freeagent-mcp-server/
├── src/
│ ├── index.ts # Stdio server entry point
│ ├── constants.ts # Configuration constants & shared utilities
│ ├── types.ts # TypeScript type definitions
│ ├── schemas/
│ │ ├── index.ts # Zod validation schemas for all tools
│ │ ├── projects.ts # Project-specific schemas
│ │ └── schemas.test.ts # Schema validation tests
│ ├── services/
│ │ ├── api-client.ts # FreeAgent API client (Axios)
│ │ ├── api-client.test.ts # API client tests
│ │ ├── formatter.ts # Response formatting utilities (incl. discount amount helper)
│ │ ├── formatter.test.ts # Formatter tests
│ │ ├── resolvers.ts # Shared resolvers (category / user / contact / bill hints → URLs)
│ │ ├── oauth-jwt.ts # JWT-based OAuth provider (Vercel)
│ │ └── freeagent-auth.ts # Token validation
│ └── tools/
│ ├── register.ts # Shared tool definitions, registration, ToolContext (elicitation)
│ ├── contacts.ts # Contact CRUD
│ ├── invoices.ts # Invoice management (incl. elicitation fallback)
│ ├── transition-invoice.ts # Invoice lifecycle transitions
│ ├── invoice-from-timeslips.ts # Intent bundle: draft an invoice from unbilled time
│ ├── estimates.ts # Estimates + transition_estimate
│ ├── bills.ts # Supplier bills
│ ├── recurring-invoices.ts # Recurring invoice templates (read-only)
│ ├── price-list-items.ts # Catalog items
│ ├── expenses.ts # Expense & mileage tracking
│ ├── log-expense.ts # Intent bundle: positive-amount expense logging
│ ├── timeslips.ts # Time tracking (incl. update_timeslip)
│ ├── bank-accounts.ts # Bank accounts & transactions
│ ├── bank-transactions.ts # Transaction explanations
│ ├── reconcile.ts # Intent bundle: reconcile a transaction in one call
│ ├── projects.ts # Project management
│ ├── tasks.ts # Task management
│ ├── categories.ts # Accounting categories
│ └── company.ts # Company info & users
├── api/
│ └── index.ts # Vercel serverless entry point
├── .github/
│ └── workflows/
│ └── ci.yml # GitHub Actions CI (lint, test, build)
├── eslint.config.js # ESLint flat config
├── vitest.config.ts # Vitest configuration
├── vercel.json # Vercel deployment config
├── package.json
└── tsconfig.jsonCI
GitHub Actions runs on every push to main and on pull requests:
Lint: ESLint with TypeScript rules
Test: Vitest unit tests (no external API calls)
Build: TypeScript compilation check
Rate Limiting
Environment | Limit |
Production | 15 requests / 60 seconds |
Sandbox | 5 requests / 60 seconds |
The server returns clear error messages with retry-after timing when rate limited.
Error Handling
All tool handlers return structured errors via { isError: true, content: [...] } (never thrown exceptions). Error messages are designed for LLM consumption with actionable guidance:
Status | Meaning |
401 | Token expired - refresh OAuth token |
403 | Insufficient permissions |
404 | Resource not found or deleted |
422 | Validation error with field-level details |
429 | Rate limited - retry after N seconds |
Security
Access tokens are never logged or committed
JWT tokens use HS256 signing with configurable secret
PKCE is used for the OAuth authorization flow
Strict Zod schemas reject unexpected input fields
Bearer auth middleware protects all MCP endpoints
License
MIT
Links
This server cannot be installed
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
- 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/WavingCatApps/freeagent-mcp-vercel'
If you have feedback or need assistance with the MCP directory API, please join our Discord server