mcp-probe-kit 1.10.0 → 1.11.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.
@@ -0,0 +1,488 @@
1
+ /**
2
+ * 工具参数指南 Resource
3
+ * 为 AI 提供详细的参数说明和使用示例
4
+ */
5
+ export function getToolParamsGuide(version) {
6
+ return {
7
+ guide: "MCP Probe Kit 工具参数指南",
8
+ version,
9
+ important_notes: [
10
+ "所有工具的参数都是可选的(required: [])",
11
+ "AI 应该根据用户意图智能选择传递哪些参数",
12
+ "参数的值可以是自然语言描述,工具会智能提取",
13
+ "不要使用嵌套的 input 字段,直接传递参数",
14
+ "优先使用自然语言描述,工具会自动解析",
15
+ ],
16
+ best_practices: {
17
+ "1. 直接传参": "不要使用 {input: {...}},直接传 {description: '...'}",
18
+ "2. 自然语言": "参数值可以是自然语言,工具会智能处理",
19
+ "3. 最小化": "只传必要的参数,其他使用默认值",
20
+ "4. 描述优先": "对于功能开发类工具,优先传 description",
21
+ },
22
+ tools: {
23
+ // 基础工具
24
+ detect_shell: {
25
+ description: "当用户询问当前 AI 环境、是否为套壳产品时使用",
26
+ params: {
27
+ input: "任意格式输入,支持自然语言、JSON 字符串或空字符串",
28
+ },
29
+ examples: [
30
+ { input: "检测环境" },
31
+ { input: "检测是否为套壳" },
32
+ { input: "" },
33
+ ],
34
+ },
35
+ init_setting: {
36
+ description: "当用户需要初始化或配置 Cursor IDE 设置时使用",
37
+ params: {
38
+ input: "任意格式输入,支持自然语言、JSON 字符串或空字符串",
39
+ },
40
+ examples: [
41
+ { input: "初始化配置" },
42
+ { input: "初始化 Cursor 配置" },
43
+ { input: '{"project_path": "/path/to/project"}' },
44
+ ],
45
+ },
46
+ init_project: {
47
+ description: "当用户需要创建新项目、生成项目结构时使用",
48
+ params: {
49
+ input: "项目需求描述或自然语言",
50
+ },
51
+ examples: [
52
+ { input: "创建一个电商网站项目" },
53
+ { input: "创建博客系统" },
54
+ { input: '{"input": "项目需求", "project_name": "my-project"}' },
55
+ ],
56
+ },
57
+ // Git 工具
58
+ gencommit: {
59
+ description: "当用户需要生成 Git commit 消息时使用。返回 Conventional Commits 规范指南,AI 根据指南生成消息",
60
+ params: {
61
+ changes: "代码变更描述或 git diff 输出",
62
+ type: "commit 类型(feat/fix/docs/style/refactor/test/chore)",
63
+ },
64
+ examples: [
65
+ { changes: "帮我生成commit消息" },
66
+ { changes: "修复了登录bug" },
67
+ { changes: "git diff 输出...", type: "fix" },
68
+ ],
69
+ },
70
+ genchangelog: {
71
+ description: "当用户需要生成版本更新日志、准备发布时使用",
72
+ params: {
73
+ version: "版本号",
74
+ from: "起始版本或 tag",
75
+ to: "结束版本或 tag",
76
+ },
77
+ examples: [
78
+ { version: "v1.2.0" },
79
+ { version: "v1.2.0", from: "v1.0.0" },
80
+ { input: "生成 v1.2.0 的 changelog" },
81
+ ],
82
+ },
83
+ genpr: {
84
+ description: "当用户需要创建 Pull Request、生成 PR 描述时使用",
85
+ params: {
86
+ input: "commit 历史或自然语言描述",
87
+ },
88
+ examples: [
89
+ { input: "生成PR描述" },
90
+ { input: "git log 输出..." },
91
+ { input: '{"branch": "feature/xxx", "commits": "..."}' },
92
+ ],
93
+ },
94
+ resolve_conflict: {
95
+ description: "当用户遇到 Git 合并冲突、需要解决冲突时使用",
96
+ params: {
97
+ input: "冲突内容(包含 <<<<<<< ======= >>>>>>> 标记)",
98
+ },
99
+ examples: [
100
+ { input: "<<<<<<< HEAD\ncode1\n=======\ncode2\n>>>>>>> branch" },
101
+ { input: "git diff 输出..." },
102
+ ],
103
+ },
104
+ // 代码分析工具
105
+ debug: {
106
+ description: "当用户遇到错误、需要调试问题时使用",
107
+ params: {
108
+ error: "错误信息",
109
+ context: "相关代码或上下文",
110
+ },
111
+ examples: [
112
+ { error: "TypeError: Cannot read property name of undefined" },
113
+ { input: "帮我调试这个错误:..." },
114
+ { error: "错误信息", context: "相关代码" },
115
+ ],
116
+ },
117
+ code_review: {
118
+ description: "当用户需要审查代码质量、检查代码问题时使用",
119
+ params: {
120
+ code: "要审查的代码",
121
+ focus: "关注点(quality/security/performance)",
122
+ },
123
+ examples: [
124
+ { code: "function login() {...}" },
125
+ { input: "请审查这段代码:function login() {...}" },
126
+ { code: "代码", focus: "security" },
127
+ ],
128
+ },
129
+ explain: {
130
+ description: "当用户不理解某段代码、需要代码解释时使用",
131
+ params: {
132
+ code: "要解释的代码",
133
+ context: "业务背景",
134
+ },
135
+ examples: [
136
+ { code: "function fibonacci(n) {...}" },
137
+ { input: "解释这段代码:..." },
138
+ ],
139
+ },
140
+ perf: {
141
+ description: "当用户关注代码性能、需要优化性能时使用",
142
+ params: {
143
+ code: "要分析的代码",
144
+ type: "分析类型(algorithm/memory/database/react)",
145
+ },
146
+ examples: [
147
+ { code: "for(let i=0; i<n; i++) {...}" },
148
+ { input: "分析这段代码的性能问题:..." },
149
+ ],
150
+ },
151
+ security_scan: {
152
+ description: "当用户关注代码安全、需要检查安全漏洞时使用",
153
+ params: {
154
+ code: "要扫描的代码",
155
+ scan_type: "扫描类型(injection/auth/crypto/sensitive)",
156
+ },
157
+ examples: [
158
+ { code: "function login(username, password) {...}" },
159
+ { input: "扫描这段代码的安全问题:..." },
160
+ ],
161
+ },
162
+ refactor: {
163
+ description: "当用户需要重构代码、改善代码结构时使用",
164
+ params: {
165
+ code: "要重构的代码",
166
+ goal: "重构目标(improve_readability/reduce_complexity)",
167
+ },
168
+ examples: [
169
+ { code: "function process() {...}" },
170
+ { input: "帮我重构这段代码:..." },
171
+ ],
172
+ },
173
+ fix: {
174
+ description: "当用户需要自动修复代码问题(Lint/格式化/类型错误)时使用",
175
+ params: {
176
+ code: "要修复的代码",
177
+ type: "修复类型(lint/ts/format/import)",
178
+ },
179
+ examples: [
180
+ { code: "const x = 1" },
181
+ { input: "修复这段代码的问题:..." },
182
+ ],
183
+ },
184
+ fix_bug: {
185
+ description: "当用户需要修复 Bug、获取修复指导时使用",
186
+ params: {
187
+ error_message: "错误信息",
188
+ stack_trace: "堆栈跟踪",
189
+ },
190
+ examples: [
191
+ { error_message: "Error: Cannot find module..." },
192
+ { input: "帮我修复这个bug:..." },
193
+ ],
194
+ },
195
+ // 代码生成工具
196
+ gentest: {
197
+ description: "当用户需要为代码生成单元测试时使用",
198
+ params: {
199
+ code: "要测试的代码",
200
+ framework: "测试框架(jest/vitest/mocha)",
201
+ },
202
+ examples: [
203
+ { code: "function add(a, b) {...}" },
204
+ { input: "生成测试代码" },
205
+ { code: "函数代码", framework: "jest" },
206
+ ],
207
+ },
208
+ gendoc: {
209
+ description: "当用户需要为代码添加注释、生成文档时使用",
210
+ params: {
211
+ code: "要注释的代码",
212
+ style: "注释风格(jsdoc/tsdoc/javadoc)",
213
+ lang: "语言(zh/en)",
214
+ },
215
+ examples: [
216
+ { code: "function calculate() {...}" },
217
+ { input: "生成代码注释" },
218
+ ],
219
+ },
220
+ genapi: {
221
+ description: "当用户需要生成 API 文档时使用",
222
+ params: {
223
+ code: "API 代码(路由定义、Controller)",
224
+ format: "文档格式(markdown/openapi/jsdoc)",
225
+ },
226
+ examples: [
227
+ { code: "app.get('/users', ...) {...}" },
228
+ { input: "生成 API 文档" },
229
+ ],
230
+ },
231
+ genui: {
232
+ description: "当用户需要生成 UI 组件代码时使用",
233
+ params: {
234
+ description: "组件描述",
235
+ framework: "框架(react/vue/html)",
236
+ },
237
+ examples: [
238
+ { description: "生成一个登录表单组件" },
239
+ { description: "创建用户卡片组件", framework: "react" },
240
+ ],
241
+ },
242
+ gensql: {
243
+ description: "当用户需要根据自然语言生成 SQL 查询时使用",
244
+ params: {
245
+ description: "查询需求描述",
246
+ dialect: "SQL 方言(postgres/mysql/sqlite)",
247
+ },
248
+ examples: [
249
+ { description: "查询所有活跃用户的姓名和邮箱" },
250
+ { description: "从 users 表查询 name 和 email,条件是 status=active" },
251
+ ],
252
+ },
253
+ gen_mock: {
254
+ description: "当用户需要生成测试数据、Mock 数据时使用",
255
+ params: {
256
+ schema: "TypeScript 类型或 JSON Schema",
257
+ count: "生成数量",
258
+ format: "输出格式(json/typescript)",
259
+ locale: "语言环境(zh_CN/en_US)",
260
+ },
261
+ examples: [
262
+ { schema: "interface User { name: string; ... }" },
263
+ { input: "生成10条用户数据", count: 10 },
264
+ ],
265
+ },
266
+ design2code: {
267
+ description: "当用户需要将设计稿转换为代码时使用",
268
+ params: {
269
+ input: "设计稿 URL、描述或 HTML",
270
+ framework: "框架(react/vue/html)",
271
+ style_solution: "样式方案(css/scss/tailwind)",
272
+ component_type: "组件类型(page/component)",
273
+ },
274
+ examples: [
275
+ { input: "https://example.com/design.png" },
276
+ { input: "一个包含标题、输入框和按钮的登录页面" },
277
+ ],
278
+ },
279
+ // 文档和工具类
280
+ genreadme: {
281
+ description: "当用户需要生成项目 README 文档时使用",
282
+ params: {
283
+ project_info: "项目信息或代码",
284
+ style: "风格(simple/detailed)",
285
+ },
286
+ examples: [
287
+ { input: "生成README" },
288
+ { project_info: "项目信息..." },
289
+ ],
290
+ },
291
+ check_deps: {
292
+ description: "当用户需要检查项目依赖健康度、查找过期依赖时使用",
293
+ params: {
294
+ input: "任意输入或空字符串",
295
+ },
296
+ examples: [
297
+ { input: "检查依赖" },
298
+ { input: "" },
299
+ ],
300
+ },
301
+ convert: {
302
+ description: "当用户需要转换代码格式或框架时使用",
303
+ params: {
304
+ code: "要转换的代码",
305
+ from: "源格式(js/class/vue2)",
306
+ to: "目标格式(ts/hooks/vue3)",
307
+ },
308
+ examples: [
309
+ { code: "const x = 1", to: "typescript" },
310
+ { input: "转换为TypeScript:const x = 1" },
311
+ ],
312
+ },
313
+ css_order: {
314
+ description: "当用户需要整理 CSS 属性顺序时使用",
315
+ params: {
316
+ input: "CSS 代码或空字符串",
317
+ },
318
+ examples: [
319
+ { input: ".button { color: red; ... }" },
320
+ { input: "整理CSS属性顺序" },
321
+ ],
322
+ },
323
+ split: {
324
+ description: "当用户需要拆分大文件、模块化代码时使用",
325
+ params: {
326
+ file: "文件内容",
327
+ strategy: "拆分策略(auto/by-type/by-function)",
328
+ },
329
+ examples: [
330
+ { file: "完整的代码文件..." },
331
+ { input: "拆分这个文件:..." },
332
+ ],
333
+ },
334
+ // 项目管理工具
335
+ analyze_project: {
336
+ description: "当用户需要了解项目结构、分析项目技术栈时使用",
337
+ params: {
338
+ project_path: "项目路径",
339
+ max_depth: "扫描深度",
340
+ },
341
+ examples: [
342
+ { input: "分析项目" },
343
+ { project_path: "/path/to/project" },
344
+ ],
345
+ },
346
+ init_project_context: {
347
+ description: "当用户需要生成项目上下文文档、帮助团队快速上手时使用",
348
+ params: {
349
+ docs_dir: "文档目录",
350
+ },
351
+ examples: [
352
+ { input: "生成项目上下文文档" },
353
+ { docs_dir: "docs" },
354
+ ],
355
+ },
356
+ add_feature: {
357
+ description: "当用户需要添加新功能、生成功能规格文档时使用",
358
+ params: {
359
+ description: "功能描述(必需,可以是简短描述或详细需求)",
360
+ feature_name: "功能名称(可选,会从 description 自动提取)",
361
+ docs_dir: "文档目录(可选,默认 docs)",
362
+ },
363
+ examples: [
364
+ { description: "添加用户认证功能" },
365
+ {
366
+ feature_name: "user-auth",
367
+ description: "实现用户登录、注册、密码重置功能"
368
+ },
369
+ ],
370
+ important: "优先传 description,工具会自动提取 feature_name",
371
+ },
372
+ estimate: {
373
+ description: "当用户需要估算开发工作量、评估任务时间时使用",
374
+ params: {
375
+ task_description: "任务描述",
376
+ code_context: "相关代码",
377
+ team_size: "团队规模",
378
+ experience_level: "经验水平(junior/mid/senior)",
379
+ },
380
+ examples: [
381
+ { task_description: "实现用户认证功能" },
382
+ { input: "估算开发工作量" },
383
+ ],
384
+ },
385
+ // 智能编排工具
386
+ start_feature: {
387
+ description: "当用户需要完整的新功能开发流程时使用。编排:检查上下文→生成规格→估算工作量",
388
+ params: {
389
+ description: "功能描述(必需)",
390
+ feature_name: "功能名称(可选)",
391
+ docs_dir: "文档目录(可选)",
392
+ },
393
+ examples: [
394
+ { description: "开发用户认证功能" },
395
+ { description: "实现支付模块" },
396
+ ],
397
+ },
398
+ start_bugfix: {
399
+ description: "当用户需要完整的 Bug 修复流程时使用。编排:检查上下文→分析定位→修复方案→生成测试",
400
+ params: {
401
+ error_message: "错误信息",
402
+ stack_trace: "堆栈跟踪",
403
+ },
404
+ examples: [
405
+ { error_message: "Error: Cannot find module..." },
406
+ { input: "修复这个bug:..." },
407
+ ],
408
+ },
409
+ start_review: {
410
+ description: "当用户需要全面审查代码时使用。编排:代码审查+安全扫描+性能分析",
411
+ params: {
412
+ code: "要审查的代码",
413
+ language: "编程语言",
414
+ },
415
+ examples: [
416
+ { code: "function process() {...}" },
417
+ { input: "全面审查这段代码:..." },
418
+ ],
419
+ },
420
+ start_release: {
421
+ description: "当用户需要准备版本发布时使用。编排:生成 Changelog→生成 PR 描述",
422
+ params: {
423
+ version: "版本号",
424
+ from_tag: "起始 tag",
425
+ },
426
+ examples: [
427
+ { version: "v1.2.0" },
428
+ { input: "准备发布 v1.2.0" },
429
+ ],
430
+ },
431
+ start_refactor: {
432
+ description: "当用户需要完整的代码重构流程时使用。编排:审查现状→重构建议→生成测试",
433
+ params: {
434
+ code: "要重构的代码",
435
+ goal: "重构目标",
436
+ },
437
+ examples: [
438
+ { code: "function calculate() {...}" },
439
+ { input: "重构这段代码:..." },
440
+ ],
441
+ },
442
+ start_onboard: {
443
+ description: "当用户需要快速上手新项目时使用。编排:分析项目→生成上下文文档",
444
+ params: {
445
+ project_path: "项目路径",
446
+ docs_dir: "文档目录",
447
+ },
448
+ examples: [
449
+ { input: "快速上手这个项目" },
450
+ { project_path: "/path/to/project" },
451
+ ],
452
+ },
453
+ start_api: {
454
+ description: "当用户需要完整的 API 开发流程时使用。编排:生成文档→生成 Mock→生成测试",
455
+ params: {
456
+ code: "API 代码",
457
+ format: "文档格式",
458
+ },
459
+ examples: [
460
+ { code: "app.get('/users', ...) {...}" },
461
+ { input: "生成 API 文档和测试" },
462
+ ],
463
+ },
464
+ start_doc: {
465
+ description: "当用户需要补全项目文档时使用。编排:注释→README→API 文档",
466
+ params: {
467
+ code: "代码",
468
+ style: "注释风格",
469
+ },
470
+ examples: [
471
+ { input: "补全文档" },
472
+ { code: "代码..." },
473
+ ],
474
+ },
475
+ gen_skill: {
476
+ description: "当用户需要生成 Agent Skills 文档时使用",
477
+ params: {
478
+ scope: "范围(all/specific tool name)",
479
+ lang: "语言(zh/en)",
480
+ },
481
+ examples: [
482
+ { input: "生成技能文档" },
483
+ { scope: "all", lang: "zh" },
484
+ ],
485
+ },
486
+ },
487
+ };
488
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * 基础工具的 Schema 定义
3
+ */
4
+ export declare const basicToolSchemas: readonly [{
5
+ readonly name: "detect_shell";
6
+ readonly description: "当用户询问当前 AI 环境、是否为套壳产品时使用。检测 AI 应用环境指纹,返回 JSON 检测报告";
7
+ readonly inputSchema: {
8
+ readonly type: "object";
9
+ readonly properties: {
10
+ readonly nonce: {
11
+ readonly type: "string";
12
+ readonly description: "随机数,用于网络检测。可选";
13
+ };
14
+ readonly skip_network: {
15
+ readonly type: "boolean";
16
+ readonly description: "是否跳过网络检测。可选,默认 false";
17
+ };
18
+ };
19
+ readonly required: readonly [];
20
+ readonly additionalProperties: true;
21
+ };
22
+ }, {
23
+ readonly name: "init_setting";
24
+ readonly description: "当用户需要初始化或配置 Cursor IDE 设置时使用。写入推荐的 AI 配置到 .cursor/settings.json";
25
+ readonly inputSchema: {
26
+ readonly type: "object";
27
+ readonly properties: {
28
+ readonly project_path: {
29
+ readonly type: "string";
30
+ readonly description: "项目路径。可选,默认为当前工作区路径";
31
+ };
32
+ };
33
+ readonly required: readonly [];
34
+ readonly additionalProperties: true;
35
+ };
36
+ }, {
37
+ readonly name: "init_project";
38
+ readonly description: "当用户需要创建新项目、生成项目结构时使用。按 Spec-Driven Development 方式生成需求/设计/任务文档";
39
+ readonly inputSchema: {
40
+ readonly type: "object";
41
+ readonly properties: {
42
+ readonly input: {
43
+ readonly type: "string";
44
+ readonly description: "项目需求描述。可以是简短描述(如'创建电商网站')或详细的功能需求文档";
45
+ };
46
+ readonly project_name: {
47
+ readonly type: "string";
48
+ readonly description: "项目名称。可选,默认为'新项目'";
49
+ };
50
+ };
51
+ readonly required: readonly [];
52
+ readonly additionalProperties: true;
53
+ };
54
+ }];
@@ -0,0 +1,58 @@
1
+ /**
2
+ * 基础工具的 Schema 定义
3
+ */
4
+ export const basicToolSchemas = [
5
+ {
6
+ name: "detect_shell",
7
+ description: "当用户询问当前 AI 环境、是否为套壳产品时使用。检测 AI 应用环境指纹,返回 JSON 检测报告",
8
+ inputSchema: {
9
+ type: "object",
10
+ properties: {
11
+ nonce: {
12
+ type: "string",
13
+ description: "随机数,用于网络检测。可选",
14
+ },
15
+ skip_network: {
16
+ type: "boolean",
17
+ description: "是否跳过网络检测。可选,默认 false",
18
+ },
19
+ },
20
+ required: [],
21
+ additionalProperties: true,
22
+ },
23
+ },
24
+ {
25
+ name: "init_setting",
26
+ description: "当用户需要初始化或配置 Cursor IDE 设置时使用。写入推荐的 AI 配置到 .cursor/settings.json",
27
+ inputSchema: {
28
+ type: "object",
29
+ properties: {
30
+ project_path: {
31
+ type: "string",
32
+ description: "项目路径。可选,默认为当前工作区路径",
33
+ },
34
+ },
35
+ required: [],
36
+ additionalProperties: true,
37
+ },
38
+ },
39
+ {
40
+ name: "init_project",
41
+ description: "当用户需要创建新项目、生成项目结构时使用。按 Spec-Driven Development 方式生成需求/设计/任务文档",
42
+ inputSchema: {
43
+ type: "object",
44
+ properties: {
45
+ input: {
46
+ type: "string",
47
+ description: "项目需求描述。可以是简短描述(如'创建电商网站')或详细的功能需求文档",
48
+ },
49
+ project_name: {
50
+ type: "string",
51
+ description: "项目名称。可选,默认为'新项目'",
52
+ },
53
+ },
54
+ required: [],
55
+ additionalProperties: true,
56
+ },
57
+ },
58
+ ];