Xero MCP Server
Project description
Xero MCP
A Model Context Protocol server that provides access to Xero's accounting API. This server enables LLMs to interact with Xero's financial data, reports, and accounting resources.
Installation and Setup
-
Install Claude Desktop from the official website
-
Install UV and uvx:
# Install UV following the official guide curl -LsSf https://astral.sh/uv/install.sh | sh # Install uvx using UV uv pip install uvx
-
Find your
uvxpath by running:which uvxThis will output something like:
- Unix/macOS:
/Users/<username>/.local/bin/uvx - Windows: Run
where uvxinstead
- Unix/macOS:
-
Get Xero API Credentials:
- Go to Xero Developer Portal
- Create a new app
- Set redirect URI to:
http://localhost:8000/callback - Copy Client ID and Client Secret
-
Configure Claude Desktop:
- Open your
claude_desktop_config.json - Add the following to the "mcpServers" section, replacing the
commandvalue with youruvxpath from step 3:
- Open your
{
"mcpServers": {
"Xero App": {
"command": "YOUR_UVX_PATH_HERE",
"args": [
"xero-mcp"
],
"env": {
"XERO_CLIENT_ID": "your_client_id",
"XERO_CLIENT_SECRET": "your_client_secret"
}
}
}
}
For example, if which uvx returned /Users/username/.local/bin/uvx, your config would look like:
{
"mcpServers": {
"Xero App": {
"command": "/Users/username/.local/bin/uvx",
"args": [
"--from",
"git+https://github.com/semicolonio/xero-mcp.git",
"xero-mcp"
],
"env": {
"XERO_CLIENT_ID": "your_client_id",
"XERO_CLIENT_SECRET": "your_client_secret"
}
}
}
}
Note: Replace your_client_id and your_client_secret with your Xero API credentials
Authentication
The server handles OAuth2 authentication automatically:
- On first use, it opens your browser
- Log in to your Xero account
- Grant requested permissions
- Tokens are securely stored and auto-refreshed
Components
Tools
Financial Reports
-
xero_get_balance_sheet- Retrieve balance sheet report with assets, liabilities, and equity
- Input:
date(string): Report date in YYYY-MM-DD format - Optional:
periods,timeframe,tracking_options
-
xero_get_profit_and_loss- Retrieve profit and loss statement
- Input:
from_date,to_date(string): Date range in YYYY-MM-DD format - Optional:
periods,timeframe,tracking_categories
-
xero_get_bank_summary- Get bank account balances and movements
- Optional:
from_date,to_datefor specific period
Data Access
-
xero_get_accounts- List all accounts in the chart of accounts
- Optional:
wherefilter condition
-
xero_get_contacts- Retrieve customer and supplier contacts
- Optional:
where,page,search_term,include_archived
-
xero_get_bank_transactions- View bank transactions
- Optional:
where,order,page,modified_after
-
xero_get_invoices- Access invoice data
- Optional: Multiple filter options including
where,order,page,statuses
Aging Reports
-
xero_get_aged_payables_by_contact- View aged payables for a specific contact
- Input:
contact_id(string) - Optional:
date,from_date,to_date
-
xero_get_aged_receivables_by_contact- View aged receivables for a specific contact
- Input:
contact_id(string) - Optional:
date,from_date,to_date
Usage with Claude Desktop
To use this server with Claude Desktop, add the following configuration to the "mcpServers" section of your claude_desktop_config.json:
Using uvx (Recommended)
{
"mcpServers": {
"Xero App": {
"command": "/Users/nasir/.cargo/bin/uvx",
"args": [
"--from",
"git+https://github.com/semicolonio/xero-mcp.git",
"xero-mcp"
],
"env": {
"XERO_CLIENT_ID": "your_client_id",
"XERO_CLIENT_SECRET": "your_client_secret"
}
}
}
}
Notes:
- Replace
your_client_idandyour_client_secretwith your Xero API credentials - The server requires OAuth2 authentication on first use
Prerequisites
- Install uvx:
cargo install uvx
- Get Xero API Credentials:
- Go to Xero Developer Portal
- Create a new app
- Set redirect URI to:
http://localhost:8000/callback - Copy Client ID and Client Secret
Example Usage
# Get all bank accounts
accounts = await xero_get_accounts(where='Type=="BANK"')
# Get balance sheet for specific date
balance_sheet = await xero_get_balance_sheet(date="2024-01-31")
# Get recent bank transactions
transactions = await xero_get_bank_transactions(
where='Type=="SPEND"',
order="Date DESC",
page=1
)
Data Storage
The server maintains a local SQLite database (config/xero_analytics.db) for:
- Token management
- Sync statistics
- Cache optimization
Error Handling
Built-in handling for common issues:
- API rate limits
- Network connectivity
- Authentication failures
- Invalid parameters
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xero_mcp-0.1.3.tar.gz.
File metadata
- Download URL: xero_mcp-0.1.3.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.30
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
869d90beb22f9906ee4ff548d0ec339babc9b14e410cf4c85ed7e862ab18fee4
|
|
| MD5 |
2398cb117130039df4496a314f475f05
|
|
| BLAKE2b-256 |
8c4ca0f23fa4d104dd23cc3a7179a9182f4a5fd8eed3857385e6c25657d48554
|
File details
Details for the file xero_mcp-0.1.3-py3-none-any.whl.
File metadata
- Download URL: xero_mcp-0.1.3-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.30
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b120571a68d200f3a0d08682e34d00d6866841071a6e6de8e75a135054ec13ff
|
|
| MD5 |
651baf7e01c785a37dbf3603e408d5b2
|
|
| BLAKE2b-256 |
f9293339b9023e53cee492a4f16ed8d8cd76050e976a77e31c6174fb4bc3332d
|