xero-accounting-mcp
v0.1.1
Published
Xero Accounting MCP Server — full API passthrough with schema discovery
Readme
Xero Accounting MCP Server
A full-passthrough MCP server for the Xero Accounting API. Every Xero Accounting endpoint is accessible — not a curated subset.
Inspired by the ConnectWise RMM MCP pattern: load the official OpenAPI spec, expose schema discovery tools so the LLM can explore the API, and provide a generic xero_api_call tool that hits any endpoint.
What It Does
3 layers of access:
- Schema Discovery — The server loads Xero's official OpenAPI spec (v13.0.0, 138 paths). The LLM can browse available endpoints, search by keyword, and inspect parameters/schemas before making calls.
- Generic Passthrough —
xero_api_calllets you hit any Xero Accounting endpoint with any method, body, and query params. Full API, no restrictions. - Convenience Tools — Pre-built tools for common operations (P&L, Balance Sheet, Invoices, Contacts, etc.) so the LLM doesn't have to look up the path every time.
23 tools total:
| Category | Tools |
|---|---|
| Schema Discovery | xero_get_schema_overview, xero_get_endpoint_details, xero_search_endpoints |
| Generic Passthrough | xero_api_call |
| Reports | P&L, Balance Sheet, Budget Summary, Executive Summary, Trial Balance, Bank Summary, Aged Payables, Aged Receivables |
| Data | Organisation, Accounts, Invoices, Contacts, Journals, Tracking Categories, Tax Rates, Budgets, Bank Transactions, Payments, Credit Notes |
Requirements
- Node.js 18+
- A Xero app with client_credentials grant (Custom Connection in the Xero developer portal)
- Scopes:
accounting.reports.read,accounting.transactions.read,accounting.contacts.read,accounting.settings.read,accounting.budgets.read,accounting.journals.read - Your Xero tenant ID (found in the Xero developer portal under your connected tenant)
Install
Option 1: Clone and build locally
git clone https://github.com/mrsmickers/xero-mcp.git
cd xero-mcp
npm install
npm run buildOption 2: npx (no clone needed)
npx xero-accounting-mcpConfigure
Set these environment variables:
XERO_CLIENT_ID=your_client_id
XERO_CLIENT_SECRET=your_client_secret
XERO_TENANT_ID=your_tenant_idYou'll find the Client ID and Secret in the Xero Developer Portal under your Custom Connection app. The Tenant ID is shown when you connect a tenant to your app.
🤖 Ask Claude to Set It Up For You
Copy this prompt and paste it into Claude Code, Claude Desktop, or any Claude session:
Set up the Xero Accounting MCP server for me. The npm package is `xero-accounting-mcp`.
1. Ask me whether I want this for Claude Code, Claude Desktop, or Claude Cowork.
2. Help me get my Xero credentials:
- Go to https://developer.xero.com/app/manage and create or open a Custom Connection app
- Copy the Client ID and Client Secret
- Connect a tenant and copy the Tenant ID
3. If Claude Desktop/Cowork: add the MCP server config to claude_desktop_config.json
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
- Windows: %APPDATA%\Claude\claude_desktop_config.json
- Use npx so no global install is needed
4. If Claude Code: add it as an MCP server in .claude/settings.json or .mcp.json
5. Tell me to restart Claude after the config is savedNon-technical users can just say "set up the Xero MCP server" and Claude will walk them through it step by step — choosing where to install it, getting their Xero credentials, and writing the config.
Claude Desktop Setup
Add to your claude_desktop_config.json:
Local build:
{
"mcpServers": {
"xero": {
"command": "node",
"args": ["/absolute/path/to/xero-mcp/dist/index.js"],
"env": {
"XERO_CLIENT_ID": "your_client_id",
"XERO_CLIENT_SECRET": "your_client_secret",
"XERO_TENANT_ID": "your_tenant_id"
}
}
}
}npx:
{
"mcpServers": {
"xero": {
"command": "npx",
"args": ["-y", "xero-accounting-mcp"],
"env": {
"XERO_CLIENT_ID": "your_client_id",
"XERO_CLIENT_SECRET": "your_client_secret",
"XERO_TENANT_ID": "your_tenant_id"
}
}
}
}Claude Desktop config file locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
After editing, restart Claude Desktop completely.
Claude Code Setup
Add to your project's .mcp.json or global ~/.claude/settings.json:
{
"mcpServers": {
"xero": {
"command": "npx",
"args": ["-y", "xero-accounting-mcp"],
"env": {
"XERO_CLIENT_ID": "your_client_id",
"XERO_CLIENT_SECRET": "your_client_secret",
"XERO_TENANT_ID": "your_tenant_id"
}
}
}
}OpenClaw Setup
Add to your openclaw.yaml under mcpServers:
mcpServers:
xero:
command: node
args: [/path/to/xero-mcp/dist/index.js]
env:
XERO_CLIENT_ID: your_client_id
XERO_CLIENT_SECRET: your_client_secret
XERO_TENANT_ID: your_tenant_idUsage Examples
Once running, ask your LLM:
- "What Xero API endpoints are available for invoices?"
- "Get my P&L for this year so far"
- "Search Xero endpoints for bank reconciliation"
- "Call the Xero API to get invoice INV-01234"
The LLM will use schema discovery tools to find the right endpoint, then xero_api_call or a convenience tool to execute.
Rate Limits
Xero enforces:
- 60 calls/min per tenant
- 5,000 calls/day (Core+ tier)
- 5 concurrent requests max
- On 429: respect
Retry-Afterheader
License
ISC
