Xero (codespar)

Finance and commerce

MCP server for Xero, global cloud accounting: contacts, invoices, payments, items, reports.

Your AI app calls the Xero (codespar) MCP server, which does the finance and commerce work and sends the result back to the chat.

About Xero (codespar)

Xero (codespar) is a community MCP server from codespar, filed in our directory under finance and commerce. MCP server for Xero, global cloud accounting: contacts, invoices, payments, items, reports.

Xero (codespar) runs on your own machine: your AI app starts it with the command npx -y @codespar/mcp-xero@0.2.2 and talks to it over standard input and output. It needs XERO_ACCESS_TOKEN and XERO_TENANT_ID set before Xero (codespar) starts.

Xero (codespar) is listed in the official MCP registry as io.github.codespar/mcp-xero, version 0.2.2.

At a glance

Publisher
codespar (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @codespar/mcp-xero
Written in
TypeScript
License
MIT
GitHub stars
278
Official MCP registry
io.github.codespar/mcp-xero

How to set up Xero (codespar)

  1. Install Node.js on the machine that runs your AI app, because Xero (codespar) starts with npx and downloads its package on first run.
  2. Create XERO_ACCESS_TOKEN and XERO_TENANT_ID for Xero (codespar) in the connected service's own settings, scoped to the smallest permissions the job needs.
  3. Add Xero (codespar) to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Xero (codespar) tools to confirm the connection.
  5. Run one read-only task with Xero (codespar) first, and keep your app asking before each tool call until the results look right.

Xero (codespar) compared with similar servers

  • Z API by codespar has fewer GitHub stars than Xero (codespar) (278 against 278); both are community servers, and both run locally.
  • X402 by codespar has fewer GitHub stars than Xero (codespar) (278 against 278); both are community servers, and both run locally.
  • Zoop by codespar has fewer GitHub stars than Xero (codespar) (278 against 278); both are community servers, and both run locally.

Before you connect Xero (codespar)

  • Give Xero (codespar) its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Xero (codespar) tool call until you trust what it does with them.
  • Treat text that Xero (codespar) fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Xero (codespar) on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Xero (codespar)

How marketing and sales teams put Xero (codespar) to work, by company size. Pick the size closest to yours and start Xero (codespar) on one use case.

Small business

  • A small business can ask Xero (codespar) which products and customers drive margin, then plan promotions around them.
  • Owners can use Xero (codespar) to check refunds, failed payments and churn reasons without opening three dashboards.
  • Xero (codespar) runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Ecommerce teams can connect Xero (codespar) to tie campaigns to orders and revenue, not just clicks.
  • Marketing and finance can use Xero (codespar) to check spend against budget each week and move money to what's working.
  • Start Xero (codespar) on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises should keep Xero (codespar) read-only for agents, with any money movement handled by people and existing approvals.
  • Large commerce teams can use Xero (codespar) to answer revenue questions by channel and region with figures finance signs off on.
  • Xero (codespar) is a community server, so have security review the code and pin a version before Xero (codespar) touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Xero (codespar) README

From codespar/mcp-dev-latam on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

@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

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

Questions about Xero (codespar)

What is the Xero (codespar) MCP server?

MCP server for Xero, global cloud accounting: contacts, invoices, payments, items, reports. Xero (codespar) is maintained by codespar on GitHub at codespar/mcp-dev-latam, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Xero (codespar) MCP server?

Add Xero (codespar) to your AI app's MCP config with the command npx -y @codespar/mcp-xero@0.2.2. In Claude Code, run claude mcp add --transport stdio codespar-xero -- npx -y @codespar/mcp-xero@0.2.2. To run Xero (codespar) this way you need Node.js installed.

Does Xero (codespar) need an API key?

Yes. Xero (codespar) expects XERO_ACCESS_TOKEN and XERO_TENANT_ID to be set. Create the key for Xero (codespar) in the connected service's own settings, give it the smallest permissions the job needs, and keep it out of shared config files.

Is Xero (codespar) an official MCP server?

No. Xero (codespar) is a community server maintained by codespar. Community servers can be excellent; read the code and the open issues before you give Xero (codespar) access to company data.

What license is Xero (codespar) under?

Xero (codespar) is released under the MIT license, according to its GitHub repository. The license covers the code of Xero (codespar); the service it connects to has its own terms.