mcpField
M
mcp-xero

mcp-xero

Local
github.com/codesparFinance275Updated 4w ago

About mcp-xero

mcp-xero is an MCP server for Xero, a cloud accounting platform for small and mid-sized businesses. It targets companies operating outside Brazil and complements the Brazil-native ERP servers in the CodeSpar catalog.

Key features

  1. 01Create, query and archive contacts
  2. 02Create, email and void invoices
  3. 03Record payments and credit notes
  4. 04Query items, chart of accounts and tax rates
  5. 05Read the Balance Sheet report

Use cases

  1. 01Issue invoices to customers in the US, UK, AU or NZ
  2. 02Record payments and bank transactions for overseas entities

MCP support

The server exposes Xero Accounting API operations as MCP tools, using a pre-issued OAuth2 access token supplied by the environment.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"codespar-mcp-xero": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-xero"
],
"env": {
"XERO_ACCESS_TOKEN": "<XERO_ACCESS_TOKEN>",
"XERO_TENANT_ID": "<XERO_TENANT_ID>"
}
}
}
}
Run commandnpx -y @codespar/mcp-xero
Environment variables to set
XERO_ACCESS_TOKENSecretXero OAuth2 access token (Bearer). Obtain via Xero OAuth2 flow; rotate on expiry.
XERO_TENANT_IDXero tenant/organization id sent in the Xero-tenant-id header on every request.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@codespar/mcp-xero0.2.2

Tools

24

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
NamestringYesFull name of the contact. Required and must be unique within the tenant.
PhonesarrayNoArray of phone objects with PhoneType (DEFAULT/DDI/MOBILE/FAX), PhoneNumber, PhoneAreaCode, PhoneCountryCode.
LastNamestringNoContact last name (for individuals).
AddressesarrayNoArray of address objects with AddressType (POBOX/STREET), AddressLine1..4, City, Region, PostalCode, Country.
FirstNamestringNoContact first name (for individuals).
TaxNumberstringNoTax number (VAT, ABN, GST, EIN, etc.) — country-dependent.
IsCustomerbooleanNoHint that this contact is a customer.
IsSupplierbooleanNoHint that this contact is a supplier.
EmailAddressstringNoPrimary email address.
AccountNumberstringNoMerchant-side account number for this contact.
ContactNumberstringNoExternal system identifier (max 50 chars).
DefaultCurrencystringNoISO-4217 currency code used as default on invoices for this contact.

Details

From the project README

@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)

ToolPurpose
create_contactCreate a Xero contact (customer or supplier — Xero uses one unified Contact object with IsCustomer/IsSuppli...
get_contactRetrieve a single Xero contact by ContactID (UUID).
list_contactsList Xero contacts.
create_invoiceCreate an invoice in Xero.
get_invoiceRetrieve a single invoice by InvoiceID (UUID) or InvoiceNumber.
list_invoicesList invoices with optional Xero where-clause filtering.
email_invoiceEmail an AUTHORISED invoice to the contact's email address on file.
create_paymentRecord a payment against an invoice or credit note.
create_itemCreate a Xero inventory/product item.
list_itemsList all items/products in the Xero tenant.
list_accountsList the Xero chart of accounts.
update_contactUpdate an existing Xero contact.
archive_contactArchive a Xero contact by setting ContactStatus=ARCHIVED.
update_invoiceUpdate an existing invoice.
void_invoiceVoid an invoice by setting Status=VOIDED.
get_paymentRetrieve a single payment by PaymentID.
list_paymentsList payments recorded in Xero.
create_bank_transactionCreate a bank transaction (SPEND = money out, RECEIVE = money in) directly on a bank account — for transact...
list_bank_transactionsList bank transactions (spend/receive entries on bank accounts).
list_organisationsRetrieve the Xero organisation(s) the access token has access to — returns name, base currency, country, fi...
list_tax_ratesList tax rates configured in the Xero tenant.
create_credit_noteCreate a credit note.
list_credit_notesList credit notes.
get_balance_sheetRetrieve 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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.