fix: 补全 MCP 快速选择并重新打包

This commit is contained in:
shiyue
2026-08-21 11:23:32 +08:00
parent 19c1601351
commit d234189a86
9 changed files with 292 additions and 13 deletions

View File

@@ -0,0 +1,16 @@
# MCP 快速选择调查发现
## 待确认
- 快速选择候选的构建入口和数据源。
- 当前会话 MCP 配置在前端/后端的传递路径。
- 是否存在只硬编码 ccweb 的过滤或分组逻辑。
- 现有测试覆盖及缺失断言。
## 已确认
- `server.js:listRuntimeMcpServerConfigs` 原先只读取当前 cwd 最近的项目 `.codex/config.toml`,并注入 ccweb;它不会看到 Codex App 由用户级配置、插件或动态重载得到的运行时 MCP。
- `listComposerMcpItems` 原先只为非 ccweb server 创建 `itemType: 'server'` 候选,没有 MCP tool 级候选;ccweb 工具则来自静态 `CCWEB_MCP_TOOLS`。
- `COMPOSER_SUGGESTION_LIMIT` 原为 20,会在多 MCP 场景静默截断候选。
- 本机 Codex app-server schema 提供 `mcpServerStatus/list`,参数含 `threadId/detail/limit/cursor`,返回 `data[].tools`;这正是当前线程真实 MCP inventory 的权威来源。
- 已实现 per-thread 短缓存、分页读取、运行时 server/tool 候选合并;工具选择仍沿用通用 `mcp:server/tool` mention 插入,不执行 MCP 或打开参数表单。