Skip to main content
X

Xero

@codespar/mcp-xero Β· v0.2.2

🌐 GlobalERPAuth · OAuth2beta24 tools2 env vars

Global accounting, #2 ERP (UK/AU/NZ leader). Contacts, invoices, payments, items, accounts, balance sheet. Together with QuickBooks covers ~80% of global SMB accounting.

Get started Β· freeView docs

MIT Β· runs locally with your own credentials

Limitations

  • Hosted calls with a test key are not available: the runtime has not recorded this provider's test behaviour (test venue unclassified).
Package
@codespar/mcp-xero
Version
0.2.2
npm dist-tag
latest
Category
ERP
Auth
OAuth2
Country
🌐 Global
License
MIT
Transport
stdio Β· streamable-http

Quickstart

Install, set the credentials, make the first call.

Pick your client. The server runs locally over stdio, with your own credentials.

Add the server to your clientOne config entry. No build step, no SDK required.
Set the environment variables2 variables read by this server's code, listed below.
Restart and make the first callThe agent can call any of the 24 tools. Try create_contact first.
terminal
# Claude Code claude mcp add xero -e XERO_ACCESS_TOKEN=… -e XERO_TENANT_ID=… -- npx -y @codespar/mcp-xero@0.2.2 # then: /mcp to confirm the server is connected
Environment variables2 variables
XERO_ACCESS_TOKENXero OAuth2 access token (Bearer). Obtain via Xero OAuth2 flow; rotate on expiry.requiredsecret
XERO_TENANT_IDXero tenant/organization id sent in the Xero-tenant-id header on every request.required

Names read from the package code (@codespar/mcp-xero@0.2.2). Descriptions and flags come from its manifest. Self-hosted, you hold the credentials.

First call democreate_contact

"Create a Xero contact"

tools/callcreate_contactresult returned

Tools

What your agent can call.

24 tools, as the package's tools/list returns them.

create_contact

Create a Xero contact (customer or supplier β€” Xero uses one unified Contact object with IsCustomer/IsSupplier flags inferred from transactions).

get_contact

Retrieve a single Xero contact by ContactID (UUID).

list_contacts

List Xero contacts. Supports Xero's where clause for server-side filtering (e.g. 'Name=="ACME Ltd"', 'IsCustomer==true').

create_invoice

Create an invoice in Xero. Type ACCREC = accounts-receivable (sales invoice to a customer), ACCPAY = accounts-payable (bill from a supplier). Default Status=DRAFT; set AUTHORISED to issue immediately.

get_invoice

Retrieve a single invoice by InvoiceID (UUID) or InvoiceNumber.

list_invoices

List invoices with optional Xero where-clause filtering. Common filters: Status=="AUTHORISED", Type=="ACCREC", Contact.ContactID==guid("..."), Date>=DateTime(2026,1,1).

email_invoice

Email an AUTHORISED invoice to the contact's email address on file. Xero uses the default invoice email template. No body required.

create_payment

Record a payment against an invoice or credit note. Reduces the invoice's AmountDue and posts to the specified bank/payment account.

create_item

Create a Xero inventory/product item. Items can be sales-only, purchase-only, or tracked inventory (requires IsTrackedAsInventory + InventoryAssetAccountCode).

list_items

List all items/products in the Xero tenant. Supports where clause, e.g. 'IsSold==true'.

list_accounts

List the Xero chart of accounts. Use this to discover AccountCodes/AccountIDs needed for invoice line items and payments.

update_contact

Update an existing Xero contact. POSTs to /Contacts/{ContactID}. Only include fields you want changed; Xero merges updates.

Names and descriptions come from the package's tools/list (@codespar/mcp-xero@0.2.2). A kind (read, write, delete) is shown only when the package annotates its tools or each tool was verified one by one; neither exists for this server yet.

Compatibility

MCP is a protocol. Any client that speaks it can mount this server.

codespar_discover lists this server's tools, but a project with a test key cannot call them yet: the runtime has not recorded what this provider does in test mode, and refuses rather than guess.

Protocol

Any MCP client

stdio Β· streamable-http

Questions

Before you install.

How do I install the Xero MCP server?

Run npx -y @codespar/mcp-xero@0.2.2 and add the config block above to your MCP client: Claude Code, Cursor, Claude Desktop, VS Code, or any MCP-compatible client. No build step, no SDK required.

What can my agent do with Xero?

Xero exposes 24 tools for erp. Your agent calls them directly; the full list is above.

How does Xero authenticate, and how are credentials stored?

Xero uses OAuth2. Self-hosted, you hold the credentials: the server reads them from its environment variables.

How does Xero handle upstream API changes?

Every server is versioned independently on npm. The command on this page pins 0.2.2, the version whose tools are listed here; your agent keeps running it until you change the version.

Is Xero open source? How do I report a bug?

Yes. Xero is MIT-licensed and published on npm as @codespar/mcp-xero, source on GitHub (link in the Details panel). Report issues on the package repository; security issues go to security@codespar.dev, and we respond within 24 hours.

Start in seconds.

Add the config above, set the variables, and your agent calls the tools.

Start in seconds demo
Add the server to your client with the config above.
Set the environment variables listed above.
Ask your agent for the first call.
Xero β€” MCP server Β· 24 tools | CodeSpar