Jez | Jeremy Dawes
Back to projects
mcp active

Xero MCP Server

59 MCP tools giving AI agents full access to Xero accounting. Invoices, contacts, reports, purchase orders and more.

MCPCloudflare WorkersDurable ObjectsTypeScriptXero API

Overview

A production-ready MCP server that gives AI agents comprehensive access to Xero accounting. With 59 tools across 16 categories, agents can manage invoices, contacts, reports, purchase orders and more - all deployed at the edge for global low-latency access.

59
MCP Tools
16
Categories
2 days
Build Time
Claude creating a Xero invoice using the MCP server
Invoice creation flow: Claude uses MCP tools to check organisations, find contacts, and create an invoice in Xero

The Problem

Xero’s official MCP server is limited. It covers basic operations but misses critical business functionality:

  • No Purchase Orders - Essential for procurement workflows
  • Limited Payroll - Missing regional support (NZ, UK)
  • No Rate Limit Awareness - Agents hit limits without warning
  • Complex Token Handling - Xero tokens expire every 30 minutes

Businesses needed a comprehensive solution that handled the full Xero API.

FeatureOfficial XeroJezweb
Purchase Orders(4 tools)
Payroll NZ/UK(8 tools)
Rate Limit Warnings
Auto Token Refresh
Financial Reports
Total Tools~2059

Solution

Built a complete MCP server with every tool a business agent needs:

Key Differentiator

Purchase Orders support - the feature gap in Xero’s official MCP server. Essential for any business with procurement workflows.

What Makes It Different

  • 59 Tools covering the full Xero API surface
  • Dual OAuth - Users authenticate their own Xero organisations
  • Automatic Token Refresh - Handles 30-minute token expiry transparently
  • Rate Limit Awareness - Tools warn when approaching daily/minute limits
  • Edge Deployment - Low latency globally via Cloudflare Workers

Tool Categories

Contacts4

Create, update, list

Invoices6

Full lifecycle + email

Credit Notes4

Issue and manage

Quotes4

Create and send

Accounts2

Chart of accounts

Items4

Inventory/SKUs

Reports5

P&L, Balance Sheet

Bank Txns4

Receive/spend money

Purchase Orders4

Procurement

Journals4

Manual entries

Tracking4

Cost centres

Payroll8

NZ/UK support

Payments2

Apply payments

Organisation1

Org details

Tax Rates1

GST/VAT rates

Status2

Connection status

Tool Reference

Full list of all 59 MCP tools available:

list_purchase_ordersList POs with status, contact, and date filters
get_purchase_orderGet purchase order by ID with line items
create_purchase_orderCreate PO with delivery details and line items
update_purchase_orderUpdate an existing purchase order

Technical Architecture

Built on Cloudflare’s edge computing stack for production reliability:

Cloudflare WorkersDurable ObjectsKV StorageTypeScriptHono

Key Technical Decisions

Durable Objects for Session State

MCP sessions need persistent state. Durable Objects maintain the connection context, tool state, and authentication tokens across requests.

Workers-Native API Calls

Xero’s Node SDK has compatibility issues with Workers. Built direct fetch() calls with automatic token refresh and error handling.

Dual OAuth Pattern

  1. User authenticates with Google (identifies the MCP client)
  2. User connects their Xero organisation (grants API access)
  3. Each user can connect different Xero organisations

Rate Limit Handling

Xero enforces strict rate limits:

  • 5,000 requests/day per organisation
  • 60 requests/minute per organisation

Tools parse rate limit headers and warn agents when approaching limits. No more surprise failures mid-workflow.

Results

The server handles production workloads for accounting automation:

  • 59 tools covering comprehensive Xero functionality
  • 2-day build from concept to production
  • Edge deployed - low latency from anywhere
  • Multi-tenant - each user connects their own Xero org

Example Workflow

See how Claude handles a real invoice workflow:

Invoice Creation Flow

Create an invoice for Acme Corp for $2,500 consulting services, due in 30 days

I’ll create that invoice for you.

create_invoice

Invoice INV-001234 created for Acme Corp - $2,500.00 AUD, due 27 Feb 2025.

Email it to them

email_invoice

Invoice emailed to accounts@acmecorp.com.au

Use Cases

Invoice Automation - Create, send, and track invoices through natural conversation

Financial Reporting - Generate P&L, Balance Sheet, Aged Receivables on demand

Procurement Workflows - Create and manage purchase orders (not available in official MCP)

Contact Management - Find customers with overdue invoices, update details

Interested in a similar solution?

Let's talk about your project