mcp-probe-kit 1.3.0 → 1.6.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.
- package/README.md +719 -74
- package/build/index.js +362 -1
- package/build/tools/add_feature.d.ts +33 -0
- package/build/tools/add_feature.js +464 -0
- package/build/tools/css_order.d.ts +13 -0
- package/build/tools/css_order.js +81 -0
- package/build/tools/estimate.d.ts +22 -0
- package/build/tools/estimate.js +225 -0
- package/build/tools/fix_bug.d.ts +24 -0
- package/build/tools/fix_bug.js +298 -0
- package/build/tools/gen_mock.d.ts +22 -0
- package/build/tools/gen_mock.js +250 -0
- package/build/tools/index.d.ts +15 -0
- package/build/tools/index.js +16 -0
- package/build/tools/init_project.js +121 -76
- package/build/tools/init_project_context.d.ts +26 -0
- package/build/tools/init_project_context.js +331 -0
- package/build/tools/security_scan.d.ts +22 -0
- package/build/tools/security_scan.js +282 -0
- package/build/tools/start_api.d.ts +19 -0
- package/build/tools/start_api.js +178 -0
- package/build/tools/start_bugfix.d.ts +19 -0
- package/build/tools/start_bugfix.js +127 -0
- package/build/tools/start_doc.d.ts +19 -0
- package/build/tools/start_doc.js +190 -0
- package/build/tools/start_feature.d.ts +19 -0
- package/build/tools/start_feature.js +122 -0
- package/build/tools/start_onboard.d.ts +19 -0
- package/build/tools/start_onboard.js +146 -0
- package/build/tools/start_refactor.d.ts +19 -0
- package/build/tools/start_refactor.js +175 -0
- package/build/tools/start_release.d.ts +19 -0
- package/build/tools/start_release.js +152 -0
- package/build/tools/start_review.d.ts +19 -0
- package/build/tools/start_review.js +162 -0
- package/docs/BEST_PRACTICES.md +722 -0
- package/docs/HOW_TO_TRIGGER.html +186 -0
- package/docs/HOW_TO_TRIGGER.md +941 -0
- package/docs/specs/add-feature/design.md +608 -0
- package/docs/specs/add-feature/requirements.md +175 -0
- package/docs/specs/add-feature/tasks.md +111 -0
- package/docs/specs/estimate/design.md +209 -0
- package/docs/specs/estimate/requirements.md +140 -0
- package/docs/specs/estimate/tasks.md +66 -0
- package/docs/specs/fix-bug/design.md +259 -0
- package/docs/specs/fix-bug/requirements.md +132 -0
- package/docs/specs/fix-bug/tasks.md +66 -0
- package/docs/specs/gen-mock/design.md +241 -0
- package/docs/specs/gen-mock/requirements.md +137 -0
- package/docs/specs/gen-mock/tasks.md +66 -0
- package/docs/specs/init-project-context/design.md +515 -0
- package/docs/specs/init-project-context/requirements.md +144 -0
- package/docs/specs/init-project-context/tasks.md +93 -0
- package/docs/specs/security-scan/design.md +152 -0
- package/docs/specs/security-scan/requirements.md +150 -0
- package/docs/specs/security-scan/tasks.md +67 -0
- package/docs/specs/start-bugfix/design.md +42 -0
- package/docs/specs/start-bugfix/requirements.md +70 -0
- package/docs/specs/start-bugfix/tasks.md +21 -0
- package/docs/specs/start-feature/design.md +41 -0
- package/docs/specs/start-feature/requirements.md +90 -0
- package/docs/specs/start-feature/tasks.md +21 -0
- package/docs/specs/start-review/requirements.md +0 -0
- package/package.json +66 -65
package/build/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
-
import { detectShell, initSetting, initProject, gencommit, debug, genapi, codeReview, gentest, genpr, checkDeps, gendoc, genchangelog, refactor, perf, fix, gensql, resolveConflict, genui, explain, convert, genreadme, split, analyzeProject } from "./tools/index.js";
|
|
5
|
+
import { detectShell, initSetting, initProject, gencommit, debug, genapi, codeReview, gentest, genpr, checkDeps, gendoc, genchangelog, refactor, perf, fix, gensql, resolveConflict, genui, explain, convert, cssOrder, genreadme, split, analyzeProject, initProjectContext, addFeature, securityScan, fixBug, estimate, genMock, startFeature, startBugfix, startReview, startRelease, startRefactor, startOnboard, startApi, startDoc } from "./tools/index.js";
|
|
6
6
|
import { VERSION, NAME } from "./version.js";
|
|
7
7
|
// 创建MCP服务器实例
|
|
8
8
|
const server = new Server({
|
|
@@ -373,6 +373,15 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
373
373
|
required: [],
|
|
374
374
|
},
|
|
375
375
|
},
|
|
376
|
+
{
|
|
377
|
+
name: "css_order",
|
|
378
|
+
description: "【CSS 顺序】按规则书写或重排 CSS 属性顺序",
|
|
379
|
+
inputSchema: {
|
|
380
|
+
type: "object",
|
|
381
|
+
properties: {},
|
|
382
|
+
required: [],
|
|
383
|
+
},
|
|
384
|
+
},
|
|
376
385
|
{
|
|
377
386
|
name: "genreadme",
|
|
378
387
|
description: "【README 生成器】根据项目代码生成 README.md 文档",
|
|
@@ -431,6 +440,311 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
431
440
|
required: [],
|
|
432
441
|
},
|
|
433
442
|
},
|
|
443
|
+
{
|
|
444
|
+
name: "init_project_context",
|
|
445
|
+
description: "【初始化项目上下文】生成项目上下文文档,记录技术栈、架构和规范,供后续功能开发参考",
|
|
446
|
+
inputSchema: {
|
|
447
|
+
type: "object",
|
|
448
|
+
properties: {
|
|
449
|
+
docs_dir: {
|
|
450
|
+
type: "string",
|
|
451
|
+
description: "文档目录(默认 docs)",
|
|
452
|
+
},
|
|
453
|
+
},
|
|
454
|
+
required: [],
|
|
455
|
+
},
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
name: "add_feature",
|
|
459
|
+
description: "【添加新功能】为已有项目生成新功能的规格文档(需求、设计、任务清单)",
|
|
460
|
+
inputSchema: {
|
|
461
|
+
type: "object",
|
|
462
|
+
properties: {
|
|
463
|
+
feature_name: {
|
|
464
|
+
type: "string",
|
|
465
|
+
description: "功能名称(kebab-case 格式,如 user-auth)",
|
|
466
|
+
},
|
|
467
|
+
description: {
|
|
468
|
+
type: "string",
|
|
469
|
+
description: "功能描述",
|
|
470
|
+
},
|
|
471
|
+
docs_dir: {
|
|
472
|
+
type: "string",
|
|
473
|
+
description: "文档目录(默认 docs)",
|
|
474
|
+
},
|
|
475
|
+
},
|
|
476
|
+
required: ["feature_name", "description"],
|
|
477
|
+
},
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
name: "security_scan",
|
|
481
|
+
description: "【安全扫描】分析代码安全性,检测注入、认证、加密等漏洞并提供修复建议",
|
|
482
|
+
inputSchema: {
|
|
483
|
+
type: "object",
|
|
484
|
+
properties: {
|
|
485
|
+
code: {
|
|
486
|
+
type: "string",
|
|
487
|
+
description: "需要扫描的代码",
|
|
488
|
+
},
|
|
489
|
+
language: {
|
|
490
|
+
type: "string",
|
|
491
|
+
description: "编程语言(默认自动检测)",
|
|
492
|
+
},
|
|
493
|
+
scan_type: {
|
|
494
|
+
type: "string",
|
|
495
|
+
description: "扫描类型:all, injection, auth, crypto, sensitive_data(默认 all)",
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
required: ["code"],
|
|
499
|
+
},
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
name: "fix_bug",
|
|
503
|
+
description: "【Bug修复】指导完整的Bug修复流程:定位→分析→修复→验证",
|
|
504
|
+
inputSchema: {
|
|
505
|
+
type: "object",
|
|
506
|
+
properties: {
|
|
507
|
+
error_message: {
|
|
508
|
+
type: "string",
|
|
509
|
+
description: "错误信息",
|
|
510
|
+
},
|
|
511
|
+
stack_trace: {
|
|
512
|
+
type: "string",
|
|
513
|
+
description: "堆栈跟踪",
|
|
514
|
+
},
|
|
515
|
+
steps_to_reproduce: {
|
|
516
|
+
type: "string",
|
|
517
|
+
description: "复现步骤",
|
|
518
|
+
},
|
|
519
|
+
expected_behavior: {
|
|
520
|
+
type: "string",
|
|
521
|
+
description: "期望行为",
|
|
522
|
+
},
|
|
523
|
+
actual_behavior: {
|
|
524
|
+
type: "string",
|
|
525
|
+
description: "实际行为",
|
|
526
|
+
},
|
|
527
|
+
},
|
|
528
|
+
required: ["error_message"],
|
|
529
|
+
},
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
name: "estimate",
|
|
533
|
+
description: "【工作量估算】评估开发任务的工作量,提供故事点、时间估算和风险分析",
|
|
534
|
+
inputSchema: {
|
|
535
|
+
type: "object",
|
|
536
|
+
properties: {
|
|
537
|
+
task_description: {
|
|
538
|
+
type: "string",
|
|
539
|
+
description: "任务描述",
|
|
540
|
+
},
|
|
541
|
+
code_context: {
|
|
542
|
+
type: "string",
|
|
543
|
+
description: "相关代码或文件内容",
|
|
544
|
+
},
|
|
545
|
+
team_size: {
|
|
546
|
+
type: "number",
|
|
547
|
+
description: "团队规模(默认 1)",
|
|
548
|
+
},
|
|
549
|
+
experience_level: {
|
|
550
|
+
type: "string",
|
|
551
|
+
description: "经验水平:junior, mid, senior(默认 mid)",
|
|
552
|
+
},
|
|
553
|
+
},
|
|
554
|
+
required: ["task_description"],
|
|
555
|
+
},
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
name: "gen_mock",
|
|
559
|
+
description: "【Mock数据生成】根据数据结构生成符合语义的模拟数据",
|
|
560
|
+
inputSchema: {
|
|
561
|
+
type: "object",
|
|
562
|
+
properties: {
|
|
563
|
+
schema: {
|
|
564
|
+
type: "string",
|
|
565
|
+
description: "数据结构定义(TypeScript interface 或 JSON Schema)",
|
|
566
|
+
},
|
|
567
|
+
count: {
|
|
568
|
+
type: "number",
|
|
569
|
+
description: "生成数量(默认 1,最大 1000)",
|
|
570
|
+
},
|
|
571
|
+
format: {
|
|
572
|
+
type: "string",
|
|
573
|
+
description: "输出格式:json, typescript, javascript, csv(默认 json)",
|
|
574
|
+
},
|
|
575
|
+
locale: {
|
|
576
|
+
type: "string",
|
|
577
|
+
description: "语言区域:zh-CN, en-US(默认 zh-CN)",
|
|
578
|
+
},
|
|
579
|
+
seed: {
|
|
580
|
+
type: "number",
|
|
581
|
+
description: "随机种子(用于可重复生成)",
|
|
582
|
+
},
|
|
583
|
+
},
|
|
584
|
+
required: ["schema"],
|
|
585
|
+
},
|
|
586
|
+
},
|
|
587
|
+
// ========== 智能编排工具 ==========
|
|
588
|
+
{
|
|
589
|
+
name: "start_feature",
|
|
590
|
+
description: "【编排】新功能开发:自动检查项目上下文 → 生成功能规格 → 工作量估算",
|
|
591
|
+
inputSchema: {
|
|
592
|
+
type: "object",
|
|
593
|
+
properties: {
|
|
594
|
+
feature_name: {
|
|
595
|
+
type: "string",
|
|
596
|
+
description: "功能名称(kebab-case 格式)",
|
|
597
|
+
},
|
|
598
|
+
description: {
|
|
599
|
+
type: "string",
|
|
600
|
+
description: "功能描述",
|
|
601
|
+
},
|
|
602
|
+
docs_dir: {
|
|
603
|
+
type: "string",
|
|
604
|
+
description: "文档目录(默认 docs)",
|
|
605
|
+
},
|
|
606
|
+
},
|
|
607
|
+
required: ["feature_name", "description"],
|
|
608
|
+
},
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
name: "start_bugfix",
|
|
612
|
+
description: "【编排】Bug修复:自动检查项目上下文 → Bug分析修复 → 生成测试",
|
|
613
|
+
inputSchema: {
|
|
614
|
+
type: "object",
|
|
615
|
+
properties: {
|
|
616
|
+
error_message: {
|
|
617
|
+
type: "string",
|
|
618
|
+
description: "错误信息",
|
|
619
|
+
},
|
|
620
|
+
stack_trace: {
|
|
621
|
+
type: "string",
|
|
622
|
+
description: "堆栈跟踪",
|
|
623
|
+
},
|
|
624
|
+
},
|
|
625
|
+
required: ["error_message"],
|
|
626
|
+
},
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
name: "start_review",
|
|
630
|
+
description: "【编排】代码体检:自动检查项目上下文 → 代码审查 → 安全扫描 → 性能分析",
|
|
631
|
+
inputSchema: {
|
|
632
|
+
type: "object",
|
|
633
|
+
properties: {
|
|
634
|
+
code: {
|
|
635
|
+
type: "string",
|
|
636
|
+
description: "需要审查的代码",
|
|
637
|
+
},
|
|
638
|
+
language: {
|
|
639
|
+
type: "string",
|
|
640
|
+
description: "编程语言",
|
|
641
|
+
},
|
|
642
|
+
},
|
|
643
|
+
required: ["code"],
|
|
644
|
+
},
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
name: "start_release",
|
|
648
|
+
description: "【编排】发布准备:自动检查项目上下文 → 生成Changelog → 生成PR描述",
|
|
649
|
+
inputSchema: {
|
|
650
|
+
type: "object",
|
|
651
|
+
properties: {
|
|
652
|
+
version: {
|
|
653
|
+
type: "string",
|
|
654
|
+
description: "版本号(如 v1.2.0)",
|
|
655
|
+
},
|
|
656
|
+
from_tag: {
|
|
657
|
+
type: "string",
|
|
658
|
+
description: "起始 tag(默认上个版本)",
|
|
659
|
+
},
|
|
660
|
+
branch: {
|
|
661
|
+
type: "string",
|
|
662
|
+
description: "分支名称",
|
|
663
|
+
},
|
|
664
|
+
},
|
|
665
|
+
required: ["version"],
|
|
666
|
+
},
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
name: "start_refactor",
|
|
670
|
+
description: "【编排】代码重构:自动检查项目上下文 → 代码审查 → 重构建议 → 生成测试",
|
|
671
|
+
inputSchema: {
|
|
672
|
+
type: "object",
|
|
673
|
+
properties: {
|
|
674
|
+
code: {
|
|
675
|
+
type: "string",
|
|
676
|
+
description: "需要重构的代码",
|
|
677
|
+
},
|
|
678
|
+
goal: {
|
|
679
|
+
type: "string",
|
|
680
|
+
description: "重构目标:improve_readability, reduce_complexity, extract_function 等",
|
|
681
|
+
},
|
|
682
|
+
},
|
|
683
|
+
required: ["code"],
|
|
684
|
+
},
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
name: "start_onboard",
|
|
688
|
+
description: "【编排】快速上手:分析项目结构 → 生成项目上下文文档",
|
|
689
|
+
inputSchema: {
|
|
690
|
+
type: "object",
|
|
691
|
+
properties: {
|
|
692
|
+
project_path: {
|
|
693
|
+
type: "string",
|
|
694
|
+
description: "项目路径(默认当前目录)",
|
|
695
|
+
},
|
|
696
|
+
docs_dir: {
|
|
697
|
+
type: "string",
|
|
698
|
+
description: "文档目录(默认 docs)",
|
|
699
|
+
},
|
|
700
|
+
},
|
|
701
|
+
required: [],
|
|
702
|
+
},
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
name: "start_api",
|
|
706
|
+
description: "【编排】API开发:自动检查项目上下文 → 生成API文档 → 生成Mock数据 → 生成测试",
|
|
707
|
+
inputSchema: {
|
|
708
|
+
type: "object",
|
|
709
|
+
properties: {
|
|
710
|
+
code: {
|
|
711
|
+
type: "string",
|
|
712
|
+
description: "API 代码",
|
|
713
|
+
},
|
|
714
|
+
language: {
|
|
715
|
+
type: "string",
|
|
716
|
+
description: "编程语言",
|
|
717
|
+
},
|
|
718
|
+
format: {
|
|
719
|
+
type: "string",
|
|
720
|
+
description: "文档格式:markdown, openapi(默认 markdown)",
|
|
721
|
+
},
|
|
722
|
+
},
|
|
723
|
+
required: ["code"],
|
|
724
|
+
},
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
name: "start_doc",
|
|
728
|
+
description: "【编排】文档生成:自动检查项目上下文 → 生成代码注释 → 生成README → 生成API文档",
|
|
729
|
+
inputSchema: {
|
|
730
|
+
type: "object",
|
|
731
|
+
properties: {
|
|
732
|
+
code: {
|
|
733
|
+
type: "string",
|
|
734
|
+
description: "代码或项目信息",
|
|
735
|
+
},
|
|
736
|
+
style: {
|
|
737
|
+
type: "string",
|
|
738
|
+
description: "注释风格:jsdoc, tsdoc(默认 jsdoc)",
|
|
739
|
+
},
|
|
740
|
+
lang: {
|
|
741
|
+
type: "string",
|
|
742
|
+
description: "语言:zh, en(默认 zh)",
|
|
743
|
+
},
|
|
744
|
+
},
|
|
745
|
+
required: ["code"],
|
|
746
|
+
},
|
|
747
|
+
},
|
|
434
748
|
],
|
|
435
749
|
};
|
|
436
750
|
});
|
|
@@ -479,12 +793,43 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
479
793
|
return await explain(args);
|
|
480
794
|
case "convert":
|
|
481
795
|
return await convert(args);
|
|
796
|
+
case "css_order":
|
|
797
|
+
return await cssOrder(args);
|
|
482
798
|
case "genreadme":
|
|
483
799
|
return await genreadme(args);
|
|
484
800
|
case "split":
|
|
485
801
|
return await split(args);
|
|
486
802
|
case "analyze_project":
|
|
487
803
|
return await analyzeProject(args);
|
|
804
|
+
case "init_project_context":
|
|
805
|
+
return await initProjectContext(args);
|
|
806
|
+
case "add_feature":
|
|
807
|
+
return await addFeature(args);
|
|
808
|
+
case "security_scan":
|
|
809
|
+
return await securityScan(args);
|
|
810
|
+
case "fix_bug":
|
|
811
|
+
return await fixBug(args);
|
|
812
|
+
case "estimate":
|
|
813
|
+
return await estimate(args);
|
|
814
|
+
case "gen_mock":
|
|
815
|
+
return await genMock(args);
|
|
816
|
+
// 智能编排工具
|
|
817
|
+
case "start_feature":
|
|
818
|
+
return await startFeature(args);
|
|
819
|
+
case "start_bugfix":
|
|
820
|
+
return await startBugfix(args);
|
|
821
|
+
case "start_review":
|
|
822
|
+
return await startReview(args);
|
|
823
|
+
case "start_release":
|
|
824
|
+
return await startRelease(args);
|
|
825
|
+
case "start_refactor":
|
|
826
|
+
return await startRefactor(args);
|
|
827
|
+
case "start_onboard":
|
|
828
|
+
return await startOnboard(args);
|
|
829
|
+
case "start_api":
|
|
830
|
+
return await startApi(args);
|
|
831
|
+
case "start_doc":
|
|
832
|
+
return await startDoc(args);
|
|
488
833
|
default:
|
|
489
834
|
throw new Error(`未知工具: ${name}`);
|
|
490
835
|
}
|
|
@@ -553,9 +898,25 @@ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
|
553
898
|
genui: "enabled",
|
|
554
899
|
explain: "enabled",
|
|
555
900
|
convert: "enabled",
|
|
901
|
+
css_order: "enabled",
|
|
556
902
|
genreadme: "enabled",
|
|
557
903
|
split: "enabled",
|
|
558
904
|
analyze_project: "enabled",
|
|
905
|
+
init_project_context: "enabled",
|
|
906
|
+
add_feature: "enabled",
|
|
907
|
+
security_scan: "enabled",
|
|
908
|
+
fix_bug: "enabled",
|
|
909
|
+
estimate: "enabled",
|
|
910
|
+
gen_mock: "enabled",
|
|
911
|
+
// 智能编排
|
|
912
|
+
start_feature: "enabled",
|
|
913
|
+
start_bugfix: "enabled",
|
|
914
|
+
start_review: "enabled",
|
|
915
|
+
start_release: "enabled",
|
|
916
|
+
start_refactor: "enabled",
|
|
917
|
+
start_onboard: "enabled",
|
|
918
|
+
start_api: "enabled",
|
|
919
|
+
start_doc: "enabled",
|
|
559
920
|
},
|
|
560
921
|
}, null, 2),
|
|
561
922
|
},
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* add_feature 工具
|
|
3
|
+
*
|
|
4
|
+
* 功能:为已有项目添加新功能的规格文档
|
|
5
|
+
* 模式:指令生成器模式 - 返回详细的生成指南,由 AI 执行实际操作
|
|
6
|
+
*
|
|
7
|
+
* 输出文件:
|
|
8
|
+
* - docs/specs/{feature_name}/requirements.md - 需求文档
|
|
9
|
+
* - docs/specs/{feature_name}/design.md - 设计文档
|
|
10
|
+
* - docs/specs/{feature_name}/tasks.md - 任务清单
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* add_feature 工具实现
|
|
14
|
+
*
|
|
15
|
+
* @param args - 工具参数
|
|
16
|
+
* @param args.feature_name - 功能名称(必填,kebab-case 格式)
|
|
17
|
+
* @param args.description - 功能描述(必填)
|
|
18
|
+
* @param args.docs_dir - 文档目录,默认 "docs"
|
|
19
|
+
* @returns MCP 响应,包含功能规格生成指南
|
|
20
|
+
*/
|
|
21
|
+
export declare function addFeature(args: any): Promise<{
|
|
22
|
+
content: {
|
|
23
|
+
type: string;
|
|
24
|
+
text: string;
|
|
25
|
+
}[];
|
|
26
|
+
isError?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
content: {
|
|
29
|
+
type: string;
|
|
30
|
+
text: string;
|
|
31
|
+
}[];
|
|
32
|
+
isError: boolean;
|
|
33
|
+
}>;
|