Skip to main content
Glama
Xero MCP Server

Xero MCP Server

Official
by XeroAPI

Xero MCP 服务器

这是一个用于 Xero 的 Model Context Protocol (MCP) 服务器实现。它在 MCP 协议和 Xero API 之间架起了一座桥梁,实现了对 Xero 会计和业务功能的标准化访问。

功能特性

  • 支持自定义连接的 Xero OAuth2 身份验证

  • 联系人管理

  • 会计科目表管理

  • 发票创建与管理

  • 符合 MCP 协议

Related MCP server: xero-mcp-enhanced

前置要求

  • Node.js (v18 或更高版本)

  • npm 或 pnpm

  • 拥有 API 凭据的 Xero 开发者账号

文档与链接

设置

创建 Xero 账号

如果您还没有 Xero 账号和组织,可以通过此处注册免费试用版来创建一个。

我们建议从“演示公司 (Demo Company)”开始,因为它预装了一些示例数据。登录后,使用左上角的下拉菜单选择“Demo Company”即可切换。您可以随时通过左上角的下拉菜单导航至 My Xero 来重置演示公司的数据或更改国家/地区。

注意:要使用与薪资 (Payroll) 相关的查询,区域必须设置为新西兰 (NZ) 或英国 (UK)。

身份验证

Xero MCP 服务器支持两种身份验证模式:

1. 自定义连接 (Custom Connections)

这是测试和开发的更好选择,允许您为特定组织指定客户端 ID 和密钥。 如果您将此集成到 Claude Desktop 等第三方 MCP 客户端中,这也是推荐的方法。

配置您的 Xero 开发者账号

按照以下说明设置自定义连接:https://developer.xero.com/documentation/guides/oauth2/custom-connections/

所需作用域 (Scopes)

自定义连接根据创建时间需要不同的作用域。相关列表中的所有作用域都必须添加到您的自定义连接中:

自定义连接创建时间

所需作用域

2026年4月29日之前

SCOPES_V1 (捆绑权限)

2026年4月29日之后

SCOPES_V2 (细粒度权限)

注意: MCP 服务器会自动优先尝试 V1 作用域,如果需要,会回退到 V2。

您可以通过设置 XERO_SCOPES 环境变量(以空格分隔的作用域列表)来覆盖这些设置。

将 MCP 服务器集成到 Claude Desktop

要将 MCP 服务器添加到 Claude,请转到 Settings > Developer > Edit config,并将以下内容添加到您的 claude_desktop_config.json 文件中:

{
  "mcpServers": {
    "xero": {
      "command": "npx",
      "args": ["-y", "@xeroapi/xero-mcp-server@latest"],
      "env": {
        "XERO_CLIENT_ID": "your_client_id_here",
        "XERO_CLIENT_SECRET": "your_client_secret_here",
        "XERO_SCOPES": "accounting.invoices accounting.contacts accounting.settings"
      }
    }
  }
}

XERO_SCOPES 变量是可选的。如果省略,将使用上述默认作用域。

注意:如果您正在使用 Node Version Manager,请将 "command": "npx" 部分更改为可执行文件的完整路径,例如:Mac / Linux 上的 your_home_directory/.nvm/versions/node/v22.14.0/bin/npx 或 Windows 上的 "your_home_directory\\.nvm\\versions\\node\\v22.14.0\\bin\\npx"

2. 持有者令牌 (Bearer Token)

如果您需要在运行时支持多个 Xero 账号,并允许 MCP 客户端根据需要执行身份验证流程(如 PKCE),这是更好的选择。 在这种情况下,请使用以下配置:

{
  "mcpServers": {
    "xero": {
      "command": "npx",
      "args": ["-y", "@xeroapi/xero-mcp-server@latest"],
      "env": {
        "XERO_CLIENT_BEARER_TOKEN": "your_bearer_token"
      }
    }
  }
}

注意:如果定义了 XERO_CLIENT_BEARER_TOKEN,它将优先于 XERO_CLIENT_ID。

持有者令牌所需的作用域

获取持有者令牌时,必须请求适当的作用域。您请求的作用域应为:

注意: 一些作用域正被弃用,转而采用更细粒度的作用域。有关弃用时间表的详细信息,请参阅 Xero OAuth 2.0 作用域文档。

accounting.transactions (Deprecated)
accounting.transactions.read (Deprecated)
accounting.invoices
accounting.invoices.read
accounting.payments
accounting.payments.read
accounting.banktransactions
accounting.banktransactions.read
accounting.manualjournals
accounting.manualjournals.read
accounting.reports.read (Deprecated)
accounting.reports.aged.read
accounting.reports.balancesheet.read
accounting.reports.profitandloss.read
accounting.reports.trialbalance.read
accounting.contacts 
accounting.settings 
payroll.settings 
payroll.employees 
payroll.timesheets

可用的 MCP 命令

  • list-accounts: 获取账户列表

  • list-contacts: 从 Xero 获取联系人列表

  • list-credit-notes: 获取贷项通知单列表

  • list-invoices: 获取发票列表

  • list-items: 获取项目列表

  • list-manual-journals: 获取手动日记账列表

  • list-organisation-details: 获取组织详细信息

  • list-profit-and-loss: 获取损益表报告

  • list-quotes: 获取报价单列表

  • list-tax-rates: 获取税率列表

  • list-payments: 获取付款列表

  • list-trial-balance: 获取试算平衡表报告

  • list-bank-transactions: 获取银行账户交易列表

  • list-payroll-employees: 获取薪资员工列表

  • list-report-balance-sheet: 获取资产负债表报告

  • list-payroll-employee-leave: 获取薪资员工的休假记录

  • list-payroll-employee-leave-balances: 获取薪资员工的休假余额

  • list-payroll-employee-leave-types: 获取薪资休假类型列表

  • list-payroll-leave-periods: 获取薪资员工的休假期间列表

  • list-payroll-leave-types: 获取 Xero 薪资中所有可用休假类型的列表

  • list-timesheets: 获取薪资工时表列表

  • list-aged-receivables-by-contact: 获取联系人的应收账款账龄

  • list-aged-payables-by-contact: 获取联系人的应付账款账龄

  • list-contact-groups: 获取联系人组列表

  • list-tracking-categories: 获取跟踪类别列表

  • create-bank-transaction: 创建新的银行交易

  • create-contact: 创建新联系人

  • create-credit-note: 创建新的贷项通知单

  • create-invoice: 创建新发票

  • create-item: 创建新项目

  • create-manual-journal: 创建新的手动日记账

  • create-payment: 创建新付款

  • create-quote: 创建新报价单

  • create-payroll-timesheet: 创建新的薪资工时表

  • create-tracking-category: 创建新的跟踪类别

  • create-tracking-option: 创建新的跟踪选项

  • update-bank-transaction: 更新现有的银行交易

  • update-contact: 更新现有联系人

  • update-invoice: 更新现有的草稿发票

  • update-item: 更新现有项目

  • update-manual-journal: 更新现有的手动日记账

  • update-quote: 更新现有的草稿报价单

  • update-credit-note: 更新现有的草稿贷项通知单

  • update-tracking-category: 更新现有的跟踪类别

  • update-tracking-options: 更新跟踪选项

  • update-payroll-timesheet-line: 更新现有薪资工时表上的行

  • approve-payroll-timesheet: 批准薪资工时表

  • revert-payroll-timesheet: 撤销已批准的薪资工时表

  • add-payroll-timesheet-line: 在现有薪资工时表上添加新行

  • delete-payroll-timesheet: 删除现有薪资工时表

  • get-payroll-timesheet: 获取现有薪资工时表

有关详细的 API 文档,请参阅 MCP 协议规范。

开发者指南

安装

# Using npm
npm install

# Using pnpm
pnpm install

运行构建

# Using npm
npm run build

# Using pnpm
pnpm build

与 Claude Desktop 集成

要将开发中的 Xero MCP 服务器链接到 Claude Desktop,请转到 Settings > Developer > Edit config,并将以下内容添加到您的 claude_desktop_config.json 文件中:

注意:对于 Windows,请确保 args 路径转义了文件夹之间的 \,例如 "C:\\projects\\xero-mcp-server\\dist\\index.js"

{
  "mcpServers": {
    "xero": {
      "command": "node",
      "args": ["insert-your-file-path-here/xero-mcp-server/dist/index.js"],
      "env": {
        "XERO_CLIENT_ID": "your_client_id_here",
        "XERO_CLIENT_SECRET": "your_client_secret_here"
      }
    }
  }
}

许可证

MIT

安全性

请不要将您的 .env 文件或任何敏感凭据提交到版本控制中(它已作为安全默认值包含在 .gitignore 中。)

Available Tools

51 tools
add-timesheet-lineC

Add a new timesheet line to an existing payroll timesheet in Xero.

Inputs: timesheetID (required), timesheetLine (required).

approve-timesheetC

Approve a payroll timesheet in Xero by its ID.

Inputs: timesheetID (required).

create-bank-transactionC

Create a bank transaction in Xero. When a bank transaction is created, a deep link to the bank transaction in Xero is returned. This deep link can be used to view the bank transaction in Xero directly. This link should be displayed to the user.

Inputs: type (required), contactId (required), lineItems (required), bankAccountId (required), +2 more.

create-contactB

Create a contact in Xero. When a contact is created, a deep link to the contact in Xero is returned. This deep link can be used to view the contact in Xero directly. This link should be displayed to the user.

Inputs: name (required), email, phone.

create-credit-noteC

Create a credit note in Xero. When a credit note is created, a deep link to the credit note in Xero is returned. This deep link can be used to view the credit note in Xero directly. This link should be displayed to the user.

Inputs: contactId (required), lineItems (required), reference.

create-invoiceB

Create an invoice in Xero. When an invoice is created, a deep link to the invoice in Xero is returned. This deep link can be used to view the invoice in Xero directly. This link should be displayed to the user.

Inputs: type (required), contactId (required), lineItems (required), date, +1 more.

create-itemC

Create an item in Xero.

Inputs: code (required), name (required), description, salesDetails, +4 more.

create-manual-journalB

Create a manual journal in Xero. Retrieve a list of account codes in Xero to use for the journal lines. Journal lines must contain at least two individual journal lines with account codes, use basic accounting account types pairing when not specified, and make sure journal line pairs have credit and debit balanced.

Inputs: narration (required), manualJournalLines (required), url, date, +3 more.

create-paymentA

Create a payment against an invoice in Xero. This tool records a payment transaction against an invoice. You'll need to provide the invoice ID, account ID to make the payment from, and the amount. The amount must be positive and should not exceed the remaining amount due on the invoice. A payment can only be created for an invoice that is status AUTHORIZED A payment can only be created for an invoice that is not fully paid When a payment is created, a deep link to the payment in Xero is returned. This deep link can be used to view the payment in Xero directly. This link should be displayed to the user.

Inputs: amount (required), accountId (required), invoiceId (required), date, +1 more.

create-quoteC

Create a quote in Xero. When a quote is created, a deep link to the quote in Xero is returned. This deep link can be used to view the quote in Xero directly. This link should be displayed to the user.

Inputs: contactId (required), lineItems (required), terms, title, +3 more.

create-timesheetC

Create a new payroll timesheet in Xero. This allows you to specify details such as the employee ID, payroll calendar ID, start and end dates, and timesheet lines.

Inputs: endDate (required), startDate (required), employeeID (required), payrollCalendarID (required), +1 more.

create-tracking-categoryC

Create a tracking category in Xero.

Inputs: name (required).

create-tracking-optionsC

Create tracking options for a tracking category in Xero.

Inputs: optionNames (required), trackingCategoryId (required).

delete-timesheetC

Delete an existing payroll timesheet in Xero by its ID.

Inputs: timesheetID (required).

get-timesheetA

Retrieve a single payroll timesheet from Xero by its ID. This provides details such as the timesheet ID, employee ID, start and end dates, total hours, and the last updated date.

Inputs: timesheetID (required).

list-accountsA

Lists all accounts in Xero. Use this tool to get the account codes and names to be used when creating invoices in Xero

Inputs: no named parameters.

list-aged-payables-by-contactC

Lists the aged payables in Xero. This shows aged payables for a certain contact up to a report date.

Inputs: contactId (required), reportDate, invoicesToDate, invoicesFromDate.

list-aged-receivables-by-contactC

Lists the aged receivables in Xero. This shows aged receivables for a certain contact up to a report date.

Inputs: contactId (required), reportDate, invoicesToDate, invoicesFromDate.

list-bank-transactionsB

List all bank transactions in Xero. Ask the user if they want to see bank transactions for a specific bank account, or to see all bank transactions before running. Ask the user if they want the next page of quotes after running this tool if 10 bank transactions are returned. If they do, call this tool again with the next page number and the bank account if one was provided in the provided in the previous call.

Inputs: page (required), bankAccountId.

list-contact-groupsB

List all contact groups in Xero. You can optionally specify a contact group ID to retrieve details for that specific group, including its contacts.

Inputs: contactGroupId.

list-contactsC

List all contacts in Xero. This includes Suppliers and Customers.

Inputs: page, searchTerm.

list-credit-notesA

List credit notes in Xero. Ask the user if they want to see credit notes for a specific contact, or to see all credit notes before running. Ask the user if they want the next page of credit notes after running this tool if 10 credit notes are returned. If they want the next page, call this tool again with the next page number and the contact if one was provided in the previous call.

Inputs: page (required), contactId.

list-invoicesA

List invoices in Xero. This includes Draft, Submitted, and Paid invoices. Ask the user if they want to see invoices for a specific contact, invoice number, or to see all invoices before running. Ask the user if they want the next page of invoices after running this tool if 10 invoices are returned. If they want the next page, call this tool again with the next page number and the contact or invoice number if one was provided in the previous call.

Inputs: page (required), contactIds, invoiceNumbers.

list-itemsB

Lists all items in Xero. Use this tool to get the item codes and descriptions to be used when creating invoices in Xero

Inputs: page (required).

list-manual-journalsC

List all manual journals from Xero. Ask the user if they want to see a specific manual journal or all manual journals before running. Can optionally pass in manual journal ID to retrieve a specific journal, or a date to filter journals modified after that date. The response presents a complete overview of all manual journals currently registered in your Xero account, with their details. Ask the user if they want the next page of manual journals after running this tool if 10 manual journals are returned. If they want the next page, call this tool again with the next page number, modified date, and the manual journal ID if one was provided in the previous call.

Inputs: page, modifiedAfter, manualJournalId.

list-organisation-detailsB

Lists the organisation details from Xero. Use this tool to get information about the current Xero organisation.

Inputs: no named parameters.

list-paymentsA

List payments in Xero. This tool shows all payments made against invoices, including payment date, amount, and payment method. You can filter payments by invoice number, invoice ID, payment ID, or invoice reference. Ask the user if they want to see payments for a specific invoice, contact, payment or reference before running. If many payments are returned, ask the user if they want to see the next page.

Inputs: page, invoiceId, paymentId, reference, +1 more.

list-payroll-employee-leaveB

List all leave records for a specific employee in Xero. This shows all leave transactions including approved, pending, and processed time off. Provide an employee ID to see their leave history.

Inputs: employeeId (required).

list-payroll-employee-leave-balancesC

List all leave balances for a specific employee in Xero. This shows current leave balances for all leave types available to the employee, including annual, sick, and other leave types.

Inputs: employeeId (required).

list-payroll-employee-leave-typesB

List all leave types available for a specific employee in Xero. This shows detailed information about the types of leave an employee can take, including schedule of accrual, leave type name, and entitlement.

Inputs: employeeId (required).

list-payroll-employeesA

List all payroll employees in Xero. This retrieves comprehensive employee details including names, User IDs, dates of birth, email addresses, gender, phone numbers, start dates, engagement types (Permanent, FixedTerm, or Casual), titles, and when records were last updated. The response presents a complete overview of all staff currently registered in your Xero payroll, with their personal and employment information. If there are many employees, ask the user if they would like to see more detailed information about specific employees before proceeding.

Inputs: no named parameters.

list-payroll-leave-periodsA

List all leave periods for a specific employee in Xero. This shows detailed time off periods including start and end dates, period status, payment dates, and leave types. Provide an employee ID to see their leave periods.

Inputs: employeeId (required), endDate, startDate.

list-payroll-leave-typesB

Lists all available leave types in Xero Payroll. This provides information about all the leave categories configured in your Xero system, including statutory and organization-specific leave types.

Inputs: no named parameters.

list-profit-and-lossC

Lists profit and loss report in Xero. This provides a summary of revenue, expenses, and profit or loss over a specified period of time.

Inputs: toDate, periods, fromDate, timeframe, +2 more.

list-quotesA

List all quotes in Xero. Ask the user if they want to see quotes for a specific contact before running. Ask the user if they want the next page of quotes after running this tool if 10 quotes are returned. If they do, call this tool again with the page number and the contact provided in the previous call.

Inputs: page (required), contactId, quoteNumber.

list-report-balance-sheetC

List the Balance Sheet report from Xero.

Inputs: date, periods, timeframe, paymentsOnly, +3 more.

list-tax-ratesA

Lists all tax rates in Xero. Use this tool to get the tax rates to be used when creating invoices in Xero

Inputs: no named parameters.

list-timesheetsB

List all payroll timesheets in Xero. This retrieves comprehensive timesheet details including timesheet IDs, employee IDs, start and end dates, total hours, and the last updated date.

Inputs: no named parameters.

list-tracking-categoriesB

List all tracking categories in Xero, along with their associated tracking options.

Inputs: includeArchived.

list-trial-balanceB

Lists trial balance in Xero. This provides a snapshot of the general ledger, showing debit and credit balances for each account.

Inputs: date, paymentsOnly.

revert-timesheetC

Revert a payroll timesheet to draft in Xero by its ID.

Inputs: timesheetID (required).

update-bank-transactionC

Update a bank transaction in Xero. When a bank transaction is updated, a deep link to the bank transaction in Xero is returned. This deep link can be used to view the bank transaction in Xero directly. This link should be displayed to the user.

Inputs: bankTransactionId (required), date, type, contactId, +2 more.

update-contactC

Update a contact in Xero. When a contact is updated, a deep link to the contact in Xero is returned. This deep link can be used to view the contact in Xero directly. This link should be displayed to the user.

Inputs: name (required), contactId (required), email, phone, +3 more.

update-credit-noteA

Update a credit note in Xero. Only works on draft credit notes. All line items must be provided. Any line items not provided will be removed. Including existing line items. Do not modify line items that have not been specified by the user. When a credit note is updated, a deep link to the credit note in Xero is returned. This deep link can be used to view the credit note in Xero directly. This link should be displayed to the user.

Inputs: creditNoteId (required), date, contactId, lineItems, +1 more.

update-invoiceA

Update an invoice in Xero. Only works on draft invoices. All line items must be provided. Any line items not provided will be removed. Including existing line items. Do not modify line items that have not been specified by the user. When an invoice is updated, a deep link to the invoice in Xero is returned. This deep link can be used to view the contact in Xero directly. This link should be displayed to the user.

Inputs: invoiceId (required), date, dueDate, contactId, +2 more.

update-itemC

Update an item in Xero.

Inputs: code (required), name (required), itemId (required), description, +5 more.

update-manual-journalB

Update a manual journal in Xero. Only works on draft manual journals. Do not modify line items or parameters that have not been specified by the user.

Inputs: narration (required), manualJournalID (required), manualJournalLines (required), url, +4 more.

update-quoteA

Update a quote in Xero. Only works on draft quotes. All line items must be provided. Any line items not provided will be removed. Including existing line items. Do not modify line items that have not been specified by the user. When a quote is updated, a deep link to the quote in Xero is returned. This deep link can be used to view the quote in Xero directly. This link should be displayed to the user.

Inputs: quoteId (required), date, terms, title, +6 more.

update-timesheet-lineC

Update an existing timesheet line in a payroll timesheet in Xero.

Inputs: timesheetID (required), timesheetLine (required), timesheetLineID (required).

update-tracking-categoryC

Updates an existing tracking category in Xero.

Inputs: trackingCategoryId (required), name, status.

update-tracking-optionsC

Updates tracking options for a tracking category in Xero.

Inputs: options (required), trackingCategoryId (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 51 tools

    Disambiguation4/5

    Most tools map to distinct Xero resources and actions, and the descriptions make similar payroll/leave and reporting tools reasonably separable. A few areas overlap, especially the multiple payroll leave list tools and list-vs-filter patterns, but overall an agent can tell them apart.

    Naming Consistency5/5

    Tool names consistently use kebab-case verb-resource patterns such as create-invoice, list-contacts, update-item, and delete-timesheet. Minor variations like list-report-balance-sheet are still readable and fit the same overall convention.

    Tool Count2/5

    With 51 tools, the surface is far above the ideal 3-15 range and will make tool selection harder for an agent. The breadth reflects the Xero accounting domain, but the set is still too large for a single MCP server without stronger grouping or consolidation.

    Completeness3/5

    Core create/list/update flows are well represented across invoices, contacts, items, quotes, credit notes, bank transactions, and payroll timesheets. However, delete operations are missing for most resources, direct get-by-ID tools are absent for almost everything except timesheets, and create-timesheet requires a payroll calendar ID even though no tool lists payroll calendars.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      An enhanced MCP server for Xero, enabling natural language interaction with your Xero organisation for accounting tasks like invoices, contacts, bank transactions, and payroll.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      An MCP server that enables AI assistants to read and write Xero accounting data, including invoices, contacts, accounts, and payments, through natural language.
      MIT