The Xero MCP Server provides a bridge between the Model Context Protocol and Xero's API, enabling standardized access to Xero's accounting and business features. It allows you to manage contacts, chart of accounts, invoices, and more through the MCP protocol.
If you don't have a Xero account already:
Note: For Payroll-specific queries, set the region to either NZ or UK.
The server supports two authentication methods:
This approach is ideal for development and works well with third-party MCP clients like Claude Desktop.
Add the MCP server to Claude Desktop by editing your configuration:
claude_desktop_config.json
file:{
"mcpServers": {
"xero": {
"command": "npx",
"args": ["-y", "@xeroapi/xero-mcp-server@latest"],
"env": {
"XERO_CLIENT_ID": "your_client_id_here",
"XERO_CLIENT_SECRET": "your_client_secret_here"
}
}
}
}
Note for NVM users: If you're using Node Version Manager, change the "command": "npx"
to use the full path to the executable:
your_home_directory/.nvm/versions/node/v22.14.0/bin/npx
your_home_directory\\.nvm\\versions\\node\\v22.14.0\\bin\\npx
Better for supporting multiple Xero accounts at runtime:
{
"mcpServers": {
"xero": {
"command": "npx",
"args": ["-y", "@xeroapi/xero-mcp-server@latest"],
"env": {
"XERO_CLIENT_BEARER_TOKEN": "your_bearer_token"
}
}
}
}
Note: The XERO_CLIENT_BEARER_TOKEN
takes precedence over XERO_CLIENT_ID
if both are defined.
list-accounts
- Retrieve chart of accountslist-contacts
- Retrieve contacts from Xerolist-credit-notes
- Retrieve credit noteslist-invoices
- Retrieve invoiceslist-items
- Retrieve items/productslist-organisation-details
- Retrieve organization infolist-profit-and-loss
- Retrieve profit and loss reportlist-quotes
- Retrieve quoteslist-tax-rates
- Retrieve tax rateslist-payments
- Retrieve paymentslist-trial-balance
- Retrieve trial balance reportlist-bank-transactions
- Retrieve bank transactionslist-payroll-employees
- Retrieve payroll employeeslist-report-balance-sheet
- Retrieve balance sheet reportlist-payroll-employee-leave
- Retrieve employee leave recordslist-payroll-employee-leave-balances
- Retrieve employee leave balanceslist-payroll-employee-leave-types
- Retrieve employee leave typeslist-payroll-leave-periods
- Retrieve employee leave periodslist-payroll-leave-types
- Retrieve all available leave typeslist-aged-receivables-by-contact
- Retrieve aged receivables for a contactlist-aged-payables-by-contact
- Retrieve aged payables for a contactlist-contact-groups
- Retrieve contact groupscreate-contact
- Create a new contactcreate-credit-note
- Create a new credit notecreate-invoice
- Create a new invoicecreate-payment
- Create a new paymentcreate-quote
- Create a new quotecreate-payroll-timesheet
- Create a payroll timesheetupdate-contact
- Update an existing contactupdate-invoice
- Update a draft invoiceupdate-quote
- Update a draft quoteupdate-credit-note
- Update a draft credit noteupdate-payroll-timesheet-line
- Update a timesheet lineapprove-payroll-timesheet
- Approve a timesheetrevert-payroll-timesheet
- Revert an approved timesheetadd-payroll-timesheet-line
- Add a line to a timesheetdelete-payroll-timesheet
- Delete a timesheetget-payroll-timesheet
- Retrieve a timesheetFor more detailed information about these commands and their parameters, refer to the MCP Protocol Specification.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "xero" '{"command":"npx","args":["-y","@xeroapi/xero-mcp-server@latest"],"env":{"XERO_CLIENT_ID":"${XERO_CLIENT_ID}","XERO_CLIENT_SECRET":"${XERO_CLIENT_SECRET}"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"xero": {
"command": "npx",
"args": [
"-y",
"@xeroapi/xero-mcp-server@latest"
],
"env": {
"XERO_CLIENT_ID": "${XERO_CLIENT_ID}",
"XERO_CLIENT_SECRET": "${XERO_CLIENT_SECRET}"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"xero": {
"command": "npx",
"args": [
"-y",
"@xeroapi/xero-mcp-server@latest"
],
"env": {
"XERO_CLIENT_ID": "${XERO_CLIENT_ID}",
"XERO_CLIENT_SECRET": "${XERO_CLIENT_SECRET}"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect