Xero MCP Safe
Provides tools for reading Xero Accounting API data such as overdue invoices, chase plans, cash summaries, aged receivables, contacts, payments, and bank transactions, and for creating DRAFT sales invoices and supplier bills with GST validation, gated behind writes and confirmation.
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 Safe Who owes us money?"
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 Safe
$34,880 overdue across 5 invoices, chase plan ready. That is what Claude finds in the demo books in one question. Read-only by default, drafts only when you switch writes on, never approved and never sent.
Ask Claude who owes you money. "Who should we chase today?" "Draft the invoice for the Coburg switchboard job." "Here is a supplier invoice, can you bill it?"
An MCP server by Gaps2Gains that connects Claude to Xero. It reads by default. Writes are off until you set XERO_ALLOW_WRITES=1, every write is a dry run until confirm=true, and everything it creates lands as a DRAFT that a person approves inside Xero.
Status: the Xero calls are modelled on Xero's published API reference and are untested against a live Xero organisation. The demo books and the tests are real. Try it on a demo company or a copy first. See What We Modelled.
What an Owner Can Ask
You: Who owes us money?
Claude: $34,880 overdue across 5 invoices, chase plan ready. The oldest is Keilor Builders, INV-0044, 96 days late.
You: Who should we chase today?
Claude: 4 invoices to chase: 1 friendly reminder, 1 firm reminder, 2 calls for the Owner. 3 skipped, 1 of them because a payment is pending.
You: Invoice Northside Cafe for 3 hours labour at $120/hr, materials $450 and a call out fee $90.
Claude: Dry run. Nothing created in Xero. $900 plus $90 GST is $990. Say the word and it goes into Xero as a DRAFT for you to approve.
Related MCP server: Python Xero MCP Server for BYB
Tools
Tool | What it does | Writes? |
| Unpaid customer invoices past due, most overdue first, with ageing: 1 to 30, 31 to 60, 61 to 90 and over 90 days. Drafts, voided and paid invoices are never counted | No |
| For every open invoice, one of four outcomes: Friendly reminder (7 to 20 days late), Firm reminder (21 to 40), Call the Owner (over 40, no email), or Skip because a payment is pending (or not due, too early, on the skip list). One line of reasoning per row | No |
| What customers owe, money in and out over recent days, and what we owe suppliers. Movement only: no bank balance is claimed | No |
| Receivables by customer in ageing buckets. Pass | No |
| Search contacts by name or email and get the contact ID | No |
| Turns a job description into a DRAFT sales invoice (ACCREC) with line items and 10% GST. Dry run until | Yes, gated |
| Reads the text of a supplier invoice, extracts the fields, checks the GST maths in whole cents and proposes a DRAFT supplier bill (ACCPAY). Dry run until | Yes, gated |
The two write tools are only registered when XERO_ALLOW_WRITES=1 (always on in demo mode, where nothing leaves your machine). They carry MCP annotations that say so: read tools are readOnlyHint, write tools are not read-only and not destructive.
How the Chase Plan Decides
Days overdue | Outcome |
Not due yet | Skip |
1 to 6 | Skip, too early |
7 to 20 | Friendly reminder |
21 to 40 | Firm reminder |
Over 40 | Call the Owner |
A payment is pending when that customer logged a payment in the last 7 days, or money from them has landed as a RECEIVE bank transaction in the last 14 days and is not reconciled yet. Chasing them would be wrong, so the invoice is skipped with the reason. Disputed invoices go on the skip list: set XERO_SKIP_INVOICES to a comma separated list of invoice numbers, or pass skip.
Bills From Documents
bill_from_document takes OCR-style text and proposes a bill:
Deterministic by default. A plain parser, no model and no network. It reads supplier, ABN, invoice number, dates, line items, subtotal, GST and total, and leaves a field out rather than guess.
GST maths in whole cents. Line items must add to the subtotal, GST must be 10% (or total divided by 11 for GST-inclusive documents), and subtotal plus GST must equal the total, all within 2 cents. If it does not add up, the bill is blocked even with
confirm=true.Optional Claude mode.
mode=claudesends the document text to the Anthropic API, then runs the result through the same checks. It needsANTHROPIC_API_KEY. The model comes fromXERO_EXTRACT_MODELand falls back toclaude-haiku-5-5.Known supplier only. It will not create contacts. The supplier must already exist in Xero, or pass
contact_id. A bill number that already exists for that supplier is blocked.
For the full documents pipeline, with confidence scores, duplicate checks, a human review queue and an accuracy gate in CI, see messy-docs-to-records.
Quick Start
With no Xero credentials it runs on demo books for a fictional Melbourne electrician, Bright Spark Electrical.
git clone https://github.com/dwadlane/xero-mcp-safe.git
cd xero-mcp-safe
npm install && npm run build
claude mcp add xero -- node "$(pwd)/dist/index.js"Or add it to Claude Desktop's claude_desktop_config.json:
{
"mcpServers": {
"xero": { "command": "node", "args": ["/full/path/to/xero-mcp-safe/dist/index.js"] }
}
}Connect Your Xero Organisation
Create an app in the Xero developer portal, complete the OAuth 2.0 flow, and keep the tenant ID of the organisation you chose.
Variable | What it is |
| The organisation's tenant ID. Sent as the |
| OAuth 2.0 bearer token |
| Optional. The server refreshes an expired token through |
| Optional. Xero refresh tokens are single use, so we keep the newest pair in this file (mode 600) |
| Registers |
| Invoice numbers or IDs the chase plan always leaves alone |
| Optional account codes for draft lines. Left off unless set |
| Optional, for |
Credentials stay on your machine and go only to Xero (and to Anthropic in Claude mode).
When It Stops
We built this to hand off, not to push on.
Read-only by default. No write tool exists until you set
XERO_ALLOW_WRITES=1.Dry run until
confirm=true. Both write tools preview first and create nothing.DRAFT only, never AUTHORISED. The request's
Statusis a fixedDRAFT, not an input. Nothing is approved, sent or paid. A person reviews it inside Xero.Over 40 days goes to the Owner as a call. An email is the wrong tool by then, so
chase_plansays call.A pending payment pauses the chase. Recent payments and unreconciled receipts both count.
Bad GST, unknown suppliers and duplicate bill numbers are blocked, even with
confirm=true. We never invent prices either: job lines without an amount are not charged.No retry on writes. A 429 waits for
Retry-Afterand tries again (Xero allows 60 calls a minute). A server error is retried for reads only, so a write is never sent twice. Each write carries anIdempotency-Key.This server cannot send email. There is nothing here that contacts your customers.
What We Modelled
Xero Accounting API, base https://api.xero.com/api.xro/2.0/, OAuth 2.0 bearer token plus the xero-tenant-id header. Untested against a live Xero organisation.
Endpoint | Used for |
| Overdue, chase plan, cash, aged receivables, duplicate bill check |
|
|
|
|
| Pending payment detection, cash in |
| Unreconciled receipts, cash in and out |
|
|
| Token refresh |
Dates are read in both Xero formats, ISO and /Date(ms+0000)/. Lists page with page and pageSize=100, up to 20 pages. Please tell us what a live org shows that we got wrong.
How It's Built
TypeScript on the official MCP SDK, zod for inputs.
A
DemoClientwith fictional data for Bright Spark Electrical, so the tools run the same code with or without Xero.Injected
fetchandsleep, so rate limit and refresh behaviour is tested without waiting.Tests on every tool, the HTTP layer, the GST maths and a stdio smoke test that starts the real server:
npm test.
Also From Us
myob-mcp: the same overdue and chase tools for MYOB AccountRight.
agent-action-gate: every write proposed, approved, run once and logged. Put it in front of any agent that can change records.
messy-docs-to-records: messy faxes and invoices in, draft records out, with a human review queue.
Not affiliated with or endorsed by Xero.
License
MIT
Built by Gaps2Gains. Book a Free Discovery Call
Available Tools
7 toolsaged_receivablesAged receivablesARead-only
Receivables by customer in ageing buckets (current, 1 to 30, 31 to 60, 61 to 90, over 90). With contact_id it returns Xero's own AgedReceivablesByContact report for that one contact.
Inputs: contact_id.
bill_from_documentDraft bill from a supplier documentAIdempotent
Read the text of a supplier invoice (OCR style), extract the fields, check the GST maths in whole cents and propose a DRAFT supplier bill (ACCPAY). Deterministic parser by default; mode=claude is optional and sends the text to the Anthropic API. Dry run by default. If the GST does not add up, the supplier is unknown or the bill number already exists, it is blocked even with confirm=true. Created as DRAFT only, never approved.
Inputs: text (required), mode, confirm, contact_id.
cash_summaryCash summaryARead-only
What customers owe, money in and out over recent days, and what we owe suppliers. Money movement only: Xero's Accounting API gives no bank balance, so none is claimed.
Inputs: days.
chase_planChase planARead-only
For every open customer invoice, decide one of four outcomes: Friendly reminder (7 to 20 days overdue), Firm reminder (21 to 40), Call the Owner (over 40, no email), or Skip (not due, too early, on the skip list, or a payment is pending). Each row says why in one line.
Inputs: skip.
find_contactsFind contactsARead-only
Search Xero contacts by name or email. Returns the contact ID the write tools need.
Inputs: search (required).
invoice_from_jobDraft invoice from a jobAIdempotent
Turn a job description into a DRAFT sales invoice (ACCREC) with line items and 10% GST. Example: '3 hours labour at $120/hr, materials $450, call out fee $90'. Dry run by default: with confirm=false it returns the preview and creates nothing. With confirm=true it creates the invoice as DRAFT only. It is never approved or sent. Lines without a price are not charged.
Inputs: job_description (required), items, confirm, contact, +4 more.
overdue_invoicesOverdue invoicesARead-only
Unpaid customer invoices past their due date, most overdue first, with an ageing breakdown (1 to 30, 31 to 60, 61 to 90, over 90 days). Drafts, voided and paid invoices are never counted. Use for 'who owes us money?'
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
The receivables tools overlap significantly: overdue_invoices, aged_receivables, and chase_plan all operate on the same open/overdue invoice pool and multiple expose ageing buckets, so an agent asking 'who owes us money by age' could reasonably pick any of them. The rich descriptions help separate an action list (chase_plan) from a raw report (aged_receivables) and a cash-flow view (cash_summary), but the boundaries are not crisp. The two document/job creation tools are clearly distinct.
Names mix conventions: noun phrases (overdue_invoices, chase_plan, cash_summary, aged_receivables), a verb_noun (find_contacts), and X_from_Y patterns (bill_from_document, invoice_from_job). All are readable and snake_case, but there is no single predictable verb_noun scheme, making the set feel ad hoc.
Seven tools is well within a sensible range and each earns its place in the AR/cash workflow: reporting, chase planning, contact lookup, and two guarded draft-creation flows. Nothing feels redundant enough to cut or thin enough to be a gap.
Coverage is read-heavy plus two draft creators, but there is no way to record payments, send reminders/invoices, approve or void bills, or list all invoices despite chase_plan generating actions that cannot be executed through the surface. The draft-only 'safe' scope is intentional, but these gaps limit end-to-end workflows.
Maintenance
Related MCP Connectors
Query and export Xero finance data and prepare accounting drafts in your xpnAI Workspace.
Accounts receivable automation for Xero and QuickBooks Online, inside your AI assistant. Ask Claude, ChatGPT or any MCP client for a receivables summary, find customers and invoices, read the email and SMS replies your customers sent, and see what Paidnice sent or skipped. Ask why a reminder, late fee or statement did or did not go out, and update a customer's contact people straight into your ledger. Secure OAuth sign-in. One connection covers every organisation you tick, with Read or Read and Write access.
Review overdue invoices, synced Xero invoices and contacts, and live Xero reports. Read-only.
Connect Xero to AI agents with secure read or write access across multiple organisations.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables 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
- -licenseNot gradedqualityDmaintenanceEnables interaction with Xero accounting API for financial reporting, sales analysis, grant tracking, and bill management using natural language.1-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to read an organisation's contacts, invoices and bills, payments, chart of accounts and financial reports, and — only on explicit request — to create contacts, invoices and payments or change an invoice's status.Apache 2.0
- AlicenseAqualityBmaintenanceEnables Claude Desktop and Claude Code to retrieve read-only accounting and sales-invoice data and build profit-and-loss statements, balance sheets, year-over-year comparisons, monthly trends, and dimension-filtered financial reports.121MIT