Brex MCP Server

by crazyrabbitLTC
Verified

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Provides access to Brex financial platform data, allowing retrieval of account information, transactions, expense data, receipts, budget resources, spend limits, and team information. Includes tools for receipt management and expense updates.

Brex MCP 服务器

用于与 Brex API 集成的模型上下文协议 (MCP) 服务器,使 AI 代理能够与财务数据和资源进行交互。

概述

该 MCP 服务器在 AI 代理和 Brex 金融平台之间架起了一座桥梁,使代理能够:

  • 检索帐户信息和交易
  • 访问费用数据和收据
  • 管理预算资源和支出限额
  • 查看团队信息

该服务器按照MCP规范实现标准化的资源处理程序和工具,从而能够安全高效地访问财务数据。

特征

资源

帐户资源

  • brex://accounts列出所有账户
  • brex://accounts/{id} - 访问特定帐户的详细信息

费用资源

  • brex://expenses - 列出所有费用并分页
  • brex://expenses/{id} - 访问具体费用详情
  • brex://expenses/card - 列出所有卡消费
  • brex://expenses/card/{id} - 访问特定卡的支出详情

注意:费用资源会自动扩展商家和预算信息以显示人类可读的名称而不是 ID。

预算资源

  • brex://budgets - 列出所有预算并分页
  • brex://budgets/{id} - 访问具体的预算详情
  • brex://spend_limits - 列出所有支出限额
  • brex://spend_limits/{id} - 访问特定的支出限额详情
  • brex://budget_programs - 列出所有预算计划
  • brex://budget_programs/{id} - 访问特定预算计划的详细信息

团队资源

  • brex://users/me - 获取当前用户信息

工具

收据管理

  • match_receipt - 将收据与现有费用进行匹配
  • upload_receipt - 上传特定费用的收据

费用管理

  • update_expense - 更新卡支出的详细信息(备忘录、类别等)
  • get_all_expenses - 获取所有费用,包括过滤选项和扩展的商家/预算信息
  • get_all_card_expenses - 获取所有卡支出,并提供过滤选项和扩展的商家/预算信息

注意:出于安全原因,此版本未实现创建、更新或删除预算、支出限额和预算计划的工具。

安装

先决条件

  • Node.js v18 或更高版本
  • Brex API 访问令牌

设置

  1. 克隆此存储库:
git clone https://github.com/dennisonbertram/brex-mcp-server.git cd brex-mcp-server
  1. 安装依赖项:
npm install
  1. 使用您的 Brex API 令牌创建一个.env文件:
BREX_API_KEY=your_token_here BREX_API_URL=https://platform.brexapis.com PORT=3000 NODE_ENV=development RATE_LIMIT_REQUESTS=1000 RATE_LIMIT_WINDOW_MS=60000 LOG_LEVEL=info
  1. 构建服务器:
npm run build

使用 Claude 进行配置

要与 Claude Desktop 一起使用,您需要将服务器添加到 Claude 的配置文件中:

在 macOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json在 Windows 上: %APPDATA%\Claude\claude_desktop_config.json

  1. 打开 Claude 桌面版,点击 Claude 菜单并选择“设置...”进入设置。
  2. 点击左侧边栏的“开发者”,然后点击“编辑配置”
  3. 使用 Brex MCP 服务器设置更新配置文件:
{ "mcpServers": { "brex-server": { "command": "node", "args": [ "/path/to/brex-mcp-server/build/index.js" ], "env": { "BREX_API_KEY": "your_brex_api_key_here", "BREX_API_URL": "https://platform.brexapis.com", "PORT": "3000", "NODE_ENV": "development", "RATE_LIMIT_REQUESTS": "1000", "RATE_LIMIT_WINDOW_MS": "60000", "LOG_LEVEL": "info" } } } }

请确保:

  • /path/to/brex-mcp-server替换为您安装服务器的实际路径
  • your_brex_api_key_here替换为你的实际 Brex API 密钥
  • 使用绝对路径作为服务器位置

只需要BREX_API_KEYBREX_API_URL值;其他环境变量具有合理的默认值,但可以根据需要进行自定义。

  1. 保存文件并重新启动 Claude for Desktop
  2. 通过检查输入框右下角的锤子图标来验证服务器是否正常工作

发展

对于使用自动重建的开发:

npm run dev

检查你的代码:

npm run lint

运行测试:

npm run test

调试

由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们建议使用MCP Inspector进行调试。

安全注意事项

该服务器实施了多项安全措施:

  • 敏感财务资源的只读操作
  • 代码中不存储 API 凭证
  • API 请求的速率限制
  • 正确的错误处理和日志记录

实施情况

有关各种功能的详细实施计划和状态,请参阅documentation/implementation_plan.md

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

作者

丹尼森·伯特伦 - dennison@dennisonbertram.com

-
security - not tested
A
license - permissive license
-
quality - not tested

模型上下文协议服务器使 AI 代理能够与 Brex 金融平台数据交互,从而允许通过标准化资源处理程序检索帐户信息、费用、预算和团队数据。

  1. Overview
    1. Features
      1. Resources
      2. Tools
    2. Installation
      1. Prerequisites
      2. Setup
      3. Configuration with Claude
    3. Development
      1. Debugging
    4. Security Considerations
      1. Implementation Status
        1. License
          1. Author
            ID: azf44t7h28