Back to MCP Catalog

Xero Accounting MCP Server

Finance & FintechTypeScript
Access and manage Xero accounting data through a standardized MCP interface
Available Tools

listContacts

List contacts in your Xero organization

whereorderpageincludeArchived

getContact

Get details of a specific contact by ID

contactId

createContact

Create a new contact in Xero

namefirstNamelastNameemailAddressphones

updateContact

Update an existing contact in Xero

contactIdnamefirstNamelastNameemailAddressphones

listContactGroups

List contact groups in your Xero organization

contactGroupId

listAccounts

List accounts in your chart of accounts

whereorder

getAccount

Get details of a specific account by ID

accountId

createInvoice

Create a new invoice in Xero

typecontactlineItemsdatedueDatereference

listInvoices

List invoices in your Xero organization

whereorderpagestatuses

getInvoice

Get details of a specific invoice by ID

invoiceId

listOrganisations

List organizations you have access to in Xero

The Xero MCP server provides a bridge between the Model Context Protocol and Xero's accounting API. It enables AI assistants to interact with Xero's accounting platform, allowing for contact management, chart of accounts access, invoice creation, and other accounting operations. With this integration, you can leverage Xero's powerful accounting features directly through AI assistants that support the MCP protocol. The server handles authentication, data formatting, and API interactions, making it easy to perform accounting tasks programmatically.

Overview

The Xero MCP server provides a standardized interface for AI assistants to interact with Xero's accounting platform. This integration allows you to manage contacts, access chart of accounts, create and manage invoices, and perform other accounting operations directly through AI assistants that support the Model Context Protocol.

Prerequisites

Before setting up the Xero MCP server, you'll need:

  • Node.js v18 or higher
  • npm or pnpm package manager
  • A Xero developer account with API credentials
  • A Xero organization (a Demo Company is recommended for testing)

Installation

Option 1: Install from npm

npm install @xeroapi/xero-mcp-server

Option 2: Clone the repository

git clone https://github.com/XeroAPI/xero-mcp-server.git
cd xero-mcp-server
npm install

Configuration

  1. Create a .env file in the root directory based on the .env.example file.

  2. Set up authentication using one of the two supported methods:

Authentication Method 1: Custom Connections (Recommended for testing)

This method is ideal for development and testing, allowing you to specify client ID and secrets for a specific organization.

  1. Set up a Custom Connection in your Xero Developer account:

    • Go to https://developer.xero.com/documentation/guides/oauth2/custom-connections/
    • Create a new app and configure it with the required scopes
    • Note your client ID and client secret
  2. Update your .env file with the following:

    XERO_CLIENT_ID=your_client_id
    XERO_CLIENT_SECRET=your_client_secret
    XERO_REDIRECT_URI=http://localhost:8080/callback
    
  3. Start the server and complete the authentication flow:

    npm start
    
  4. Follow the authentication prompts in your terminal to authorize the connection.

Authentication Method 2: Bearer Token (For production use)

For production environments or when integrating with existing authentication systems:

  1. Update your .env file with:

    XERO_BEARER_TOKEN=your_bearer_token
    
  2. Ensure your bearer token has the necessary scopes for the operations you plan to perform.

Running the Server

Start the server with:

npm start

By default, the server runs on port 8080. You can change this by setting the PORT environment variable.

Integrating with AI Assistants

To use the Xero MCP server with AI assistants that support the Model Context Protocol:

  1. Ensure your server is running and authenticated with Xero
  2. Configure your AI assistant to connect to the MCP server endpoint (typically http://localhost:8080)
  3. The AI assistant can now make requests to Xero through the MCP protocol

Troubleshooting

  • Authentication Issues: Ensure your client ID, client secret, and redirect URI are correctly configured. For Custom Connections, make sure you've completed the authorization flow.
  • Permission Errors: Verify that your Xero account has the necessary permissions for the operations you're trying to perform.
  • API Rate Limits: Be aware of Xero's API rate limits, especially when making multiple requests in quick succession.

Additional Resources

Related MCPs

TastyTrade Portfolio Manager
Finance & FintechPython

Manage your TastyTrade brokerage account through Claude

Investor Agent
Finance & FintechPython

Financial analysis and investment insights for LLMs

Bankless Onchain
Finance & FintechTypeScript

Access and interact with blockchain data through the Bankless API

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.