Skip to main content
XE

Xero

v0.2.1OAuth2

Contabilidad global, #2 en ERP (líder en UK/AU/NZ). Contactos, facturas, pagos, ítems, cuentas, balance general. Junto con QuickBooks cubre cerca del 80% de la contabilidad de pymes global.

24 herramientas2 env vars🌐 GLOBALestable en npm

Qué puede hacer tu agente

Xero le da a tu agente 24 tools que llama directo — elegí las que necesite, en Claude, Cursor o cualquier cliente MCP.

  • create_contactCreate a Xero contact (customer or supplier — Xero uses one unified Contact object with IsCustomer/IsSupplier flags inferred from transactions).
  • get_contactRetrieve a single Xero contact by ContactID (UUID).
  • list_contactsList Xero contacts. Supports Xero's where clause for server-side filtering (e.g. 'Name=="ACME Ltd"', 'IsCustomer==true').
Ejemplo de llamada
// Your agent calls a tool directly — no glue code.
// CodeSpar's managed tier handles OAuth2, token rotation and rate limits.
const result = await session.call("create_contact", { /* ... */ });

Instalar

terminal
$ npm install @codespar/mcp-xero

Quickstart

Agregá esta entrada a tu claude_desktop_config.json (o a la config de cualquier cliente compatible con MCP).

claude_desktop_config.json
{
  "mcpServers": {
    "xero": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-xero"
      ],
      "env": {
        "XERO_ACCESS_TOKEN": "<your_xero_access_token>",
        "XERO_TENANT_ID": "<your_xero_tenant_id>"
      }
    }
  }
}

Después de reiniciar, tu agente puede llamar cualquiera de las 24 herramientas de abajo — probá create_contact primero.

Variables de entorno · 2

Necesarias para autenticar el server. Almacenadas cifradas al usar el hosting gestionado de CodeSpar.

XERO_ACCESS_TOKEN
obligatoriosecret

Xero OAuth2 access token (Bearer). Obtain via Xero OAuth2 flow; rotate on expiry.

XERO_TENANT_ID
obligatorio

Xero tenant/organization id sent in the Xero-tenant-id header on every request.

Herramientas disponibles · 24

Cada herramienta es independiente — tu agente carga solo lo que necesita para reducir contexto y tiempo de respuesta.

WRITEcreate_contact
Create a Xero contact (customer or supplier — Xero uses one unified Contact object with IsCustomer/IsSupplier flags inferred from transactions).
READget_contact
Retrieve a single Xero contact by ContactID (UUID).
READlist_contacts
List Xero contacts. Supports Xero's where clause for server-side filtering (e.g. 'Name=="ACME Ltd"', 'IsCustomer==true').
WRITEcreate_invoice
Create an invoice in Xero. Type ACCREC = accounts-receivable (sales invoice to a customer), ACCPAY = accounts-payable (bill from a supplier). Default Status=DRAFT; set AUTHORISED to issue immediately.
READget_invoice
Retrieve a single invoice by InvoiceID (UUID) or InvoiceNumber.
READlist_invoices
List invoices with optional Xero where-clause filtering. Common filters: Status=="AUTHORISED", Type=="ACCREC", Contact.ContactID==guid("..."), Date>=DateTime(2026,1,1).
READemail_invoice
Email an AUTHORISED invoice to the contact's email address on file. Xero uses the default invoice email template. No body required.
WRITEcreate_payment
Record a payment against an invoice or credit note. Reduces the invoice's AmountDue and posts to the specified bank/payment account.

Frameworks compatibles

MCP es un protocolo — cualquier framework que lo hable puede montar este server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Cualquier cliente MCPProtocolo

Preguntas frecuentes

Corré `npx -y @codespar/mcp-xero` y agregá el bloque de config de arriba a tu cliente MCP — Claude, Cursor, VS Code o cualquier cliente compatible con MCP. Sin build, sin SDK. ¿Preferís hosted? El tier gestionado de CodeSpar lo corre por vos, con la auth resuelta.
Xero — MCP server · 24 tools | CodeSpar