Connector guide6-minute read10 MCP tools7 languages

How to Connect Xero to Gemini via MCP

Let your AI read your Xero books: sales invoices and supplier bills, customer and supplier contacts, the chart of accounts, the Trial Balance and the Profit and Loss with period comparisons, on an accrual or cash basis. Read-only, with your own Xero OAuth2 app and a sign-in through Authorize with Provider.

HCBy HelpCode teamUpdated 6 min read Open-source on GitHub

No credit card · 7-day trial · Self-host alternative available

Xero

Xero

Read a Xero organisation's invoices, bills, contacts, chart of accounts, Trial Balance and Profit and Loss reports. 10 GET-only tools with OAuth2; xero_list_connections finds the tenant ID after authorisation.

tools

10

Region

INTL

Category

Accounting

Authentication

OAuth 2.0

Required env vars

XERO_CLIENT_IDXERO_CLIENT_SECRET
Install in one click on Cloud

7-day free trial · No credit card

  • 7-day free trial
    No credit card required
  • GDPR & SOC 2 ready
    EU data residency, audit logs
  • Open-source on GitHub
    Open source · AGPL-3.0
  • Works with ChatGPT, Claude, Gemini
    Any MCP-compatible client

Skip the install. Get this working in under 2 minutes.

Start a free trial on cloud.anythingmcp.com, add the Xero in one click, then point your AI client (Claude, ChatGPT, Copilot or Cursor) at the generated MCP endpoint. No Docker, no git clone, zero engineering experience required.

Start free trial

Summary

Let your AI read your Xero books: sales invoices and supplier bills, customer and supplier contacts, the chart of accounts, the Trial Balance and the Profit and Loss with period comparisons, on an accrual or cash basis. Read-only, with your own Xero OAuth2 app and a sign-in through Authorize with Provider.

Try asking

Example prompts for Xero

Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.

Xero · live via MCP
Share
Opus 4.7

Claude is AI and can make mistakes. Please double-check responses.

💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → Xero, paste your credentials, mint an MCP API key and you're done. No Docker, no git clone, no local server.

Xero + Gemini

Let your AI read your Xero books: sales invoices and supplier bills, customer and supplier contacts, the chart of accounts, the Trial Balance and the Profit and Loss with period comparisons, on an accrual or cash basis. Read-only, with your own Xero OAuth2 app and a sign-in through Authorize with Provider.

Prerequisites

See the full setup instructions baked into the connector (visible in the in-app store when you select the connector). The required environment variables for this connector are:

XERO_CLIENT_ID, XERO_CLIENT_SECRET

Step 1 — Get credentials

  1. Sign in at developer.xero.com/app/manage (My Apps) and create an OAuth2 app of type Web app (authorization code flow).
  2. As redirect URI, enter https://cloud.anythingmcp.com/api/mcp-oauth/callback for AnythingMCP Cloud, or <your AnythingMCP URL>/api/mcp-oauth/callback if you host AnythingMCP yourself. It must match exactly.
  3. On the app's Configuration page, copy the Client ID into XERO_CLIENT_ID, then generate a client secret and paste it into XERO_CLIENT_SECRET.
  4. Leave XERO_TENANT_ID and XERO_REFRESH_TOKEN empty and install the connector. On the connector page, click Authorize with Provider, sign in to Xero and connect the organisation the AI should read.
  5. Run xero_list_connections. Pick the entry with the right tenantName and the tenantType ORGANISATION, and copy its tenantId into XERO_TENANT_ID. Don't use the connection's id or authEventId: those are different values. Until XERO_TENANT_ID is set, the other tools stop before calling Xero and name the missing variable.
  6. Run xero_get_organisation and check the organisation name before the AI reads any figures. One connector reads one organisation; install it again for a second one.

Staying signed in: access tokens last 30 minutes and are renewed automatically, and AnythingMCP stores every new refresh token Xero hands out. A refresh token that is not renewed for 60 days expires; then click Authorize with Provider again. Fill in XERO_REFRESH_TOKEN only if you already hold a current refresh token for the same app with the same read-only consent, and don't share a refresh token with another integration: Xero replaces it on every renewal, so one of the two would be left with an invalid one.

Read-only by design: all ten tools only read (GET); none of them creates, changes or deletes accounting data. The connector asks for the read-only scopes openid offline_access accounting.invoices.read accounting.contacts.read accounting.settings.read accounting.reports.trialbalance.read accounting.reports.profitandloss.read. Xero adds consent rather than replacing it: if this app was authorised with write scopes before, the token keeps them. To narrow it down, revoke the old connection in Xero and click Authorize with Provider again. The AI also sees only what the Xero user who signs in may see; the reports need a user with access to reports.

Invoices, contacts and accounts: xero_list_invoices returns sales invoices (ACCREC) and supplier bills (ACCPAY) together. Filter with where, for example Type=="ACCREC", and sort with order, for example InvoiceNumber ASC. Invoices and contacts come in pages of up to 100; the AI keeps paging until a page comes back empty or short. xero_list_contacts searches names, contact numbers and email addresses and includes archived contacts on request. The chart of accounts comes in one piece. xero_get_invoice, xero_get_contact and xero_get_account need the UUID from the matching list, not an invoice number, contact name or account code.

Reports: xero_get_trial_balance takes one date, xero_get_profit_and_loss takes fromDate and toDate (format YYYY-MM-DD). Both run on an accrual basis unless you ask for the cash basis (paymentsOnly). The Profit and Loss can compare 1 to 12 periods by month, quarter or year (periods and timeframe).

Common errors: 401 or 403 means missing consent, an expired authorisation, a Xero user without the needed permissions, or an organisation that is not connected to this app: check XERO_TENANT_ID against xero_list_connections, then click Authorize with Provider again. 429 means Xero's rate limit for the organisation was hit: the AI waits the seconds given in Retry-After before trying again, and the X-Rate-Limit-Problem header says which limit it was. The limits depend on your app's tier, see Xero's API limits.

The connector does not create, change or delete anything in Xero, and it does not read bank transactions, the Balance Sheet, payroll, files or attachments.

Step 2 — Install the adapter

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

Step 3 — Add the connector in Gemini

Your server URL: in AnythingMCP, open MCP Servers → the server this connector is on, and copy its URL (https://cloud.anythingmcp.com/mcp/…). Use it wherever this guide shows YOUR_SERVER_ID.

Gemini CLI reads MCP servers from ~/.gemini/settings.json (on Windows %USERPROFILE%\.gemini\settings.json). Add:

{
  "mcpServers": {
    "anythingmcp": {
      "httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
      "headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
    }
  }
}
  1. Create an MCP API key in AnythingMCP under MCP Servers → your server → API keys, and paste it in place of YOUR_MCP_API_KEY.
  2. Save the file and restart gemini.
  3. Run /mcp inside Gemini CLI (or gemini mcp list in your shell): anythingmcp should show as connected.
  4. Start prompting: Gemini CLI can now call the Xero tools.

Available tools

ToolWhat it does
xero_list_connectionsList the Xero organisations this authorisation can read, with tenantId, tenantName and tenantType
xero_get_organisationRead the configured organisation's name, base currency and settings
xero_list_invoicesList sales invoices and purchase bills with totals, status and line items, one page at a time
xero_get_invoiceRead one invoice or bill with its line items, amounts and payment details
xero_list_contactsList customer and supplier contacts one page at a time
xero_get_contactRead one customer or supplier contact, including its addresses, contact people and balances
xero_list_accountsRead the chart of accounts with account codes, names, types, tax types and status
xero_get_accountRead one account's code, name, type, tax type and status
xero_get_trial_balanceRead the Trial Balance as at a specified date, including debit, credit and year-to-date values
xero_get_profit_and_lossRead income, expenses and profit for a date range

Example prompts

  • "Which sales invoices are still unpaid, and how much does each customer owe us in total?"
  • "Show me the Profit and Loss for last quarter compared with the three quarters before."
  • "Which supplier bills fall due in the next 14 days, and for what amounts?"
  • "Find Acme Ltd in our contacts and show me their email address, billing address and outstanding balance."

FAQ

Where does Gemini CLI look for MCP servers? In ~/.gemini/settings.json for your user, or in .gemini/settings.json inside a project. gemini mcp list shows each server and whether it connects.

Next steps

Was this guide helpful?

Your Xero agent is one click away.

Install the connector, paste the key, prompt Gemini. Free for 7 days, no credit card.

Related guides

Connectors

Xero to MCP: Drive Xero from any AI Agent

Let your AI read your Xero books: sales invoices and supplier bills, customer and supplier contacts, the chart of accounts, the Trial Balance and the Profit and Loss with period comparisons, on an accrual or cash basis. Read-only, with your own Xero OAuth2 app and a sign-in through Authorize with Provider.

Connectors

How to Connect Xero to Meta Muse via MCP

Let your AI read your Xero books: sales invoices and supplier bills, customer and supplier contacts, the chart of accounts, the Trial Balance and the Profit and Loss with period comparisons, on an accrual or cash basis. Read-only, with your own Xero OAuth2 app and a sign-in through Authorize with Provider.

Connectors

How to Connect Xero to ChatGPT via MCP

Let your AI read your Xero books: sales invoices and supplier bills, customer and supplier contacts, the chart of accounts, the Trial Balance and the Profit and Loss with period comparisons, on an accrual or cash basis. Read-only, with your own Xero OAuth2 app and a sign-in through Authorize with Provider.

Connectors

How to Connect Xero to Claude via MCP

Let your AI read your Xero books: sales invoices and supplier bills, customer and supplier contacts, the chart of accounts, the Trial Balance and the Profit and Loss with period comparisons, on an accrual or cash basis. Read-only, with your own Xero OAuth2 app and a sign-in through Authorize with Provider.

Connectors

How to Connect Xero to Cursor via MCP

Let your AI read your Xero books: sales invoices and supplier bills, customer and supplier contacts, the chart of accounts, the Trial Balance and the Profit and Loss with period comparisons, on an accrual or cash basis. Read-only, with your own Xero OAuth2 app and a sign-in through Authorize with Provider.

Connectors

How to Connect Canva to Gemini via MCP

Let your AI work in Canva: find and read designs, create new ones, export them to PDF, PNG, PowerPoint or video with download links, organise folders, upload images from a link, read brand templates and comment on designs.