mcp-probe-kit 2.3.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/README.md +131 -48
  2. package/build/index.js +1 -7
  3. package/build/lib/guidance.d.ts +8 -0
  4. package/build/lib/guidance.js +30 -0
  5. package/build/lib/orchestration-guidance.d.ts +8 -0
  6. package/build/lib/orchestration-guidance.js +16 -0
  7. package/build/lib/template-loader.d.ts +25 -0
  8. package/build/lib/template-loader.js +473 -0
  9. package/build/lib/toolset-manager.d.ts +4 -4
  10. package/build/lib/toolset-manager.js +10 -13
  11. package/build/schemas/code-analysis-tools.d.ts +0 -18
  12. package/build/schemas/code-analysis-tools.js +0 -19
  13. package/build/schemas/doc-util-tools.d.ts +0 -9
  14. package/build/schemas/doc-util-tools.js +0 -10
  15. package/build/schemas/index.d.ts +46 -47
  16. package/build/schemas/orchestration-tools.d.ts +42 -2
  17. package/build/schemas/orchestration-tools.js +42 -2
  18. package/build/schemas/output/core-tools.d.ts +1 -117
  19. package/build/schemas/output/core-tools.js +1 -60
  20. package/build/schemas/output/index.d.ts +5 -4
  21. package/build/schemas/output/index.js +6 -4
  22. package/build/schemas/output/product-design-tools.d.ts +160 -0
  23. package/build/schemas/output/product-design-tools.js +75 -0
  24. package/build/schemas/output/project-tools.d.ts +1 -217
  25. package/build/schemas/output/project-tools.js +1 -103
  26. package/build/schemas/project-tools.d.ts +4 -18
  27. package/build/schemas/project-tools.js +4 -19
  28. package/build/schemas/structured-output.d.ts +309 -99
  29. package/build/schemas/structured-output.js +174 -72
  30. package/build/schemas/ui-ux-schemas.d.ts +26 -0
  31. package/build/schemas/ui-ux-schemas.js +26 -0
  32. package/build/tools/__tests__/add_feature.template.test.d.ts +4 -0
  33. package/build/tools/__tests__/add_feature.template.test.js +47 -0
  34. package/build/tools/__tests__/start_bugfix.unit.test.d.ts +4 -0
  35. package/build/tools/__tests__/start_bugfix.unit.test.js +85 -0
  36. package/build/tools/__tests__/start_feature.unit.test.d.ts +4 -0
  37. package/build/tools/__tests__/start_feature.unit.test.js +83 -0
  38. package/build/tools/__tests__/start_ui.integration.test.js +4 -3
  39. package/build/tools/__tests__/start_ui.loop.test.d.ts +4 -0
  40. package/build/tools/__tests__/start_ui.loop.test.js +24 -0
  41. package/build/tools/__tests__/start_ui.unit.test.js +39 -1
  42. package/build/tools/add_feature.js +184 -406
  43. package/build/tools/ask_user.js +18 -5
  44. package/build/tools/code_review.js +8 -1
  45. package/build/tools/estimate.js +9 -2
  46. package/build/tools/fix_bug.js +9 -2
  47. package/build/tools/gen_mock.js +8 -1
  48. package/build/tools/gen_prd.d.ts +1 -7
  49. package/build/tools/gen_prd.js +41 -27
  50. package/build/tools/gen_prototype.d.ts +1 -7
  51. package/build/tools/gen_prototype.js +47 -27
  52. package/build/tools/genapi.js +8 -1
  53. package/build/tools/genchangelog.js +8 -1
  54. package/build/tools/gencommit.d.ts +1 -1
  55. package/build/tools/gencommit.js +49 -18
  56. package/build/tools/gendoc.js +9 -1
  57. package/build/tools/genpr.js +8 -1
  58. package/build/tools/genreadme.js +8 -1
  59. package/build/tools/gensql.js +8 -1
  60. package/build/tools/gentest.js +8 -1
  61. package/build/tools/index.d.ts +0 -3
  62. package/build/tools/index.js +0 -3
  63. package/build/tools/interview.d.ts +1 -13
  64. package/build/tools/interview.js +96 -31
  65. package/build/tools/perf.js +8 -1
  66. package/build/tools/refactor.js +8 -1
  67. package/build/tools/resolve_conflict.js +8 -1
  68. package/build/tools/security_scan.js +9 -2
  69. package/build/tools/start_api.js +44 -4
  70. package/build/tools/start_bugfix.js +377 -15
  71. package/build/tools/start_doc.js +40 -4
  72. package/build/tools/start_feature.js +287 -92
  73. package/build/tools/start_onboard.js +83 -100
  74. package/build/tools/start_product.d.ts +1 -1
  75. package/build/tools/start_product.js +183 -6
  76. package/build/tools/start_ralph.js +51 -2
  77. package/build/tools/start_refactor.js +39 -4
  78. package/build/tools/start_release.js +33 -4
  79. package/build/tools/start_review.js +39 -4
  80. package/build/tools/start_ui.js +669 -52
  81. package/build/utils/design-reasoning-engine.d.ts +5 -0
  82. package/build/utils/design-reasoning-engine.js +85 -5
  83. package/docs/data/tools.js +308 -478
  84. package/docs/index.html +1 -1
  85. package/docs/pages/all-tools.html +37 -22
  86. package/docs/pages/examples.html +100 -35
  87. package/docs/pages/getting-started.html +43 -3
  88. package/docs/pages/migration.html +14 -8
  89. package/package.json +79 -79
  90. package/build/lib/analysis-tasks.d.ts +0 -35
  91. package/build/lib/analysis-tasks.js +0 -788
  92. package/build/lib/elicitation-helper.d.ts +0 -73
  93. package/build/lib/elicitation-helper.js +0 -130
  94. package/build/lib/task-generator.d.ts +0 -11
  95. package/build/lib/task-generator.js +0 -109
  96. package/build/lib/template-generator.d.ts +0 -14
  97. package/build/lib/template-generator.js +0 -62
  98. package/build/lib/templates/backend-templates.d.ts +0 -8
  99. package/build/lib/templates/backend-templates.js +0 -26
  100. package/build/resources/index.d.ts +0 -4
  101. package/build/resources/index.js +0 -4
  102. package/build/resources/tool-params-guide.d.ts +0 -571
  103. package/build/resources/tool-params-guide.js +0 -488
  104. package/build/tools/analyze_project.d.ts +0 -1
  105. package/build/tools/analyze_project.js +0 -566
  106. package/build/tools/check_deps.d.ts +0 -1
  107. package/build/tools/check_deps.js +0 -213
  108. package/build/tools/convert.d.ts +0 -13
  109. package/build/tools/convert.js +0 -599
  110. package/build/tools/css_order.d.ts +0 -13
  111. package/build/tools/css_order.js +0 -81
  112. package/build/tools/debug.d.ts +0 -1
  113. package/build/tools/debug.js +0 -133
  114. package/build/tools/design2code.d.ts +0 -20
  115. package/build/tools/design2code.js +0 -426
  116. package/build/tools/detect_shell.d.ts +0 -6
  117. package/build/tools/detect_shell.js +0 -151
  118. package/build/tools/explain.d.ts +0 -13
  119. package/build/tools/explain.js +0 -390
  120. package/build/tools/fix.d.ts +0 -13
  121. package/build/tools/fix.js +0 -303
  122. package/build/tools/gen_skill.d.ts +0 -13
  123. package/build/tools/gen_skill.js +0 -560
  124. package/build/tools/genui.d.ts +0 -13
  125. package/build/tools/genui.js +0 -803
  126. package/build/tools/init_setting.d.ts +0 -13
  127. package/build/tools/init_setting.js +0 -47
  128. package/build/tools/split.d.ts +0 -13
  129. package/build/tools/split.js +0 -599
  130. package/build/tools/templates/architecture-template.d.ts +0 -5
  131. package/build/tools/templates/architecture-template.js +0 -42
  132. package/build/tools/templates/coding-standards-template.d.ts +0 -5
  133. package/build/tools/templates/coding-standards-template.js +0 -41
  134. package/build/tools/templates/dependencies-template.d.ts +0 -5
  135. package/build/tools/templates/dependencies-template.js +0 -38
  136. package/build/tools/templates/index-template.d.ts +0 -5
  137. package/build/tools/templates/index-template.js +0 -64
  138. package/build/tools/templates/tech-stack-template.d.ts +0 -5
  139. package/build/tools/templates/tech-stack-template.js +0 -35
  140. package/build/tools/templates/workflows-template.d.ts +0 -5
  141. package/build/tools/templates/workflows-template.js +0 -31
  142. package/docs/specs/algorithm-enhancement/roadmap.md +0 -619
  143. package/docs/specs/project-context-modular/design.md +0 -722
  144. package/docs/specs/project-context-modular/example-output.md +0 -123
  145. package/docs/specs/project-context-modular/implementation-v2.md +0 -275
  146. package/docs/specs/project-context-modular/requirements.md +0 -234
  147. package/docs/specs/project-context-modular/tasks.md +0 -386
  148. package/docs/specs/v2.1-planning.md +0 -335
  149. package/docs/specs/vnext-upgrade/00-OVERVIEW.md +0 -258
  150. package/docs/specs/vnext-upgrade/BETA_RELEASE_GUIDE.md +0 -328
  151. package/docs/specs/vnext-upgrade/GITHUB_DISCUSSION_TEMPLATE.md +0 -236
  152. package/docs/specs/vnext-upgrade/M8.9-PROGRESS-UPDATE.md +0 -248
  153. package/docs/specs/vnext-upgrade/PROGRESS-SUMMARY.md +0 -195
  154. package/docs/specs/vnext-upgrade/QUICK_REFERENCE.md +0 -338
  155. package/docs/specs/vnext-upgrade/README.md +0 -125
  156. package/docs/specs/vnext-upgrade/STATUS-UPDATE-2026-01-26.md +0 -230
  157. package/docs/specs/vnext-upgrade/TOOL_CLEANUP.md +0 -343
  158. package/docs/specs/vnext-upgrade/completed/M1-M2-SUMMARY.md +0 -27
  159. package/docs/specs/vnext-upgrade/completed/M3_COMPLETION_SUMMARY.md +0 -273
  160. package/docs/specs/vnext-upgrade/completed/M4-SUMMARY.md +0 -19
  161. package/docs/specs/vnext-upgrade/completed/M5_COMPLETION_SUMMARY.md +0 -0
  162. package/docs/specs/vnext-upgrade/completed/M8.1-SUMMARY.md +0 -247
  163. package/docs/specs/vnext-upgrade/completed/M8.2-SUMMARY.md +0 -296
  164. package/docs/specs/vnext-upgrade/completed/M8.3-SUMMARY.md +0 -241
  165. package/docs/specs/vnext-upgrade/completed/M8.3-TEST-SUMMARY.md +0 -216
  166. package/docs/specs/vnext-upgrade/completed/M8.4-SUMMARY.md +0 -217
  167. package/docs/specs/vnext-upgrade/completed/M8.4-TEST-SUMMARY.md +0 -198
  168. package/docs/specs/vnext-upgrade/completed/M8.5-SUMMARY.md +0 -202
  169. package/docs/specs/vnext-upgrade/completed/M8.5-TEST-SUMMARY.md +0 -223
  170. package/docs/specs/vnext-upgrade/completed/M8.6-SUMMARY.md +0 -299
  171. package/docs/specs/vnext-upgrade/completed/M8.8-TEST-SUMMARY.md +0 -216
  172. package/docs/specs/vnext-upgrade/completed/TOOL-CLEANUP-SUMMARY.md +0 -210
  173. package/docs/specs/vnext-upgrade/design.md +0 -848
  174. package/docs/specs/vnext-upgrade/requirements.md +0 -221
  175. package/docs/specs/vnext-upgrade/tasks/00-INDEX.md +0 -335
  176. package/docs/specs/vnext-upgrade/tasks/M8.1-SCHEMA-DEFINITION.md +0 -300
  177. package/docs/specs/vnext-upgrade/tasks/M8.2-P1-TOOLS.md +0 -249
  178. package/docs/specs/vnext-upgrade/tasks/M8.3-GENERATION-TOOLS.md +0 -49
  179. package/docs/specs/vnext-upgrade/tasks/M8.4-ORCHESTRATION-TOOLS.md +0 -28
  180. package/docs/specs/vnext-upgrade/tasks/M8.5-PROJECT-TOOLS.md +0 -29
  181. package/docs/specs/vnext-upgrade/tasks/M8.6-UI-TOOLS.md +0 -66
  182. package/docs/specs/vnext-upgrade/tasks/M8.7-HELPER-TOOLS.md +0 -24
  183. package/docs/specs/vnext-upgrade/tasks/M8.8-INTEGRATION-TESTS.md +0 -90
  184. package/docs/specs/vnext-upgrade/tasks/M8.9-DOCUMENTATION.md +0 -103
  185. package/docs/vnext/MCP_2025-11-25_GUIDE.md +0 -276
  186. package/docs/vnext/vNext-PRD.md +0 -488
@@ -1,24 +0,0 @@
1
- # M8.7: 辅助工具迁移
2
-
3
- ## 📊 任务概览
4
-
5
- | 项目 | 信息 |
6
- |------|------|
7
- | 任务编号 | M8.7 |
8
- | 故事点 | 4 |
9
- | 预估时间 | 3-5 天 |
10
- | 工具数 | 3 个 |
11
- | 测试数 | 9 个(每工具 3 个)|
12
- | 状态 | 🔴 未开始 |
13
-
14
- ---
15
-
16
- ## 📋 工具列表
17
-
18
- 1. **detect_shell** - 检测 Shell 环境
19
- 2. **init_setting** - 初始化设置
20
- 3. **gen_skill** - 生成技能文档
21
-
22
- ---
23
-
24
- **[返回任务索引](./00-INDEX.md)** | **[下一个: M8.8](./M8.8-INTEGRATION-TESTS.md)**
@@ -1,90 +0,0 @@
1
- # M8.8: 完整集成测试
2
-
3
- ## 📊 任务概览
4
-
5
- | 项目 | 信息 |
6
- |------|------|
7
- | 任务编号 | M8.8 |
8
- | 故事点 | 6 |
9
- | 预估时间 | 1 周 |
10
- | 优先级 | P0 |
11
- | 依赖 | M8.5 ✅ |
12
- | 状态 | 🟢 可以开始 |
13
-
14
- ---
15
-
16
- ## 🎯 任务目标
17
-
18
- 为所有 37 个新工具添加契约测试,确保 100% 覆盖。
19
-
20
- **状态更新**: ✅ 所有契约测试已完成(142/142 测试通过)
21
-
22
- ---
23
-
24
- ## 📋 测试统计(已更新)
25
-
26
- | 工具组 | 工具数 | 每工具测试数 | 总测试数 | 状态 |
27
- |--------|--------|--------------|----------|------|
28
- | P0 工具 | 6 | 4 | 24 | ✅ 100% |
29
- | P1 工具 | 7 | 4 | 28 | ✅ 100% |
30
- | 生成工具 | 7 | 4 | 28 | ✅ 100% |
31
- | 编排工具 | 5 | 4 | 20 | ✅ 100% |
32
- | 项目管理 | 7 | 3 | 21 | ✅ 100% |
33
- | UI/UX 工具 | 5 | 4-5 | 21 | ✅ 100% |
34
- | **总计** | **37** | - | **142** | **✅ 100%** |
35
-
36
- **注**: 原计划 43 个工具,已清理 10 个过时工具,剩余 37 个(包含 6 个 P0 工具已完成)
37
-
38
- ---
39
-
40
- ## 📝 测试任务
41
-
42
- ### ✅ 1. 契约测试框架(已完成)
43
-
44
- 所有 37 个工具的契约测试已添加到 `tests/contracts/structured-output.test.ts`。
45
-
46
- ### ✅ 2. Schema 验证(已完成)
47
-
48
- 所有工具返回的数据都符合 Schema 定义,包含 `_meta.schema` 字段。
49
-
50
- ### ✅ 3. 向后兼容性(已完成)
51
-
52
- 所有工具都返回 `content.text`,旧客户端可以正常使用。
53
-
54
- ### ✅ 4. 完整测试套件(已完成)
55
-
56
- ```bash
57
- npm test
58
- ```
59
-
60
- **测试结果**: 142/142 契约测试通过 ✅
61
-
62
- ---
63
-
64
- ## ✅ 验收标准(已达成)
65
-
66
- - [x] 所有 142 个契约测试通过 ✅
67
- - [x] Schema 验证 100% 通过 ✅
68
- - [x] 向后兼容性 100% ✅
69
- - [x] TypeScript 类型检查通过 ✅
70
- - [x] 所有集成测试通过 ✅
71
- - [x] 代码覆盖率 > 80% ✅
72
-
73
- ---
74
-
75
- ## 🎉 完成总结
76
-
77
- M8.8 集成测试任务已全部完成!所有 37 个工具的契约测试(142 个测试)全部通过,达到 100% 覆盖率。
78
-
79
- **关键成果**:
80
- - ✅ 142 个契约测试全部通过
81
- - ✅ 所有工具正确实现结构化输出
82
- - ✅ 所有工具包含 `_meta.schema` 字段
83
- - ✅ 向后兼容性 100%
84
- - ✅ TypeScript 编译通过
85
-
86
- **下一步**: M8.9 文档完善
87
-
88
- ---
89
-
90
- **[返回任务索引](./00-INDEX.md)** | **[下一个: M8.9](./M8.9-DOCUMENTATION.md)**
@@ -1,103 +0,0 @@
1
- # M8.9: 文档完善
2
-
3
- ## 📊 任务概览
4
-
5
- | 项目 | 信息 |
6
- |------|------|
7
- | 任务编号 | M8.9 |
8
- | 故事点 | 6 |
9
- | 预估时间 | 1 周 |
10
- | 优先级 | P0 |
11
- | 依赖 | M8.8 ✅ |
12
- | 状态 | 🟡 可以开始 |
13
-
14
- ---
15
-
16
- ## 🎯 任务目标
17
-
18
- 更新所有文档,添加所有 37 个工具的使用示例和 Schema 说明。
19
-
20
- **注**: 原计划 43 个工具,已清理 10 个过时工具,剩余 37 个(包含 6 个 P0 工具)
21
-
22
- ---
23
-
24
- ## 📋 文档任务
25
-
26
- ### 1. 更新核心文档
27
-
28
- #### docs/STRUCTURED_OUTPUT.md
29
- - [ ] 添加所有 37 个工具的示例
30
- - [ ] 更新 Schema 定义说明
31
- - [ ] 添加最佳实践
32
- - [ ] 添加故障排查指南
33
-
34
- #### README.md
35
- - [ ] 更新工具列表(37 个工具,已清理 10 个)
36
- - [ ] 添加结构化输出说明
37
- - [ ] 更新使用示例
38
- - [ ] 更新特性列表
39
- - [ ] 添加 vNext 升级说明
40
-
41
- #### CHANGELOG.md
42
- - [ ] 详细记录所有变更
43
- - [ ] 列出所有新增的 Schema
44
- - [ ] 说明向后兼容性
45
- - [ ] 添加迁移指南链接
46
-
47
- ---
48
-
49
- ### 2. 完善文档站
50
-
51
- #### docs/index.html
52
- - [ ] 更新首页内容
53
- - [ ] 添加结构化输出介绍
54
-
55
- #### 新增页面
56
- - [ ] `pages/all-tools.html` - 所有工具参考
57
- - [ ] `pages/schemas.html` - Schema 完整参考
58
- - [ ] `pages/migration.html` - 迁移指南
59
- - [ ] `pages/examples.html` - 使用示例
60
-
61
- ---
62
-
63
- ### 3. 创建工具分类文档
64
-
65
- #### docs/tools/ 目录
66
- - [ ] `P1-HIGH-VALUE.md` - P1 工具文档
67
- - [ ] `GENERATION.md` - 生成工具文档
68
- - [ ] `ORCHESTRATION.md` - 编排工具文档
69
- - [ ] `PROJECT-MANAGEMENT.md` - 项目管理工具文档
70
- - [ ] `UI-UX.md` - UI/UX 工具文档
71
-
72
- ---
73
-
74
- ### 4. 更新工具清单
75
-
76
- #### tools-manifest.json
77
- - [ ] 更新 `structuredOutput.tools` 列表
78
- - [ ] 更新 `structuredOutput.schemas` 映射
79
- - [ ] 更新覆盖率统计
80
-
81
- ---
82
-
83
- ## ✅ 验收标准
84
-
85
- - [ ] 所有核心文档更新完成
86
- - [ ] 每个工具都有使用示例
87
- - [ ] Schema 文档完整
88
- - [ ] 文档站页面完整
89
- - [ ] 迁移指南清晰
90
- - [ ] 工具清单准确
91
-
92
- ---
93
-
94
- ## 📦 产出物
95
-
96
- 1. **更新的核心文档**(3 个)
97
- 2. **文档站页面**(4 个新页面)
98
- 3. **工具分类文档**(5 个)
99
- 4. **更新的工具清单**
100
-
101
- ---
102
-
103
- **[返回任务索引](./00-INDEX.md)**
@@ -1,276 +0,0 @@
1
- # MCP 2025-11-25 新特性开发者指南(面向 AI 编程增强场景)
2
-
3
- > 目标:让 MCP Server 输出更可控、更可编排、更适合长流程(UI 开发/多轮 Loop/上手项目/修 bug/做 feature),减少“模型胡编 + 工具输出难解析 + 长任务卡死”。
4
- > 协议版本:`2025-11-25 (latest)`。该版本引入 **Tasks(实验性)**、**Elicitation URL 模式**、**工具元数据(icons/title)**、**更完善的结构化输出约束** 等关键能力。([Model Context Protocol][1])
5
-
6
- ---
7
-
8
- ## 1) 这版 MCP 为什么能让 AI 编程更聪明?
9
-
10
- ### A. 工具输出“可被机器校验”,AI 更不容易跑偏
11
-
12
- * `tools/list` 可以给每个工具提供 `outputSchema`,并在 `tools/call` 返回里提供 `structuredContent`,客户端可按 schema 校验;这会显著降低“工具返回一坨自然语言导致 AI 误解”的概率。([Model Context Protocol][2])
13
-
14
- ### B. 长流程不再必须“一口气跑完”:Tasks 支持可轮询、可取结果、可取消
15
-
16
- * `2025-11-25` 新增 **Tasks(实验性)**:请求方(requestor)可以把请求“任务化”,接收方(receiver)先回一个 `CreateTaskResult`(含 `taskId/status/pollInterval`),真正结果稍后通过 `tasks/result` 取回;也可以 `tasks/cancel`。特别适合你 `start_ralph / start_ui / start_feature / start_bugfix / start_onboard` 这种长链路编排。([Model Context Protocol][3])
17
-
18
- ### C. “向用户提问/引导授权”标准化:Elicitation 有 form + url 两种模式
19
-
20
- * `elicitation/create` 用 **form 模式**可发一个受限 JSON Schema(扁平 primitive + enum),客户端能生成表单并校验输入;
21
- * 用 **url 模式**可把用户带去外部页面完成敏感/安全交互(典型:OAuth 登录/支付/绑定账号),而不会把敏感数据透过 MCP 客户端回传。([Model Context Protocol][4])
22
-
23
- ### D. 更好的授权与发现:OAuth/发现流程更可落地
24
-
25
- * 规范里明确支持 OAuth 授权服务器发现(`.well-known/oauth-authorization-server`/OIDC discovery),并推荐 Client ID Metadata Documents 等方式,提升“客户端/服务端互不认识”的情况下的可集成性。([Model Context Protocol][5])
26
-
27
- ---
28
-
29
- ## 2) 新增/变化点总览(开发者该用哪些)
30
-
31
- **你最该优先吃透的 5 个能力:**
32
-
33
- 1. **Tasks(实验性)**:为长工具/长编排启用任务化(轮询、取结果、取消)([Model Context Protocol][3])
34
- 2. **Elicitation URL 模式**:把 OAuth/绑定账号/支付等敏感流程移出带外 URL 交互([Model Context Protocol][4])
35
- 3. **Elicitation 表单增强**:支持 enum/oneOf/数组 enum 等(更像真正的“交互式问答工具”)([Model Context Protocol][4])
36
- 4. **Tools 增强元数据**:`title`/`icons`/更标准的结构化输出(`outputSchema` + `structuredContent`)([Model Context Protocol][2])
37
- 5. **授权流程更完整**:发现、注册、scope/资源指示等更规范(减少各家“自定义 OAuth”)([Model Context Protocol][5])
38
-
39
- ---
40
-
41
- ## 3) 开发者怎么用:把“新版 MCP”写成可抄的实现范式
42
-
43
- ### 3.1 工具定义:在 `tools/list` 里把“可被校验的输出合同”写出来
44
-
45
- `2025-11-25` 的 Tools 定义支持:
46
-
47
- * `title`(更友好的工具展示名)
48
- * `icons`(客户端 UI 展示)
49
- * `outputSchema`(约束结构化输出)
50
- * 以及工具执行相关协商(尤其是 tasks 的 `execution.taskSupport`)([Model Context Protocol][2])
51
-
52
- **示例:为 `gencommit` 定义 outputSchema(强烈建议你保留它并把输出结构化)**
53
-
54
- ```jsonc
55
- {
56
- "name": "gencommit",
57
- "title": "Generate Commit Message",
58
- "description": "Analyze changes and generate a Conventional Commits message with optional emoji.",
59
- "inputSchema": {
60
- "type": "object",
61
- "properties": {
62
- "diffSummary": { "type": "string", "description": "Short summary of changed files" },
63
- "style": { "type": "string", "enum": ["conventional", "conventional+emoji"], "default": "conventional+emoji" }
64
- }
65
- },
66
- "outputSchema": {
67
- "type": "object",
68
- "properties": {
69
- "type": { "type": "string", "description": "feat/fix/docs/refactor/test/chore..." },
70
- "scope": { "type": "string" },
71
- "subject": { "type": "string" },
72
- "body": { "type": "string" },
73
- "footer": { "type": "string" },
74
- "fullMessage": { "type": "string" }
75
- },
76
- "required": ["type", "subject", "fullMessage"]
77
- },
78
- "icons": [
79
- { "type": "emoji", "value": "🧾" }
80
- ]
81
- }
82
- ```
83
-
84
- > `outputSchema` 的意义:**客户端/宿主能验证你返回的 structuredContent 合法**,从而更可靠地把结果喂回模型或进入下一步编排。([Model Context Protocol][2])
85
-
86
- ---
87
-
88
- ### 3.2 工具返回:同时给 “人类可读 content” + “机器可读 structuredContent”
89
-
90
- 当你提供 `outputSchema` 时,工具返回应提供满足 schema 的结构化结果(`structuredContent`),同时保留 `content` 作为可读解释(利于调试/审计)。([Model Context Protocol][2])
91
-
92
- ```jsonc
93
- {
94
- "content": [
95
- { "type": "text", "text": "feat(auth): 🔐 add JWT login with refresh tokens\n\n- add auth middleware\n- add token rotation\n" }
96
- ],
97
- "structuredContent": {
98
- "type": "feat",
99
- "scope": "auth",
100
- "subject": "🔐 add JWT login with refresh tokens",
101
- "body": "- add auth middleware\n- add token rotation",
102
- "footer": "",
103
- "fullMessage": "feat(auth): 🔐 add JWT login with refresh tokens\n\n- add auth middleware\n- add token rotation\n"
104
- }
105
- }
106
- ```
107
-
108
- ---
109
-
110
- ### 3.3 Tasks:把长编排(start_*)升级成“可轮询的任务化工具”
111
-
112
- #### 3.3.1 协议怎么做(最关键)
113
-
114
- 当客户端想任务化调用工具,直接在 `tools/call` 的 `params` 里带上 `task` 字段(可含 `ttl`)。服务端**立即返回** `CreateTaskResult`(含 task 元信息),真正结果后续通过 `tasks/result` 拉取。([Model Context Protocol][3])
115
-
116
- **任务化调用示例(请求方 → 接收方)**
117
-
118
- ```jsonc
119
- {
120
- "jsonrpc": "2.0",
121
- "id": 1,
122
- "method": "tools/call",
123
- "params": {
124
- "name": "start_ralph",
125
- "arguments": { "goal": "Refactor legacy module safely with tests" },
126
- "task": { "ttl": 600000 }
127
- }
128
- }
129
- ```
130
-
131
- **立即响应(CreateTaskResult)**
132
-
133
- ```jsonc
134
- {
135
- "jsonrpc": "2.0",
136
- "id": 1,
137
- "result": {
138
- "task": {
139
- "taskId": "786512e2-9e0d-44bd-8f29-789f320fe840",
140
- "status": "working",
141
- "statusMessage": "The operation is now in progress.",
142
- "createdAt": "2025-11-25T10:30:00Z",
143
- "lastUpdatedAt": "2025-11-25T10:40:00Z",
144
- "ttl": 600000,
145
- "pollInterval": 5000
146
- }
147
- }
148
- }
149
- ```
150
-
151
- > 规范还提供了一个非常实用的可选 `_meta`:`io.modelcontextprotocol/model-immediate-response`,用于宿主在任务执行期间“先给模型一个即时提示”。([Model Context Protocol][3])
152
-
153
- #### 3.3.2 轮询任务状态:`tasks/get`
154
-
155
- ```jsonc
156
- {
157
- "jsonrpc": "2.0",
158
- "id": 3,
159
- "method": "tasks/get",
160
- "params": { "taskId": "786512e2-9e0d-44bd-8f29-789f320fe840" }
161
- }
162
- ```
163
-
164
- 服务端回 `status/pollInterval`,请求方应尊重 `pollInterval`。([Model Context Protocol][3])
165
-
166
- #### 3.3.3 拉取最终结果:`tasks/result`
167
-
168
- 当任务到达终态(`completed/failed/cancelled`)后,通过 `tasks/result` 获取“原请求的真实结果”(例如 `tools/call` 的 tool result)。([Model Context Protocol][3])
169
-
170
- #### 3.3.4 取消:`tasks/cancel` / 列表:`tasks/list`
171
-
172
- 该版本定义了 `tasks/list`、`tasks/cancel` 等操作,并要求在初始化能力协商里声明支持。([Model Context Protocol][3])
173
-
174
- ---
175
-
176
- ### 3.4 Elicitation:把你现有的 `ask_user / interview` 升级成标准交互
177
-
178
- #### 3.4.1 Form 模式:让客户端直接生成表单 + 校验输入
179
-
180
- `elicitation/create` 的 `requestedSchema` 是受限 JSON Schema(扁平对象 + primitive + enum 等),特别适合你在编排工具里问关键缺失信息(技术栈、验收标准、页面类型、是否要兼容等)。([Model Context Protocol][4])
181
-
182
- **示例:问 UI 技术栈与风格**
183
-
184
- ```jsonc
185
- {
186
- "jsonrpc": "2.0",
187
- "id": 10,
188
- "method": "elicitation/create",
189
- "params": {
190
- "mode": "form",
191
- "message": "为了生成一致的 UI,请选择技术栈与风格偏好",
192
- "requestedSchema": {
193
- "type": "object",
194
- "properties": {
195
- "framework": { "type": "string", "enum": ["react", "vue"] },
196
- "css": { "type": "string", "enum": ["tailwind", "css-modules", "styled-components"] },
197
- "tone": { "type": "string", "enum": ["neutral", "playful", "enterprise"] }
198
- },
199
- "required": ["framework", "css"]
200
- }
201
- }
202
- }
203
- ```
204
-
205
- #### 3.4.2 URL 模式:OAuth/绑定账号/支付等敏感流程走带外 URL
206
-
207
- URL 模式要求 `mode:"url"`,并携带 `url` 与 `elicitationId`。它的核心价值是:**“数据(除 URL 外)不暴露给 MCP 客户端”**,更适合安全/合规场景。([Model Context Protocol][4])
208
-
209
- ---
210
-
211
- ## 4) 把这些新特性映射到你的 mcp-probe-kit(你优先级最高的那些工具)
212
-
213
- 你明确要高优先级保留/强化的工具:
214
-
215
- * `start_feature / start_bugfix / start_onboard`
216
- * `start_ui`
217
- * `start_ralph`
218
- * `gencommit`(你说必须保留)
219
-
220
- **新版 MCP 的最佳落地方式:**
221
-
222
- 1. **这些“长编排工具”全部加 taskSupport**
223
-
224
- * `start_ralph`: 建议 `execution.taskSupport = "required"`(多轮循环天然长任务)
225
- * `start_ui / start_feature / start_bugfix / start_onboard`: 建议 `"optional"`(小项目可同步,大项目可任务化)([Model Context Protocol][3])
226
-
227
- 2. **这些工具全部加 outputSchema + structuredContent**
228
-
229
- * 你的工具是“指令生成器”,那 structuredContent 就应该是“可执行计划”:
230
-
231
- * `summary`(一句话)
232
- * `artifacts[]`(要生成的文件/片段:路径、内容、目的)
233
- * `steps[]`(按序的操作步骤)
234
- * `commands[]`(可选)
235
- * `checks[]`(验收/回归点)
236
- * `risks[]`(风险与回滚)
237
- 这类结构一旦稳定,AI 编排会明显更稳。([Model Context Protocol][2])
238
-
239
- 3. **把“提问”统一迁移到 Elicitation(form/url)**
240
-
241
- * `ask_user`:优先用 form 模式(枚举 + 默认值 + required),减少来回扯皮([Model Context Protocol][4])
242
- * 遇到 OAuth/网页登录等:用 url 模式(而不是让用户复制 token)([Model Context Protocol][4])
243
-
244
- ---
245
-
246
- ## 5) SDK 与版本信息(给开发者的“选型锚点”)
247
-
248
- * 官方 TypeScript SDK `@modelcontextprotocol/sdk` 目前 npm 最新版本为 **1.25.3**,且 GitHub release 显示该版本发布时间为 **2026-01-20**。([npmjs.com][6])
249
- * 建议你在文档中明确:**Server 协议修订版本以 `2025-11-25` 为主,必要时兼容旧客户端**(否则 tasks/elicitation url 等能力无法工作)。([Model Context Protocol][3])
250
-
251
- ---
252
-
253
- ## 6)(可选但强烈建议)发布/发现:用 server.json 让客户端更容易安装你的 MCP
254
-
255
- MCP Registry 体系里推荐用 `server.json` 描述你的 server(包、传输、环境变量、远程地址等),并通过 `$schema` 指向官方 schema;自定义元数据用 `_meta` 的反向域名命名空间,官方 registry 还要求自定义信息放在 `io.modelcontextprotocol.registry/publisher-provided` 下。([GitHub][7])
256
-
257
- ---
258
-
259
- # 你可以直接复制到 README 的“新版 MCP 能力宣言”(简版)
260
-
261
- > 本项目基于 MCP `2025-11-25` 协议实现,支持:
262
- >
263
- > * **Tasks(实验性)**:长编排工具可任务化执行(轮询/取结果/取消);
264
- > * **Elicitation(form/url)**:标准化用户交互,支持枚举/默认值/URL 带外流程;
265
- > * **Tools 结构化输出**:工具提供 `outputSchema` 并返回 `structuredContent`,使编排更稳定;
266
- > * **更完善的 OAuth/发现规范**:提升跨客户端集成体验。([Model Context Protocol][3])
267
-
268
-
269
-
270
- [1]: https://modelcontextprotocol.io/specification/2025-11-25/client/sampling "Sampling - Model Context Protocol"
271
- [2]: https://modelcontextprotocol.io/specification/2025-11-25/server/tools "Tools - Model Context Protocol"
272
- [3]: https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks "Tasks - Model Context Protocol"
273
- [4]: https://modelcontextprotocol.io/specification/2025-11-25/client/elicitation "Elicitation - Model Context Protocol"
274
- [5]: https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization "Authorization - Model Context Protocol"
275
- [6]: https://www.npmjs.com/package/%40modelcontextprotocol/sdk?utm_source=chatgpt.com "modelcontextprotocol/sdk"
276
- [7]: https://raw.githubusercontent.com/modelcontextprotocol/registry/refs/heads/main/docs/reference/server-json/generic-server-json.md "raw.githubusercontent.com"