JZ

john-zhang-dev/xero-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

22 stars 15 forks 质量 83 趋势 20MIT

模型上下文协议服务器允许客户端与Xero交互

概览

该MCP服务器允许客户端与Xero会计软件交互。 2. 在Xero中创建一个OAuth 2.0应用,以获得_CLIENT_ID_和_CLIENT_SECRET_。 - 创建一个免费的Xero用户账户(如果你没有)- 登录Xero开发者中心 https://developer.xero.com/app/manage/ - 点击新应用 - 输入你的应用名称 - 选择网页应用 - 提供有效的URL(可以是任何有效URL,例如:https://www.myapp.com) - 输入重定向URI:http://localhost:5000/callback 重定向URI可以自定义,但必须使用localhost,并包含显式端口和路径(例如http://localhost:5050/my-path).,在下面的MCP客户端配置中设置与XERO_REDIRECT_URI相同的值。 - 勾选接受条款与条件,点击创建应用 - 在屏幕左侧选择配置 - 点击生成秘密 进入设置 -> 开发者 -> 本地 MCP 服务器 -> 编辑配置,并添加以下内容到 claude_desktop_config。

概述(AI 翻译)

该MCP服务器允许客户端与Xero会计软件交互。

开始

  1. 确保节点已安装。

  2. 在Xero中创建一个OAuth 2.0应用,以获得_CLIENT_ID_和_CLIENT_SECRET_。

  • 创建一个免费的Xero用户账户(如果你还没有)
  • 登录Xero开发者中心 https://developer.xero.com/app/manage/
  • 点击新应用
  • 为您的应用输入名称
  • 选择网页应用
  • 提供一个有效的URL(可以是任何有效URL,例如:https://www.myapp.com)
  • 输入重定向 URI:http://localhost:5000/callback

注意: 重定向 URI 可以自定义,但必须使用 localhost,并包含显式端口和路径(例如 http://localhost:5050/my-path)。在下面的 MCP 客户端配置中设置与 XERO_REDIRECT_URI 相同的值。

  • 勾选以接受条款与条件,并点击创建应用
  • 在屏幕左侧选择配置
  • 点击“生成秘密”
  1. 配置您的MCP客户端:

克劳德桌面

进入设置 -> 开发者 -> 本地 MCP 服务器 -> 编辑配置,并在 claude_desktop_config.json 中添加以下内容:

重启 Claude Desktop,或通过 Developer -> Reload MCP 配置重新加载。

克劳德·科德

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Xero MCP Server

This MCP server allows Clients to interact with Xero Accounting Software.

Get Started

  1. Make sure node is installed.

  2. Create an OAuth 2.0 app in Xero to get a CLIENT_ID and CLIENT_SECRET.

    • Create a free Xero user account (if you don’t have one)

    • Login to Xero Developer center https://developer.xero.com/app/manage/

    • Click New app

    • Enter a name for your app

    • Select Web app

    • Provide a valid URL (can be anything valid eg. https://www.myapp.com)

    • Enter redirect URI: http://localhost:5000/callback

      Note: The redirect URI can be customized, but it must use localhost and include both an explicit port and a path (e.g. http://localhost:5050/my-path). Set the same value as XERO_REDIRECT_URI in your MCP client config below.

    • Tick to Accept the Terms & Conditions and click Create app

    • On the left-hand side of the screen select Configuration

    • Click Generate a secret

  3. Configure your MCP client:

    Claude Desktop

    Go to Settings -> Developers -> Local MCP Servers -> Edit Config and add the following to claude_desktop_config.json:

    {
      "mcpServers": {
        "xero-mcp": {
          "command": "npx",
          "args": ["-y", "xero-mcp@latest"],
          "env": {
            "XERO_CLIENT_ID": "YOUR_CLIENT_ID",
            "XERO_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
            "XERO_REDIRECT_URI": "http://localhost:5000/callback"
          }
        }
      }
    }
    

    Restart Claude Desktop, or reload via Developer -> Reload MCP Configuration.

    Claude Code

    Run the following command to add the MCP server:

    claude mcp add xero-mcp \
      -e XERO_CLIENT_ID=YOUR_CLIENT_ID \
      -e XERO_CLIENT_SECRET=YOUR_CLIENT_SECRET \
      -e XERO_REDIRECT_URI=http://localhost:5000/callback \
      -- npx -y xero-mcp@latest
    

    The server will be available in your next Claude Code session. To make it available across all projects, add --scope user to the command above.

  4. When accessing a Xero tool for the first time, a Xero login page will pop up to ask your consent. Complete the auth flow and manually close the web page (as the Xero page will not auto close in this version)

    Privacy alert: after completing the Xero OAuth2 flow, your Xero data may go through the LLM that you use. If you are doing testing you should authorize to your Xero Demo Company.

Tools

  • authenticate

    Authenticate with Xero using OAuth2

  • create_bank_transactions

    Creates one or more spent or received money transaction

  • create_contacts

    Creates one or multiple contacts in a Xero organisation

  • get_balance_sheet

    Retrieves report for balancesheet

在 GitHub 查看完整 README

安装

npx -y xero-mcp@latest
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "xero-mcp": { "command": "npx", "args": ["-y", "xero-mcp@latest"], "env": { "XERO_CLIENT_ID": "YOUR_CLIENT_ID", "XERO_CLIENT_SECRET": "YOUR_CLIENT_SECRET", "XERO_REDIRECT_URI": "http://localhost:5000/callback" } } } }