Xero MCP Server
Integrates with the Xero Accounting API (2.0) to give AI agents read and write access to one organisation's accounting data. Read tools cover contacts, invoices and bills, payments, the chart of accounts, and financial reports (profit and loss, balance sheet, aged receivables and payables), while write tools can create contacts, invoices/bills and payments, and change an invoice's status (submit, authorise, void).
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., "@Xero MCP Servershow me 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.
Xero MCP Server
An MCP server for the Xero Accounting API (2.0). It lets an AI agent read one Xero organisation's contacts, invoices and bills, payments, chart of accounts and financial reports (profit and loss, balance sheet, aged receivables and payables) and, on explicit request, create contacts, invoices and payments or change an invoice's status.
Transport: MCP Streamable HTTP at
POST /mcp, health probe atGET /healthStateless and multi-tenant: the access token and organisation id arrive on every request as HTTP headers and are never stored; every tool is listed from the first
tools/listPython 3.12, uv, FastMCP, httpx
License: Apache-2.0, Copyright 2026 MSPbots.ai
Authentication headers
Header | Required | Type | Default | Allowed values | Description | Example |
| Yes | string | none | - | Xero OAuth 2.0 access token (a leading |
|
| Yes | string | none | - | Id of the Xero organisation (tenant) to work on |
|
Where to get them:
Create an app in the Xero developer portal (developer.xero.com, My Apps -> New app) and authorise it for the organisation with the OAuth 2.0 authorisation-code flow. Request the scopes the tools need:
accounting.contacts,accounting.transactions,accounting.settingsandaccounting.reports.read(the.readvariants for read-only use).The token response holds a short-lived access token; whoever stores the connection must refresh it with the refresh token. This server never refreshes or stores tokens.
The tenant id comes from
GET https://api.xero.com/connectionswith that token; each organisation the user authorised has its owntenantId.
How credentials are sent to Xero: every call goes to https://api.xero.com/api.xro/2.0/...
with Authorization: Bearer <token> and xero-tenant-id: <tenant id>. Writes also carry a
fresh Idempotency-Key header, so a retried write cannot create a second record. Values that
look like unresolved templates (${...}) are treated as missing.
A request to /mcp without both headers gets HTTP 401 naming the missing one.
Related MCP server: Xero MCP Server
Tools
All tools return a JSON string. Ids are UUIDs. List tools return 100 records per page with
{count, page, has_more, next_page}. Dates are YYYY-MM-DD; Xero's legacy /Date(...)/
values in responses are converted to ISO 8601.
Tool | Purpose | Parameters (required in bold) |
| Describe the tools of one Xero area (changes nothing) | domain ( |
| List every Xero area and its tools (changes nothing) | - |
| Check the connection: organisation name, country, base currency, financial year end | - |
| List contacts (customers and suppliers), 100 per page | page, where |
| Get one contact's full profile | contactId |
| Create a contact (write) | Name, EmailAddress, FirstName, LastName, Phone, AccountNumber, TaxNumber, IsCustomer, IsSupplier |
| Search contacts by name, contact person, account number or email | term |
| List invoices and bills, newest first, without line items | page, Status ( |
| Get one invoice or bill in full (line items, tax, payments, amount due) | invoiceId |
| Create a sales invoice or bill, DRAFT by default (write) | Type ( |
| Submit, authorise or void an invoice (write, voiding is permanent) | invoiceId, Status ( |
| List payments, newest first | page, Status ( |
| Get one payment | paymentId |
| Record a payment against an authorised invoice or bill (write) | InvoiceID, AccountID, Amount, Date, Reference |
| List the chart of accounts, optionally by type or class | Type, Class ( |
| Get one account | accountId |
| Profit and Loss for a date range | fromDate, toDate |
| Balance Sheet as at a date | date |
| Money owed by customers, aged by days overdue | date, contactId |
| Money owed to suppliers, aged by days overdue | date, contactId |
Reports come back flattened as {name, titles, date, columns, sections: [{title, rows: [{label, values}], total}]} instead of Xero's nested rows and cells.
Errors come back as a JSON envelope instead of an exception:
{"error": {"code": "invalid_argument", "message": "Xero returned HTTP 400 for Invoices: A validation exception occurred - Account code '999' is not a valid code", "retryable": false}}code is one of not_configured, unauthorized, not_found, invalid_argument,
rate_limited, upstream_error; Xero's validation messages are included. Xero allows 60
calls per minute and 5,000 per day per organisation; 429, 5xx and network errors are retried
with backoff (honouring Retry-After), and writes are safe to retry because of the idempotency
key.
Run locally
uv sync
uv run python -m xero_mcp # listens on 0.0.0.0:8080or with Docker:
docker build --platform linux/amd64 -t xero-mcp:dev .
docker run --rm -p 8080:8080 xero-mcp:devConfiguration (environment variables, all optional): MCP_HTTP_HOST (default 0.0.0.0),
MCP_HTTP_PORT (default 8080), LOG_LEVEL (default INFO). Credentials are never read
from the environment.
Testing example
# list tools
curl -s http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "X-Xero-Access-Token: your-access-token" \
-H "X-Xero-Tenant-Id: your-tenant-id" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
# unpaid sales invoices
curl -s http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "X-Xero-Access-Token: your-access-token" \
-H "X-Xero-Tenant-Id: your-tenant-id" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"xero_invoices_list","arguments":{"Type":"ACCREC","Status":"AUTHORISED"}}}'Unit tests (no network access needed):
uv run pytestDelivery notes
Tool count (20). Kept as is because the tool names are an existing contract.
Aged reports. Xero's aged receivables / payables reports require a contact (
contactId), and the API has no all-contacts version. WithcontactIdthe tools return Xero's report; without it they return a per-contact ageing summary (current, 1-30, 31-60, 61-90, over 90 days past due) built from open authorised invoices dated on or beforedate, using today's amount due.Searching.
xero_contacts_searchuses Xero'ssearchTermparameter, so names with quotes are found and cannot break the filter; other filters escape their values.Write tools.
xero_contacts_create,xero_invoices_create,xero_payments_createandxero_invoices_update_statuschange the books; their descriptions tell the agent to use them only on explicit request. Status changes are annotated destructive because voiding cannot be undone. Per-record validation errors that Xero returns with HTTP 200 are reported as errors.No interactive prompts. Older versions asked the user for filters before unfiltered lists, which a stateless gateway cannot relay; lists now page instead.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect Xero to AI agents with secure read or write access across multiple organisations.
Query your books, company data, business health, and ship invoices from your AI assistant.
Connect QuickBooks Online to AI agents with secure read or write access across multiple companies.
Open-source AI accounting skills verified by licensed accountants (tax, VAT, payroll).
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to query and manage QuickBooks Online data through natural language, including customers, invoices, bills, vendors, accounts, and financial reports.7MIT
- AlicenseAqualityAmaintenanceEnables interaction with the Xero Accounting API to manage contacts, invoices, payments, accounts, and financial reports. It provides a suite of tools for natural language access to accounting records and business performance data.201Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to read and write Cynco accounting data, including querying books, creating invoices, reconciling transactions, and generating financial reports.13 npm1MIT
- AlicenseBqualityAmaintenanceEnables AI assistants to query and manage self-hosted accounting data—invoices, balances, and books—through natural language, with read-only tools by default and optional scoped write operations.3048 PyPIAGPL 3.0