feat: API Tester 支持 MCP 模式 + 修复多个 bug

MCP 模式:
- 新增浏览器端 MCP 客户端 (SSE + JSON-RPC + initialize 握手)
- API Tester 页面双模式: REST API tab + MCP Tools tab
- 连接后自动发现 13 个 tools,支持参数编辑和调用
- 与 AI 客户端走完全相同的协议路径

后端修复:
- 每个 SSE 连接创建独立 McpServer 实例,支持多客户端并发
- express.json() 移到 SSE 路由之后,避免消费 MCP 请求体
- 新增 GET /api/xhs/login/cookie-check 轻量接口(不打开浏览器)

前端修复:
- QR 轮询改用 cookie-check 接口,不再重复打开浏览器窗口
- useLoginStatus 默认不自动请求,避免页面加载触发浏览器
- Header 添加 Token 未配置警告横幅
- tsup clean:false 保护 dist/web 不被清除
This commit is contained in:
2026-03-01 16:33:33 +08:00
parent f464333a53
commit 785ec84e56
8 changed files with 665 additions and 146 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
"scripts": {
"build": "tsup",
"build:web": "cd web && npm run build && mkdir -p ../dist/web && cp -r dist/* ../dist/web/",
"build:all": "npm run build && npm run build:web",
"build:all": "rm -rf dist/index.js dist/index.js.map && npm run build && npm run build:web",
"dev": "tsup --watch",
"dev:web": "cd web && npm run dev",
"start": "node dist/index.js",