概览
MEXAR MCP Server 是一个 headless Model Context Protocol server,用于把部分 MEXAR Core API 工作流暴露给 AI clients。它让操作人员可以通过自然语言查询部门、客户、币种、账户、交易、master agents、汇率报价与 remittance 上下文,而不需要再构建一个新的 dashboard surface。
这个组件是探索性的 V1 prototype,不是公开产品 UI。由于它连接的是实际金融运营系统,设计上刻意保持保守:read 和 lookup tools 是默认工作流,write tools 必须经过显式确认,也可以通过 read-only mode 完全关闭。
产品架构
- Thin TypeScript MCP bridge - Server 使用 TypeScript 与官方 Model Context Protocol SDK 实作,通过 stdio 运行,因此 Claude Code、Claude Desktop 或其它支持 MCP 的 client 可以连接,而不需要额外 HTTP server。
- 不需要后端改动 - MCP 层包装既有 MEXAR Core REST API,没有引入新的后端服务或数据库,因此可以作为 operator-side integration layer 部署。
- 基于环境变量的认证 - Runtime configuration 通过
MEXAR_API_BASE_URL与MEXAR_ACCESS_TOKEN提供。Access token 使用既有 Laravel Passport bearer token,并要求对应 employee identity user。 - 按业务域拆分 tools - Tools 按部门、客户、exchange、remittance、transactions、accounts、master agents、countries 与共享 response helpers 拆分。
- Read-first operating model -
list_my_departments、search_customers、get_customer、quote_exchange、list_transactions、show_transaction、list_accounts、show_account等 lookup tools 始终注册。 - Confirm-gated write tools - 创建/更新客户、创建 money changer exchange 与创建 remittance 默认返回 dry-run preview。Tool 会返回即将调用的方法、endpoint 与 payload;只有再次以
confirm: true调用时才会执行。 - Read-only deployment switch -
MEXAR_READONLY可以完全关闭 write tools,让同一个 server 用于更安全的查询、支持与排查流程。 - Human-readable response enrichment - Reference-data helpers 会把部分响应中的 currency id 与 country id 解析成名称,减少 AI client 需要自行解释的数字上下文。
- Rate and settlement safeguards - Exchange 与 remittance tools 包含系统报价检查、rate deviation warning、账户查询支持,并明确提示 money changer flow 与 remittance flow 的差异。
关键能力
- 自然语言运营查询 - 通过 AI client 查询客户记录、今日交易、账户余额、部门币种配置或 master agent 上下文。
- 交易准备辅助 - 在准备 exchange 或 remittance payload 前,先解析部门、客户、币种、账户与报价上下文。
- Dry-run financial writes - 敏感的 CRM、exchange 与 remittance 写入会先预览再执行,保留人工审查步骤。
- 最小集成面 - 作为本地或 operator-side MCP process 运行,通过 bearer token 访问既有 API,避免新增公开服务面。
- AI-assisted internal tooling - 展示如何在不重写核心平台的前提下,将 MEXAR 既有 API 架构延伸为 AI-native operator workflow。

