mcp-probe-kit 3.0.5 → 3.0.7

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 (69) hide show
  1. package/README.md +458 -431
  2. package/build/index.js +875 -141
  3. package/build/lib/gitnexus-bridge.d.ts +58 -0
  4. package/build/lib/gitnexus-bridge.js +379 -0
  5. package/build/lib/template-loader.js +317 -317
  6. package/build/lib/tool-execution-context.d.ts +8 -0
  7. package/build/lib/tool-execution-context.js +20 -0
  8. package/build/lib/toolset-manager.d.ts +1 -1
  9. package/build/lib/toolset-manager.js +7 -5
  10. package/build/schemas/code-analysis-tools.d.ts +46 -0
  11. package/build/schemas/code-analysis-tools.js +47 -0
  12. package/build/schemas/git-tools.js +16 -16
  13. package/build/schemas/index.d.ts +46 -0
  14. package/build/tools/__tests__/code_insight.unit.test.d.ts +1 -0
  15. package/build/tools/__tests__/code_insight.unit.test.js +35 -0
  16. package/build/tools/__tests__/start_bugfix.unit.test.js +14 -14
  17. package/build/tools/__tests__/start_ui.unit.test.js +11 -11
  18. package/build/tools/add_feature.js +79 -79
  19. package/build/tools/ask_user.js +5 -5
  20. package/build/tools/code_insight.d.ts +8 -0
  21. package/build/tools/code_insight.js +129 -0
  22. package/build/tools/index.d.ts +1 -0
  23. package/build/tools/index.js +1 -0
  24. package/build/tools/interview.js +9 -9
  25. package/build/tools/start_bugfix.d.ts +2 -1
  26. package/build/tools/start_bugfix.js +170 -126
  27. package/build/tools/start_feature.d.ts +2 -1
  28. package/build/tools/start_feature.js +156 -112
  29. package/build/tools/start_onboard.d.ts +2 -1
  30. package/build/tools/start_onboard.js +57 -51
  31. package/build/tools/start_product.d.ts +2 -1
  32. package/build/tools/start_product.js +9 -1
  33. package/build/tools/start_ralph.d.ts +2 -1
  34. package/build/tools/start_ralph.js +9 -3
  35. package/build/tools/start_ui.d.ts +2 -1
  36. package/build/tools/start_ui.js +102 -88
  37. package/build/tools/ui-ux-tools.d.ts +2 -1
  38. package/build/tools/ui-ux-tools.js +19 -3
  39. package/build/utils/ui-sync.d.ts +6 -2
  40. package/build/utils/ui-sync.js +125 -29
  41. package/docs/assets/font/MaterialSymbolsOutlined.codepoints +4102 -0
  42. package/docs/assets/font/MaterialSymbolsOutlined.ttf +0 -0
  43. package/docs/assets/font/noto-sans-sc-400.ttf +0 -0
  44. package/docs/assets/font/noto-sans-sc-700.ttf +0 -0
  45. package/docs/assets/font/noto-sans-sc-900.ttf +0 -0
  46. package/docs/assets/js/i18n.js +122 -21
  47. package/docs/assets/js/tailwind.js +83 -83
  48. package/docs/data/tools.js +419 -399
  49. package/docs/debug-i18n.html +163 -0
  50. package/docs/i18n/all-tools/en.json +157 -0
  51. package/docs/i18n/all-tools/ja.json +157 -0
  52. package/docs/i18n/all-tools/ko.json +157 -0
  53. package/docs/i18n/all-tools/zh-CN.json +157 -0
  54. package/docs/pages/all-tools.html +514 -352
  55. package/docs/pages/examples.html +689 -689
  56. package/docs/pages/getting-started.html +589 -589
  57. package/docs/pages/migration.html +298 -298
  58. package/docs/specs/user-auth/design.md +82 -0
  59. package/docs/specs/user-auth/requirements.md +52 -0
  60. package/docs/specs/user-auth/tasks.md +55 -0
  61. package/package.json +5 -5
  62. package/docs/project-context/architecture.md +0 -0
  63. package/docs/project-context/how-to-develop.md +0 -313
  64. package/docs/project-context/how-to-test.md +0 -457
  65. package/docs/project-context/tech-stack.md +0 -96
  66. package/docs/project-context.md +0 -53
  67. package/docs/specs/git-work-report/design.md +0 -568
  68. package/docs/specs/git-work-report/requirements.md +0 -131
  69. package/docs/specs/git-work-report/tasks.md +0 -197
@@ -0,0 +1,82 @@
1
+ # 设计文档:user-auth
2
+
3
+ ## 概述
4
+
5
+ 用户认证功能
6
+
7
+ 本设计文档描述 user-auth 功能的技术实现方案。
8
+
9
+ ---
10
+
11
+ ## 技术方案
12
+
13
+ ### 技术选型
14
+
15
+ | 类别 | 选择 | 理由 |
16
+ |------|------|------|
17
+ | [填写:类别] | [填写:技术] | [填写:选择理由] |
18
+
19
+ ### 架构设计
20
+
21
+ [填写:描述功能的架构设计,参考项目现有架构]
22
+
23
+ ```
24
+ [填写:架构图或流程图,使用 ASCII 或 Mermaid]
25
+ ```
26
+
27
+ ---
28
+
29
+ ## 数据模型
30
+
31
+ [填写:如果功能涉及数据存储,描述数据模型]
32
+
33
+ ---
34
+
35
+ ## API 设计
36
+
37
+ [填写:如果功能涉及 API,描述 API 设计]
38
+
39
+ ---
40
+
41
+ ## 文件结构
42
+
43
+ [填写:描述功能涉及的文件和目录]
44
+
45
+ ```
46
+ [项目目录]/
47
+ ├── [填写:新增文件1]
48
+ ├── [填写:新增文件2]
49
+ └── [填写:修改文件]
50
+ ```
51
+
52
+ ---
53
+
54
+ ## 设计决策
55
+
56
+ ### 决策 1: [填写:决策标题]
57
+
58
+ **问题**: [填写:描述面临的问题]
59
+
60
+ **选项**:
61
+ 1. [填写:选项 A]: [填写:描述]
62
+ 2. [填写:选项 B]: [填写:描述]
63
+
64
+ **决策**: 选择 [填写:选项]
65
+
66
+ **理由**: [填写:解释选择的理由]
67
+
68
+ ---
69
+
70
+ ## 风险评估
71
+
72
+ | 风险 | 影响 | 缓解措施 |
73
+ |------|------|----------|
74
+ | [填写:风险描述] | [填写:高/中/低] | [填写:缓解措施] |
75
+
76
+ ---
77
+
78
+ ## 检查清单
79
+
80
+ - [ ] 技术方案与现有架构一致
81
+ - [ ] 数据模型与接口定义清晰
82
+ - [ ] 关键设计决策已记录
@@ -0,0 +1,52 @@
1
+ # 需求文档:user-auth
2
+
3
+ ## 功能概述
4
+
5
+ 用户认证功能
6
+
7
+ ## 术语定义
8
+
9
+ - **[术语1]**: [填写:定义]
10
+ - **[术语2]**: [填写:定义]
11
+
12
+ ---
13
+
14
+ ## 需求列表
15
+
16
+ ### 需求 1: [填写:需求标题]
17
+
18
+ **用户故事:** 作为 [填写:角色],我想要 [填写:功能],以便 [填写:目标]。
19
+
20
+ #### 验收标准
21
+
22
+ 1. WHEN [填写:触发条件] THEN 系统 SHALL [填写:响应]
23
+ 2. WHILE [填写:状态条件] THE 系统 SHALL [填写:响应]
24
+ 3. IF [填写:异常条件] THEN 系统 SHALL [填写:处理方式]
25
+
26
+ ---
27
+
28
+ ## 非功能需求
29
+
30
+ ### 性能要求
31
+ - [填写:性能相关需求]
32
+
33
+ ### 安全要求
34
+ - [填写:安全相关需求]
35
+
36
+ ### 兼容性要求
37
+ - [填写:兼容性相关需求]
38
+
39
+ ---
40
+
41
+ ## 依赖关系
42
+
43
+ - [填写:列出与其他功能的依赖]
44
+
45
+ ---
46
+
47
+ ## 检查清单
48
+
49
+ - [ ] 需求覆盖核心场景与边界场景
50
+ - [ ] 验收标准使用 EARS 格式
51
+ - [ ] 非功能需求明确
52
+ - [ ] 依赖关系完整
@@ -0,0 +1,55 @@
1
+ # 任务清单:user-auth
2
+
3
+ ## 概述
4
+
5
+ 实现 user-auth 功能的任务分解。
6
+
7
+ ---
8
+
9
+ ## 任务列表
10
+
11
+ ### 阶段 1: 准备工作
12
+
13
+ - [ ] 1.1 [填写:任务标题]
14
+ - [填写:具体操作说明]
15
+ - _需求: [填写:对应的需求编号]_
16
+
17
+ ---
18
+
19
+ ### 阶段 2: 核心实现
20
+
21
+ - [ ] 2.1 [填写:任务标题]
22
+ - [填写:具体操作说明]
23
+ - _需求: [填写:对应的需求编号]_
24
+
25
+ ---
26
+
27
+ ### 阶段 3: 集成测试
28
+
29
+ - [ ] 3.1 [填写:任务标题]
30
+ - [填写:具体操作说明]
31
+ - _需求: [填写:对应的需求编号]_
32
+
33
+ ---
34
+
35
+ ## 检查点
36
+
37
+ - [ ] 阶段 1 完成后:[填写:验证内容]
38
+ - [ ] 阶段 2 完成后:[填写:验证内容]
39
+ - [ ] 阶段 3 完成后:[填写:验证内容]
40
+
41
+ ---
42
+
43
+ ## 文件变更清单
44
+
45
+ | 文件 | 操作 | 说明 |
46
+ |------|------|------|
47
+ | [填写:文件路径] | 新建/修改 | [填写:说明] |
48
+
49
+ ---
50
+
51
+ ## 检查清单
52
+
53
+ - [ ] 任务分阶段合理
54
+ - [ ] 每项任务可执行且可验证
55
+ - [ ] 任务与需求一一对应
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mcp-probe-kit",
3
- "version": "3.0.5",
4
- "description": "AI-Powered Development Toolkit - MCP Server with 21 tools covering code quality, development efficiency, project management, and UI/UX design. Features: Structured Output, Workflow Orchestration, UI/UX Pro Max, and Requirements Interview.",
3
+ "version": "3.0.7",
4
+ "description": "AI-Powered Development Toolkit - MCP Server with 22 tools covering code quality, development efficiency, project management, and UI/UX design. Features: Structured Output, Workflow Orchestration, UI/UX Pro Max, and Requirements Interview.",
5
5
  "mcpName": "io.github.mybolide/mcp-probe-kit",
6
6
  "type": "module",
7
7
  "main": "build/index.js",
@@ -47,14 +47,14 @@
47
47
  "license": "MIT",
48
48
  "repository": {
49
49
  "type": "git",
50
- "url": "https://github.com/mybolide/mcp-probe-kit.git"
50
+ "url": "git+https://github.com/mybolide/mcp-probe-kit.git"
51
51
  },
52
52
  "bugs": {
53
53
  "url": "https://github.com/mybolide/mcp-probe-kit/issues"
54
54
  },
55
55
  "homepage": "https://mcp-probe-kit.bytezonex.com",
56
56
  "engines": {
57
- "node": ">=16.0.0"
57
+ "node": ">=18.0.0"
58
58
  },
59
59
  "files": [
60
60
  "build",
@@ -63,7 +63,7 @@
63
63
  "LICENSE"
64
64
  ],
65
65
  "dependencies": {
66
- "@modelcontextprotocol/sdk": "^1.25.3",
66
+ "@modelcontextprotocol/sdk": "^1.27.1",
67
67
  "csv-parse": "^6.1.0",
68
68
  "tar": "^7.5.6"
69
69
  },
File without changes
@@ -1,313 +0,0 @@
1
- # 如何开发
2
-
3
- > 本文档描述 MCP Probe Kit 的开发新工具的基本步骤。
4
-
5
- ## 概述
6
-
7
- 本文档介绍如何在 MCP Probe Kit 中添加新工具。开发流程包括:定义 Schema → 实现工具逻辑 → 注册到服务器 → 测试验证。
8
-
9
- ## 开发新工具的步骤
10
-
11
- ### 第一步:定义工具 Schema
12
-
13
- 在 `src/schemas/` 目录下创建或编辑 Schema 文件,定义工具的输入参数和描述。
14
-
15
- **示例** - 添加 Git 工作报告工具 Schema (`src/schemas/git-tools.ts`):
16
-
17
- ```typescript
18
- export const gitWorkReportSchema: Tool = {
19
- name: "git_work_report",
20
- description: `基于 Git diff 分析生成工作报告(日报/周期报)
21
-
22
- 核心功能:
23
- - 支持日报模式(单个日期)和周期报模式(日期范围)
24
- - 自动读取指定日期的所有 Git 提交
25
- - 对每个提交执行 git show 获取完整 diff
26
- - 使用 AI 分析 diff 内容提取实际工作内容
27
-
28
- 输出格式:
29
- - 只输出「工作内容」部分
30
- - 每条以 - 开头,中文,简洁专业
31
- - 格式:做了什么 + 改了哪里/达到什么效果
32
- - 不输出:提交哈希、文件列表、统计数据、风险总结
33
-
34
- 使用示例:
35
- - 日报:git_work_report --date 2026-1-27
36
- - 周期报:git_work_report --start_date 2026-2-1 --end_date 2026-2-6`,
37
- inputSchema: {
38
- type: "object",
39
- properties: {
40
- date: {
41
- type: "string",
42
- description: "单个日期,格式 YYYY-MM-DD(日报模式)",
43
- },
44
- start_date: {
45
- type: "string",
46
- description: "起始日期,格式 YYYY-MM-DD(周期报模式)",
47
- },
48
- end_date: {
49
- type: "string",
50
- description: "结束日期,格式 YYYY-MM-DD(周期报模式)",
51
- },
52
- output_file: {
53
- type: "string",
54
- description: "可选,输出文件路径",
55
- },
56
- },
57
- },
58
- };
59
- ```
60
-
61
- **关键点:**
62
- - `name` - 工具名称(使用 snake_case)
63
- - `description` - 详细描述工具功能、使用场景、输出格式
64
- - `inputSchema` - JSON Schema 格式的参数定义
65
-
66
- ### 第二步:实现工具逻辑
67
-
68
- 在 `src/tools/` 目录下创建工具实现文件。
69
-
70
- **示例** - 实现 Git 工作报告工具 (`src/tools/git_work_report.ts`):
71
-
72
- ```typescript
73
- import { exec } from "child_process";
74
- import { promisify } from "util";
75
- import { formatResponse } from "../lib/response.js";
76
-
77
- const execAsync = promisify(exec);
78
-
79
- interface GitWorkReportArgs {
80
- date?: string;
81
- start_date?: string;
82
- end_date?: string;
83
- output_file?: string;
84
- }
85
-
86
- export async function gitWorkReport(args: GitWorkReportArgs) {
87
- try {
88
- // 1. 参数验证
89
- const isDaily = !!args.date;
90
- const isPeriod = !!(args.start_date && args.end_date);
91
-
92
- if (!isDaily && !isPeriod) {
93
- throw new Error("请提供 date(日报)或 start_date + end_date(周期报)");
94
- }
95
-
96
- // 2. 构建 git log 命令
97
- let gitCommand: string;
98
- if (isDaily) {
99
- gitCommand = `git log --since="${args.date} 00:00:00" --until="${args.date} 23:59:59" --format=%H`;
100
- } else {
101
- gitCommand = `git log --since="${args.start_date} 00:00:00" --until="${args.end_date} 23:59:59" --format=%H`;
102
- }
103
-
104
- // 3. 获取提交列表
105
- const { stdout: commits } = await execAsync(gitCommand);
106
- const commitList = commits.trim().split('\n').filter(Boolean);
107
-
108
- if (commitList.length === 0) {
109
- const message = "- 当日无代码提交(Git 无 commit 记录)";
110
- return formatResponse(message);
111
- }
112
-
113
- // 4. 获取每个提交的 diff
114
- const diffPromises = commitList.map(async (hash) => {
115
- const { stdout } = await execAsync(`git show ${hash}`);
116
- return stdout;
117
- });
118
- const diffs = await Promise.all(diffPromises);
119
-
120
- // 5. 构建 AI 分析提示
121
- const analysisPrompt = `
122
- 请分析以下 Git diff 内容,提取实际工作内容:
123
-
124
- ${diffs.join('\n\n---\n\n')}
125
-
126
- 要求:
127
- - 只输出「工作内容」部分
128
- - 每条以 - 开头
129
- - 中文,简洁专业,避免空话
130
- - 格式:做了什么 + 改了哪里/达到什么效果
131
- - 不输出:提交哈希、文件列表原文、统计数据、风险评估、总结段落
132
- `;
133
-
134
- // 6. 返回结果(AI 会基于此提示生成报告)
135
- return formatResponse(analysisPrompt);
136
-
137
- } catch (error) {
138
- const errorMessage = error instanceof Error ? error.message : String(error);
139
- return formatResponse(`错误: ${errorMessage}`, true);
140
- }
141
- }
142
- ```
143
-
144
- **关键点:**
145
- - 使用 TypeScript 类型定义参数
146
- - 使用 `formatResponse` 统一格式化输出
147
- - 错误处理要完善
148
- - 返回的内容应该是 AI 可以理解和处理的
149
-
150
- ### 第三步:导出工具
151
-
152
- 在 `src/tools/index.ts` 中导出新工具:
153
-
154
- ```typescript
155
- export { gitWorkReport } from "./git_work_report.js";
156
- ```
157
-
158
- 在 `src/schemas/index.ts` 中导出 Schema:
159
-
160
- ```typescript
161
- import { gitWorkReportSchema } from "./git-tools.js";
162
-
163
- export const allToolSchemas: Tool[] = [
164
- // ... 其他工具
165
- gitWorkReportSchema,
166
- ];
167
- ```
168
-
169
- ### 第四步:注册到 MCP 服务器
170
-
171
- 在 `src/index.ts` 中添加工具路由:
172
-
173
- ```typescript
174
- import { gitWorkReport } from "./tools/index.js";
175
-
176
- // 在 CallToolRequestSchema 处理器中添加
177
- server.setRequestHandler(CallToolRequestSchema, async (request) => {
178
- const { name, arguments: args } = request.params;
179
-
180
- try {
181
- switch (name) {
182
- // ... 其他工具
183
- case "git_work_report":
184
- return await gitWorkReport(args as any);
185
- default:
186
- throw new Error(`未知工具: ${name}`);
187
- }
188
- } catch (error) {
189
- // 错误处理
190
- }
191
- });
192
- ```
193
-
194
- ### 第五步:测试工具
195
-
196
- #### 本地测试
197
-
198
- ```bash
199
- # 编译代码
200
- npm run build
201
-
202
- # 使用 MCP Inspector 测试
203
- npm run inspector
204
- ```
205
-
206
- 在 Inspector 中:
207
- 1. 连接到服务器
208
- 2. 查看工具列表,确认新工具已注册
209
- 3. 调用工具,测试各种参数组合
210
- 4. 验证输出格式是否正确
211
-
212
- #### 单元测试
213
-
214
- 在 `src/tools/__tests__/` 创建测试文件:
215
-
216
- ```typescript
217
- import { describe, it, expect } from 'vitest';
218
- import { gitWorkReport } from '../git_work_report.js';
219
-
220
- describe('gitWorkReport', () => {
221
- it('应该在无提交时返回提示', async () => {
222
- const result = await gitWorkReport({ date: '2020-01-01' });
223
- expect(result.content[0].text).toContain('当日无代码提交');
224
- });
225
-
226
- it('应该验证参数', async () => {
227
- const result = await gitWorkReport({});
228
- expect(result.content[0].text).toContain('请提供');
229
- });
230
- });
231
- ```
232
-
233
- 运行测试:
234
-
235
- ```bash
236
- npm test
237
- ```
238
-
239
- ### 第六步:更新文档
240
-
241
- 1. 在 `docs/data/tools.js` 中添加工具信息
242
- 2. 更新 `README.md` 中的工具列表
243
- 3. 在 `docs/pages/all-tools.html` 中添加工具说明
244
-
245
- ## 开发编排工具
246
-
247
- 编排工具(`start_*`)需要返回委托式执行计划。
248
-
249
- **示例** - 简化的编排工具结构:
250
-
251
- ```typescript
252
- export async function startGitReport(args: any) {
253
- // 1. 生成执行计划
254
- const plan = {
255
- mode: "delegated",
256
- steps: [
257
- {
258
- id: "check_context",
259
- tool: "init_project_context",
260
- args: {},
261
- outputs: ["docs/project-context.md"],
262
- },
263
- {
264
- id: "generate_report",
265
- tool: "git_work_report",
266
- args: {
267
- date: args.date,
268
- start_date: args.start_date,
269
- end_date: args.end_date,
270
- },
271
- outputs: ["work-report.md"],
272
- },
273
- ],
274
- };
275
-
276
- // 2. 返回结构化输出
277
- return {
278
- content: [
279
- {
280
- type: "text",
281
- text: "执行计划已生成,请按步骤调用工具",
282
- },
283
- ],
284
- structuredContent: {
285
- summary: "Git 工作报告生成编排",
286
- status: "pending",
287
- metadata: {
288
- plan,
289
- },
290
- },
291
- };
292
- }
293
- ```
294
-
295
- ## 最佳实践
296
-
297
- 1. **参数验证** - 在工具开始时验证所有必需参数
298
- 2. **错误处理** - 使用 try-catch 捕获所有错误
299
- 3. **类型安全** - 使用 TypeScript 类型定义
300
- 4. **统一格式** - 使用 `formatResponse` 格式化输出
301
- 5. **结构化输出** - 编排工具返回 `structuredContent`
302
- 6. **文档完善** - Schema 的 description 要详细清晰
303
- 7. **测试覆盖** - 编写单元测试验证功能
304
-
305
- ## 调试技巧
306
-
307
- 1. **使用 console.error** - 在服务器端输出调试信息
308
- 2. **MCP Inspector** - 可视化测试工具调用
309
- 3. **查看日志** - 客户端通常有开发者工具可查看 MCP 通信
310
- 4. **单步调试** - 使用 VS Code 调试 TypeScript 代码
311
-
312
- ---
313
- *返回索引: [../project-context.md](../project-context.md)*