The official Xero MCP server bridges the MCP protocol and Xero's API, so an AI client can read invoices, contacts, reports and more from your accounting data. Here is the setup for Claude Desktop and Cursor.
Step 1 — create a Xero custom connection
For use in a third-party MCP client (Claude Desktop, Cursor), Xero recommends a Custom Connection — a machine-to-machine OAuth app scoped to one organisation:
- In the Xero Developer portal, create a new app and choose Custom connection.
- Select the scopes you need (e.g.
accounting.transactions.read,accounting.contacts.read). Scopes differ depending on when the connection was created — follow Xero's current docs. - Note the client ID and client secret.
Step 2 — configure the client
{
"mcpServers": {
"xero": {
"command": "npx",
"args": ["-y", "@xeroapi/xero-mcp-server@latest"],
"env": {
"XERO_CLIENT_ID": "your-client-id",
"XERO_CLIENT_SECRET": "your-client-secret"
}
}
}
}
Restart the client; see MCP config file location.
Step 3 — verify
Ask: "List my 10 most recent invoices and their statuses." Real accounting data back confirms the connection and scopes.
Common problems
unauthorized_client/ invalid credentials — wrong client ID/secret, or the custom connection was not activated.insufficient scope— the requested action needs a scope you did not grant; add it and reconnect.- Wrong organisation — a custom connection is tied to a single org; create another connection for a different org.
- No tools in client — Node 18+ required; see Cursor MCP not working.
Security
Accounting data is highly sensitive. Grant read-only scopes unless the AI genuinely needs to create records, and store the client secret securely — never inline it in a shared repo. See MCP security best practices.
Going further
Xero pairs with a spreadsheet/Excel server for finance analysis. Browse the finance category or a curated loadout. Built an accounting server? Submit it.