- Implemented BlueprintPromptModal component to handle blueprint prompt generation and rule synchronization. - Added BlueprintStatusBadge to display the current status of blueprints in ProjectCard. - Integrated blueprint status fetching and synchronization in ProjectCard. - Enhanced SettingsPage with a new section for MCP service configuration and batch sync for blueprint rules. - Updated commands to include new blueprint-related functionalities and types. - Changed application name from "Dev Manager" to "炼境" in various components.
42 lines
1.8 KiB
Markdown
42 lines
1.8 KiB
Markdown
# 内嵌 MCP Server
|
||
|
||
炼境进程内置一个 axum HTTP 服务器,实现 MCP 协议,按产品组聚合上下文数据,供组内所有项目的 Claude 实例查询。
|
||
|
||
## 决策记录
|
||
|
||
- 内嵌在 Tauri 进程而非独立进程,因为炼境托盘常驻时天然保证服务存活,无需额外进程管理
|
||
- 使用 HTTP/SSE 传输而非 stdio,因为 HTTP 可被 Windows 和 WSL 两侧同时访问(WSL localhost 穿透)
|
||
- 默认端口 27190(冷门端口,冲突概率极低),可在设置页修改
|
||
- MCP 工具按 group_id 路由,不同产品组的数据完全隔离
|
||
|
||
## 任务卡
|
||
|
||
### ✅ 启动时绑定 HTTP 端口
|
||
- status: done
|
||
- complexity: M
|
||
- files: src-tauri/src/mcp_server.rs, src-tauri/src/lib.rs, src-tauri/Cargo.toml
|
||
- depends: tray-service
|
||
- acceptance: 炼境启动后 `http://localhost:27190/health` 返回 200,进程退出后端口释放
|
||
|
||
### ✅ 实现 MCP JSON-RPC 基础协议
|
||
- status: done
|
||
- complexity: M
|
||
- files: src-tauri/src/mcp_server.rs
|
||
- acceptance: 支持 `initialize`、`tools/list`、`tools/call` 三个 JSON-RPC 方法,通过 MCP Inspector 验证
|
||
|
||
### ✅ 实现产品组上下文工具
|
||
- status: done
|
||
- complexity: M
|
||
- files: src-tauri/src/mcp_server.rs
|
||
- depends: mcp-server(基础协议)
|
||
- acceptance: 以下三个工具可用且返回正确数据
|
||
- `list_group_projects(group_id)` → 组内项目列表(名称、路径、平台、tech_stack)
|
||
- `get_project_blueprint(group_id, project_id)` → 对应项目的 manifest.yaml 内容
|
||
- `get_project_file(group_id, project_id, relative_path)` → 对应项目的任意文件内容
|
||
|
||
### ✅ MCP 端口可配置(Rust 侧)
|
||
- status: done
|
||
- complexity: S
|
||
- files: src-tauri/src/db.rs, src-tauri/src/mcp_server.rs
|
||
- acceptance: settings 表默认写入 mcp_port=27190,启动时读取该值绑定端口(SettingsPage UI 见 product-group-mcp 模块)
|