Skip to main content
XE

Xero

v0.2.1OAuth2

Contabilidade global, #2 em ERP (líder em UK/AU/NZ). Contatos, faturas, pagamentos, itens, contas, balanço patrimonial. Junto com o QuickBooks cobre cerca de 80% da contabilidade de PMEs global.

24 ferramentas2 env vars🌐 GLOBALestável no npm

O que seu agente faz

O Xero dá ao seu agente 24 tools que ele chama direto — escolha as que precisar, no Claude, Cursor ou qualquer 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').
Exemplo de chamada
// 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

Adicione esta entrada ao seu claude_desktop_config.json (ou a config de qualquer cliente compatível com 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>"
      }
    }
  }
}

Depois de reiniciar, seu agente pode chamar qualquer uma das 24 ferramentas abaixo — teste create_contact primeiro.

Variáveis de ambiente · 2

Necessárias pra autenticar o server. Armazenadas criptografadas ao usar a hospedagem gerenciada da CodeSpar.

XERO_ACCESS_TOKEN
obrigatóriosecret

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

XERO_TENANT_ID
obrigatório

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

Ferramentas disponíveis · 24

Cada ferramenta é independente — seu agente carrega só o que precisa pra reduzir contexto e tempo de resposta.

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 compatíveis

MCP é um protocolo — qualquer framework que o fale pode montar este server.

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

Perguntas frequentes

Rode `npx -y @codespar/mcp-xero` e adicione o bloco de config acima ao seu cliente MCP — Claude, Cursor, VS Code ou qualquer cliente compatível com MCP. Sem build, sem SDK. Prefere hospedado? O tier gerenciado da CodeSpar roda pra você, com a auth resolvida.
Xero — MCP server · 24 tools | CodeSpar