Official Xero MCP Server for Business Accounting Data
Connect to the official Xero MCP server to manage and sync your business accounting data securely and efficiently.
npx -y @XeroAPI/xero-mcp-serverOverview
The Official Xero MCP Server provides a standardized, developer-friendly bridge between Xero accounting data and systems that consume model-oriented contexts (for example, LLMs, automation agents, or syncing tools). It exposes business accounting entities—contacts, invoices, accounts, payments, etc.—in a consistent JSON model format and includes helpers for incremental sync, filtering, and authorization with Xero.
For developers building integrations, the MCP server reduces the friction of querying raw accounting APIs, normalizes common data shapes, and provides a predictable HTTP surface for retrieving and streaming accounting context. This makes it easier to build assistants, reporting tools, or data sync processes that rely on up-to-date Xero data without reimplementing pagination, rate-limit handling, or object mapping.
Features
- Standardized JSON model views for common Xero entities (contacts, invoices, accounts, payments).
- Incremental sync support to fetch only changed records since a given timestamp.
- OAuth2-ready configuration to connect securely to Xero organizations.
- Local and containerized deployment options for development and production.
- Simple REST endpoints that return ready-to-consume model context for downstream systems.
- Extensible mapping layer so you can transform or enrich Xero data before exposing it.
Installation / Configuration
Minimum steps to get the server running locally. These instructions assume a Node.js-based server (common for this project); adapt if using another runtime.
- Clone the repository
- Install dependencies
# using npm
# or using yarn
- Create a .env (or equivalent) with the required settings. Example:
# .env
PORT=3000
XERO_CLIENT_ID=your_client_id
XERO_CLIENT_SECRET=your_client_secret
XERO_REDIRECT_URI=http://localhost:3000/oauth/callback
DEFAULT_TENANT_ID=your_tenant_id # optional; used to target a specific organization
LOG_LEVEL=info
- Start the server
# or in development mode with auto-reload
- (Optional) Run with Docker
Configuration variables
| Variable | Purpose |
|---|---|
| PORT | HTTP port for the server |
| XERO_CLIENT_ID | OAuth2 client ID from Xero app settings |
| XERO_CLIENT_SECRET | OAuth2 client secret |
| XERO_REDIRECT_URI | Redirect URI registered with your Xero app |
| DEFAULT_TENANT_ID | (Optional) Tenant ID to use for direct requests |
| LOG_LEVEL | Logging verbosity (info, debug, error) |
Available Tools / Resources
- Official repository: https://github.com/XeroAPI/xero-mcp-server
- Example clients: look for sample Node.js/Python clients in the repo to see how to call endpoints and handle authentication.
- Postman / OpenAPI: check the repository for an OpenAPI spec or Postman collection to explore endpoints interactively.
- Dockerfile and Compose examples for containerized deployments.
Endpoints (typical examples)
The server exposes REST endpoints that return JSON model contexts. Specific paths may vary; consult the repo’s API spec. Example patterns:
- GET /health — health check
- GET /models — list supported model types
- GET /context/:model — retrieve model context (e.g., /context/invoices)
- GET /sync/:model?since=2023-01-01T00:00:00Z — incremental sync
Example curl to fetch invoice context:
Use Cases
- LLM-driven assistants for finance: Provide a conversational agent with normalized invoice, contact, and account context so it can answer questions like “Which customers have overdue invoices?” without calling multiple raw Xero APIs.
- Automated reconciliation workflows: Periodically pull incremental payment and invoice contexts to drive reconciliation processes in an ERP or workflow engine.
- BI and reporting pipelines: Export model-formatted data to analytics platforms with consistent shapes, minimizing transformation code in ETL.
- Multi-tenant sync: Host one MCP server instance that handles authorization for multiple Xero tenants and exposes per-tenant contexts for downstream services.
- Testing and sandboxing: Use the local/server instance as a stable interface for integration tests that need realistic accounting data models without coupling to the raw Xero API surface.
Getting started checklist
- Register a Xero app and obtain client credentials.
- Clone the repository and set environment variables (.env).
- Start the server locally or in a container.
- Use the included sample client or curl to fetch model contexts.
- Extend mapping or add endpoints as needed for custom enrichment.
For full API details, examples, and deployment patterns, see the repository on GitHub: https://github.com/XeroAPI/xero-mcp-server.