适用于Brex API的模型上下文协议(MCP)服务器。优化用于安全、小巧且只读的响应,支持投影和批处理。
# 安装包
npm install -g mcp-brex
# 使用您的API密钥添加到Claude Code
claude mcp add brex --env BREX_API_KEY=your_brex_api_key -- npx mcp-brex
在您的claude_desktop_config.json中添加:
{
"mcpServers": {
"brex": {
"command": "npx",
"args": ["mcp-brex"],
"env": {
"BREX_API_KEY": "your_brex_api_key"
}
}
}
}
git clone https://github.com/dennisonbertram/mcp-brex.git
cd mcp-brex
npm install
npm run build
claude mcp add brex --env BREX_API_KEY=your_key -- node build/index.js
brex://expenses | brex://expenses/{id} | brex://expenses/card | brex://expenses/card/{id}brex://budgets | brex://budgets/{id}brex://spend_limits | brex://spend_limits/{id}brex://budget_programs | brex://budget_programs/{id}brex://transactions/card/primary | brex://transactions/cash/{id}brex://docs/usage (代理使用的紧凑指南)注意事项:
?summary_only=true&fields=id,status,...来控制负载大小。merchant和budget以提高可读性。get_budgets, get_budgetget_spend_limits, get_spend_limitget_budget_programs, get_budget_programget_expensesget_all_expenses, get_all_card_expensesget_expense, get_card_expenseget_card_statements_primaryget_card_transactions, get_cash_transactionsget_cash_account_statementsget_all_accounts, get_account_detailsmatch_receipt, upload_receiptupdate_expense始终将参数放在arguments下(而不是input)。通过分页和过滤保持负载小。
常见参数:
page_size(<=50),max_items(推荐<=200)start_date, end_date, window_daysstatus数组用于费用/交易min_amount, max_amount用于费用merchant_name用于费用expand数组以包括嵌套对象(例如,["merchant", "budget"])推荐示例:
{
"name": "get_all_card_expenses",
"arguments": {
"page_size": 10,
"max_items": 20,
"start_date": "2025-08-25T00:00:00Z",
"end_date": "2025-08-26T00:00:00Z",
"status": ["APPROVED"],
"min_amount": 100
}
}
{
"name": "get_expenses",
"arguments": {
"limit": 5,
"status": "APPROVED"
}
}
{
"name": "get_card_transactions",
"arguments": {
"limit": 10,
"posted_at_start": "2025-08-25T00:00:00Z"
}
}
{
"name": "get_all_accounts",
"arguments": {
"page_size": 10,
"max_items": 20,
"status": "ACTIVE"
}
}
{
"name": "get_transactions",
"arguments": {
"accountId": "acc_123456789",
"limit": 10
}
}
{
"name": "get_expenses",
"arguments": {
"limit": 5,
"expand": ["merchant", "user"]
}
}
重要:使用分页、过滤和排序来控制响应大小,而不是依赖于摘要。
page_size: number — 每页项目数(建议:≤50)max_items: number — 所有页面的最大总项目数(建议:≤200)start_date/end_date: string — ISO日期范围过滤window_days: number — 将大日期范围分割成更小的批次status: string[] — 按状态过滤(例如,["APPROVED", "PENDING"])min_amount/max_amount: number — 基于金额的费用过滤expand: []返回精简的对象(每个约500-1000个标记)expand: ["merchant", "budget"]返回完整的对象(每个约15K+个标记)merchant, budget, user, department, location, receipts仅发布build/, README.md, 和 LICENSE。
MIT — 查看LICENSE。