From 388d1e8e99e8ec68b8aefcc825eb16b5c5cafd61 Mon Sep 17 00:00:00 2001 From: JunWang Date: Sun, 7 Jun 2026 11:52:01 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E5=86=99?= =?UTF-8?q?=E5=85=A5=E7=B1=BB=E6=8E=A5=E5=8F=A3=EF=BC=8C=E4=BB=85=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E5=8F=AA=E8=AF=BB=E6=9F=A5=E8=AF=A2=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除的接口: - bind_vehicle_to_order(绑定车辆) - register_user(注册用户) - wx_login(微信登录) - wx_get_phone(获取手机号) - admin_*(内部管理接口) 移除 ADMIN_KEY 配置,保留 TLBM_TOKEN 用于用户认证 Co-Authored-By: Claude Opus 4.6 --- README.md | 14 ++----- src/index.ts | 115 ++++----------------------------------------------- 2 files changed, 11 insertions(+), 118 deletions(-) diff --git a/README.md b/README.md index 4cc8fba..6664453 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,8 @@ TLBM 无人车运营 API 的 MCP 封装,支持 Hermes、Claude Code 等 AI Age - **车辆状态查询**:实时状态、不可用统计、工作时长指标、行驶距离 - **车辆轨迹回放**:指定日期的轨迹和状态信息 -- **订单管理**:运单汇总查询、SDK订单操作、车辆绑定 -- **用户管理**:用户注册、角色查询 -- **微信登录**:小程序登录、手机号获取 -- **内部管理**:重新聚合、状态推导(需Admin Key) +- **订单查询**:运单汇总查询、SDK订单详情 +- **用户查询**:角色查询、OpenID查询用户 ## 安装 @@ -86,7 +84,7 @@ mcp_servers: args: ["-y", "tlbm-mcp"] env: TLBM_API_URL: "https://www.atomdancing.com/pm" - TLBM_ADMIN_KEY: "" # 可选,用于内部管理接口 + TLBM_TOKEN: "" # 可选,用于用户认证 ``` ### Claude Code / Claude Desktop @@ -101,7 +99,7 @@ mcp_servers: "args": ["-y", "tlbm-mcp"], "env": { "TLBM_API_URL": "https://www.atomdancing.com/pm", - "TLBM_ADMIN_KEY": "" + "TLBM_TOKEN": "" } } } @@ -127,12 +125,8 @@ mcp_servers: | `mcp_tlbm_get_unfinished_orders` | 未完成运单 | | `mcp_tlbm_get_sdk_order_list` | SDK订单列表 | | `mcp_tlbm_get_sdk_order_detail` | SDK订单详情 | -| `mcp_tlbm_bind_vehicle_to_order` | 绑定车辆到订单 | | `mcp_tlbm_get_user_roles` | 查询用户角色 | | `mcp_tlbm_get_user_by_openid` | 按OpenID查询用户 | -| `mcp_tlbm_register_user` | 注册用户 | -| `mcp_tlbm_wx_login` | 微信小程序登录 | -| `mcp_tlbm_wx_get_phone` | 获取微信手机号 | ## 车辆状态码说明 diff --git a/src/index.ts b/src/index.ts index 1a009df..670c6ce 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,7 +15,6 @@ import { // API 配置 const API_BASE_URL = process.env.TLBM_API_URL || "https://www.atomdancing.com/pm"; -const ADMIN_KEY = process.env.TLBM_ADMIN_KEY || ""; const USER_TOKEN = process.env.TLBM_TOKEN || ""; // HTTP 请求函数 @@ -36,16 +35,11 @@ async function httpRequest(method: string, path: string, params?: Record { if (!tool) { throw new Error(`Unknown tool: ${name}`); } - - // 检查 Admin Key - if (tool.requiresAdmin && !ADMIN_KEY) { - return { - content: [{ type: "text", text: "错误:需要设置 TLBM_ADMIN_KEY 环境变量才能调用内部管理接口" }], - }; - } - + try { // 处理路径参数 let path = tool.endpoint.path;