mcp-xero — Claude Code MCP server: what it does, how to install
Connects Xero cloud accounting to your AI assistant. Lets you issue invoices, record payments, and inspect balance sheets directly in chat.
claude mcp add mcp-xero -e XERO_ACCESS_TOKEN=<XERO_ACCESS_TOKEN> -e XERO_TENANT_ID=<XERO_TENANT_ID> -- npx -y @codespar/mcp-xeroWhat mcp-xero does
The server exposes 24 tools to interact with Xero accounting. An assistant can look up contacts, draft invoices, void records, email authorized invoices to clients, and log bank transactions. It also pulls financial reports like the balance sheet and inspects the chart of accounts.
Authentication requires two environment variables: XERO_ACCESS_TOKEN and XERO_TENANT_ID. The server expects an already issued bearer token. Upstream services must handle OAuth token refreshes. Once a token expires, API calls fail with a 401 status.
It runs over stdio with npx -y @codespar/mcp-xero. List tools support server-side filtering via the standard Xero where query parameter.
What it helps with
- generate and email invoices to customers
- pull balance sheet reports into chat
- record payments and bank transactions
- filter and manage client contact records
Example prompts for the agent
- List all unpaid invoices in Xero with status AUTHORISED
- Create a new contact for ACME Corp and draft an invoice
- Fetch the balance sheet report for my organization
How to install mcp-xero
Platform CLI
claude mcp add mcp-xero -e XERO_ACCESS_TOKEN=<XERO_ACCESS_TOKEN> -e XERO_TENANT_ID=<XERO_TENANT_ID> -- npx -y @codespar/mcp-xeroReplace <…> with your own values
Platform CLI
codex mcp add xero --env XERO_ACCESS_TOKEN=<XERO_ACCESS_TOKEN> --env XERO_TENANT_ID=<XERO_TENANT_ID> -- npx -y @codespar/mcp-xeroReplace <…> with your own values
Config file
{
"mcpServers": {
"xero": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-xero"
],
"env": {
"XERO_ACCESS_TOKEN": "<XERO_ACCESS_TOKEN>",
"XERO_TENANT_ID": "<XERO_TENANT_ID>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"xero": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@codespar/mcp-xero"
],
"env": {
"XERO_ACCESS_TOKEN": "<XERO_ACCESS_TOKEN>",
"XERO_TENANT_ID": "<XERO_TENANT_ID>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e XERO_ACCESS_TOKEN=<XERO_ACCESS_TOKEN> -e XERO_TENANT_ID=<XERO_TENANT_ID> xero npx -y @codespar/mcp-xeroReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mcp-xero
How to install mcp-xero in Claude Code?
Run claude mcp add mcp-xero -e XERO_ACCESS_TOKEN=<XERO_ACCESS_TOKEN> -e XERO_TENANT_ID=<XERO_TENANT_ID> -- npx -y @codespar/mcp-xero. Replace the placeholders with your valid OAuth token and tenant ID.
What does mcp-xero do?
It provides 24 tools for interacting with Xero. Assistants can create invoices, register incoming payments, inspect accounts, and read balance sheets.
How does authentication work in mcp-xero?
The server relies on a pre-generated token passed via XERO_ACCESS_TOKEN. Refresh-token handling must live outside this server, because it passes through 401 errors without rotating credentials.