io.github.codespar/mcp-xero
io.github.codespar/mcp-xero · 273 stars · TypeScript · MIT
MCP server MCP server for Xero — global cloud accounting: contacts, invoices, payments, items, reports
Install
The repo has no one-line install. Follow its README.
Published as
- npm
@codespar/mcp-xerostdio
From the server's entry in the official MCP Registry.
Configuration
| Name | Set as | What it is |
|---|---|---|
XERO_ACCESS_TOKENRequired · Secret | Env var | Xero OAuth2 access token (Bearer). Obtain via Xero OAuth2 flow; rotate on expiry. |
XERO_TENANT_IDRequired | Env var | Xero tenant/organization id sent in the Xero-tenant-id header on every request. |
Files
@codespar/mcp-xero
MCP server for Xero — global cloud accounting for SMBs.
Xero is the #2 global SMB ERP and the leader in the UK, Australia, and New Zealand, with rapid expansion in the US. Paired with QuickBooks, the two platforms cover roughly 80% of global SMB accounting. For LatAm SaaS serving US/UK/AU/NZ customers or with international subsidiaries, Xero is the essential complement to our Brazil-native ERPs (Omie, Conta Azul, Bling, Tiny).
Tools (24)
| Tool | Purpose |
|---|---|
create_contact |
Create a Xero contact (customer or supplier — Xero uses one unified Contact object with IsCustomer/IsSuppli... |
get_contact |
Retrieve a single Xero contact by ContactID (UUID). |
list_contacts |
List Xero contacts. |
create_invoice |
Create an invoice in Xero. |
get_invoice |
Retrieve a single invoice by InvoiceID (UUID) or InvoiceNumber. |
list_invoices |
List invoices with optional Xero where-clause filtering. |
email_invoice |
Email an AUTHORISED invoice to the contact's email address on file. |
create_payment |
Record a payment against an invoice or credit note. |
create_item |
Create a Xero inventory/product item. |
list_items |
List all items/products in the Xero tenant. |
list_accounts |
List the Xero chart of accounts. |
update_contact |
Update an existing Xero contact. |
archive_contact |
Archive a Xero contact by setting ContactStatus=ARCHIVED. |
update_invoice |
Update an existing invoice. |
void_invoice |
Void an invoice by setting Status=VOIDED. |
get_payment |
Retrieve a single payment by PaymentID. |
list_payments |
List payments recorded in Xero. |
create_bank_transaction |
Create a bank transaction (SPEND = money out, RECEIVE = money in) directly on a bank account — for transact... |
list_bank_transactions |
List bank transactions (spend/receive entries on bank accounts). |
list_organisations |
Retrieve the Xero organisation(s) the access token has access to — returns name, base currency, country, fi... |
list_tax_rates |
List tax rates configured in the Xero tenant. |
create_credit_note |
Create a credit note. |
list_credit_notes |
List credit notes. |
get_balance_sheet |
Retrieve the Balance Sheet report for the tenant. |
Install
npm install @codespar/mcp-xero
Environment
XERO_ACCESS_TOKEN="..." # OAuth2 bearer access token (required, secret) XERO_TENANT_ID="..." # Xero tenant/organization id (required)
Authentication
Xero uses OAuth2. Every request includes:
Authorization: Bearer <XERO_ACCESS_TOKEN>
Xero-tenant-id: <XERO_TENANT_ID>
Accept: application/json
Content-Type: application/json
This server assumes a pre-issued access token. OAuth consent, refresh-token rotation, and tenant selection happen upstream (in your OAuth proxy or secrets layer). When the token expires, Xero returns 401 and the tool surfaces the error verbatim — refresh and retry.
Run
# stdio (default — Claude Desktop, Cursor, etc) npx @codespar/mcp-xero # HTTP (server-to-server testing) MCP_HTTP=true MCP_PORT=3000 npx @codespar/mcp-xero
Where clause
Xero's list endpoints accept a where query param for server-side filtering. Examples:
Name.Contains("ACME")
IsCustomer==true
Status=="AUTHORISED" AND Type=="ACCREC"
Date>=DateTime(2026,1,1)
Contact.ContactID==guid("00000000-0000-0000-0000-000000000000")
Positioning in the CodeSpar ERP catalog
- Brazil-native: Omie, Conta Azul, Bling, Tiny — NF-e, Simples Nacional, local tax.
- Global SMB: Xero + QuickBooks — US/UK/AU/NZ/global accounting.
Use Xero for companies headquartered or operating outside Brazil (or with international entities). Use the BR-native servers for the local market.
Docs
- Xero Accounting API: https://developer.xero.com/documentation/api/accounting
- Xero OAuth2 guide: https://developer.xero.com/documentation/guides/oauth2/overview
Enterprise
Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.
License
MIT
Facts
- Kind
- MCP server
- Group
- Uncategorized
- Stars
- 273
- License
- MIT
- Language
- TypeScript
- Last push
- 2026-09-27
- Forks
- 50
- MCP Registry
- io.github.codespar/mcp-xero
- Homepage
- codespar.dev/servers
- Topics
- agentic-commerce, ai-agents, brazil, claude, fintech, latin-america, llm-tools, mcp, model-context-protocol, nfe, open-finance, payments, pix
- 1REAio.github.morluto/reaReverse engineer anything from your terminal or agent with one CLI and MCP server.125.3k
- 2com.browser-use/browser-usecom.browser-use/browser-useControl a real Chrome browser to complete any task: fill forms, extract data, book flights.117.7k
- 3World Monitorapp.worldmonitor/mcpLive markets, conflicts, country risk, chokepoints, energy, and China decision signals. 93 tools.88.3k
- 4Scrapling MCP Serverd4vinci/scrapling🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scraplingdev86.9k
- 5Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
- 6Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k