@rethunk/mcp-multi-root-git 2.3.4 → 2.4.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 (41) hide show
  1. package/AGENTS.md +29 -3
  2. package/CHANGELOG.md +43 -0
  3. package/HUMANS.md +54 -5
  4. package/README.md +15 -1
  5. package/dist/server/batch-commit-tool.js +244 -19
  6. package/dist/server/git-diff-tool.js +132 -0
  7. package/dist/server/git-fetch-tool.js +131 -0
  8. package/dist/server/git-push-tool.js +8 -1
  9. package/dist/server/git-show-tool.js +148 -0
  10. package/dist/server/git-stash-tool.js +131 -0
  11. package/dist/server/git-tag-tool.js +162 -0
  12. package/dist/server/git.js +18 -2
  13. package/dist/server/roots.js +8 -4
  14. package/dist/server/test-harness.js +68 -5
  15. package/dist/server/tool-parameter-schemas.js +21 -1
  16. package/dist/server/tools.js +11 -0
  17. package/docs/install.md +19 -2
  18. package/docs/mcp-tools.md +214 -5
  19. package/package.json +7 -5
  20. package/schemas/batch_commit.json +125 -0
  21. package/schemas/git_cherry_pick.json +63 -0
  22. package/schemas/git_diff.json +62 -0
  23. package/schemas/git_diff_summary.json +75 -0
  24. package/schemas/git_fetch.json +52 -0
  25. package/schemas/git_inventory.json +74 -0
  26. package/schemas/git_log.json +75 -0
  27. package/schemas/git_merge.json +79 -0
  28. package/schemas/git_parity.json +74 -0
  29. package/schemas/git_push.json +50 -0
  30. package/schemas/git_reset_soft.json +42 -0
  31. package/schemas/git_show.json +39 -0
  32. package/schemas/git_stash_apply.json +44 -0
  33. package/schemas/git_stash_list.json +30 -0
  34. package/schemas/git_status.json +49 -0
  35. package/schemas/git_tag.json +50 -0
  36. package/schemas/git_worktree_add.json +52 -0
  37. package/schemas/git_worktree_list.json +30 -0
  38. package/schemas/git_worktree_remove.json +48 -0
  39. package/schemas/index.json +108 -0
  40. package/schemas/list_presets.json +44 -0
  41. package/tool-parameters.schema.json +317 -4
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "@rethunk/mcp-multi-root-git: git_worktree_add",
4
+ "description": "Parameter schema for the 'git_worktree_add' MCP tool.",
5
+ "type": "object",
6
+ "properties": {
7
+ "workspaceRoot": {
8
+ "description": "Highest-priority override.",
9
+ "type": "string"
10
+ },
11
+ "rootIndex": {
12
+ "description": "0-based index into the MCP file roots list; ignored when workspaceRoot is set.",
13
+ "type": "integer",
14
+ "minimum": 0,
15
+ "maximum": 9007199254740991
16
+ },
17
+ "allWorkspaceRoots": {
18
+ "default": false,
19
+ "description": "Fan out across all MCP file roots.",
20
+ "type": "boolean"
21
+ },
22
+ "format": {
23
+ "default": "markdown",
24
+ "type": "string",
25
+ "enum": [
26
+ "markdown",
27
+ "json"
28
+ ]
29
+ },
30
+ "path": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "description": "Filesystem path for the new worktree. Relative paths are resolved from the git toplevel."
34
+ },
35
+ "branch": {
36
+ "type": "string",
37
+ "minLength": 1,
38
+ "description": "Branch to check out in the new worktree. Created from `baseRef` if absent."
39
+ },
40
+ "baseRef": {
41
+ "description": "Commit-ish to base the new branch on when it does not yet exist. Default: HEAD.",
42
+ "type": "string"
43
+ }
44
+ },
45
+ "required": [
46
+ "allWorkspaceRoots",
47
+ "format",
48
+ "path",
49
+ "branch"
50
+ ],
51
+ "additionalProperties": false
52
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "@rethunk/mcp-multi-root-git: git_worktree_list",
4
+ "description": "Parameter schema for the 'git_worktree_list' MCP tool.",
5
+ "type": "object",
6
+ "properties": {
7
+ "workspaceRoot": {
8
+ "description": "Highest-priority override.",
9
+ "type": "string"
10
+ },
11
+ "rootIndex": {
12
+ "description": "0-based index into the MCP file roots list; ignored when workspaceRoot is set.",
13
+ "type": "integer",
14
+ "minimum": 0,
15
+ "maximum": 9007199254740991
16
+ },
17
+ "format": {
18
+ "default": "markdown",
19
+ "type": "string",
20
+ "enum": [
21
+ "markdown",
22
+ "json"
23
+ ]
24
+ }
25
+ },
26
+ "required": [
27
+ "format"
28
+ ],
29
+ "additionalProperties": false
30
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "@rethunk/mcp-multi-root-git: git_worktree_remove",
4
+ "description": "Parameter schema for the 'git_worktree_remove' MCP tool.",
5
+ "type": "object",
6
+ "properties": {
7
+ "workspaceRoot": {
8
+ "description": "Highest-priority override.",
9
+ "type": "string"
10
+ },
11
+ "rootIndex": {
12
+ "description": "0-based index into the MCP file roots list; ignored when workspaceRoot is set.",
13
+ "type": "integer",
14
+ "minimum": 0,
15
+ "maximum": 9007199254740991
16
+ },
17
+ "allWorkspaceRoots": {
18
+ "default": false,
19
+ "description": "Fan out across all MCP file roots.",
20
+ "type": "boolean"
21
+ },
22
+ "format": {
23
+ "default": "markdown",
24
+ "type": "string",
25
+ "enum": [
26
+ "markdown",
27
+ "json"
28
+ ]
29
+ },
30
+ "path": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "description": "Path of the worktree to remove. Must not be the main worktree."
34
+ },
35
+ "force": {
36
+ "default": false,
37
+ "description": "Pass `--force` to allow removal of worktrees with uncommitted changes.",
38
+ "type": "boolean"
39
+ }
40
+ },
41
+ "required": [
42
+ "allWorkspaceRoots",
43
+ "format",
44
+ "path",
45
+ "force"
46
+ ],
47
+ "additionalProperties": false
48
+ }
@@ -0,0 +1,108 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "@rethunk/mcp-multi-root-git tool schemas index",
4
+ "description": "Index of all available MCP tool parameter schemas.",
5
+ "generatedBy": "scripts/generate-individual-schemas.ts",
6
+ "tools": [
7
+ {
8
+ "name": "git_status",
9
+ "file": "git_status.json",
10
+ "description": "Parameter schema for the 'git_status' MCP tool."
11
+ },
12
+ {
13
+ "name": "git_inventory",
14
+ "file": "git_inventory.json",
15
+ "description": "Parameter schema for the 'git_inventory' MCP tool."
16
+ },
17
+ {
18
+ "name": "git_parity",
19
+ "file": "git_parity.json",
20
+ "description": "Parameter schema for the 'git_parity' MCP tool."
21
+ },
22
+ {
23
+ "name": "list_presets",
24
+ "file": "list_presets.json",
25
+ "description": "Parameter schema for the 'list_presets' MCP tool."
26
+ },
27
+ {
28
+ "name": "git_log",
29
+ "file": "git_log.json",
30
+ "description": "Parameter schema for the 'git_log' MCP tool."
31
+ },
32
+ {
33
+ "name": "git_diff_summary",
34
+ "file": "git_diff_summary.json",
35
+ "description": "Parameter schema for the 'git_diff_summary' MCP tool."
36
+ },
37
+ {
38
+ "name": "git_diff",
39
+ "file": "git_diff.json",
40
+ "description": "Parameter schema for the 'git_diff' MCP tool."
41
+ },
42
+ {
43
+ "name": "git_show",
44
+ "file": "git_show.json",
45
+ "description": "Parameter schema for the 'git_show' MCP tool."
46
+ },
47
+ {
48
+ "name": "git_worktree_list",
49
+ "file": "git_worktree_list.json",
50
+ "description": "Parameter schema for the 'git_worktree_list' MCP tool."
51
+ },
52
+ {
53
+ "name": "git_stash_list",
54
+ "file": "git_stash_list.json",
55
+ "description": "Parameter schema for the 'git_stash_list' MCP tool."
56
+ },
57
+ {
58
+ "name": "git_fetch",
59
+ "file": "git_fetch.json",
60
+ "description": "Parameter schema for the 'git_fetch' MCP tool."
61
+ },
62
+ {
63
+ "name": "batch_commit",
64
+ "file": "batch_commit.json",
65
+ "description": "Parameter schema for the 'batch_commit' MCP tool."
66
+ },
67
+ {
68
+ "name": "git_push",
69
+ "file": "git_push.json",
70
+ "description": "Parameter schema for the 'git_push' MCP tool."
71
+ },
72
+ {
73
+ "name": "git_merge",
74
+ "file": "git_merge.json",
75
+ "description": "Parameter schema for the 'git_merge' MCP tool."
76
+ },
77
+ {
78
+ "name": "git_cherry_pick",
79
+ "file": "git_cherry_pick.json",
80
+ "description": "Parameter schema for the 'git_cherry_pick' MCP tool."
81
+ },
82
+ {
83
+ "name": "git_reset_soft",
84
+ "file": "git_reset_soft.json",
85
+ "description": "Parameter schema for the 'git_reset_soft' MCP tool."
86
+ },
87
+ {
88
+ "name": "git_tag",
89
+ "file": "git_tag.json",
90
+ "description": "Parameter schema for the 'git_tag' MCP tool."
91
+ },
92
+ {
93
+ "name": "git_worktree_add",
94
+ "file": "git_worktree_add.json",
95
+ "description": "Parameter schema for the 'git_worktree_add' MCP tool."
96
+ },
97
+ {
98
+ "name": "git_worktree_remove",
99
+ "file": "git_worktree_remove.json",
100
+ "description": "Parameter schema for the 'git_worktree_remove' MCP tool."
101
+ },
102
+ {
103
+ "name": "git_stash_apply",
104
+ "file": "git_stash_apply.json",
105
+ "description": "Parameter schema for the 'git_stash_apply' MCP tool."
106
+ }
107
+ ]
108
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "@rethunk/mcp-multi-root-git: list_presets",
4
+ "description": "Parameter schema for the 'list_presets' MCP tool.",
5
+ "type": "object",
6
+ "properties": {
7
+ "workspaceRoot": {
8
+ "description": "Highest-priority override.",
9
+ "type": "string"
10
+ },
11
+ "rootIndex": {
12
+ "description": "0-based index into the MCP file roots list; ignored when workspaceRoot is set.",
13
+ "type": "integer",
14
+ "minimum": 0,
15
+ "maximum": 9007199254740991
16
+ },
17
+ "allWorkspaceRoots": {
18
+ "default": false,
19
+ "description": "Fan out across all MCP file roots.",
20
+ "type": "boolean"
21
+ },
22
+ "absoluteGitRoots": {
23
+ "description": "Absolute paths to git repo roots. Use for many sibling clones under a non-git parent directory.",
24
+ "maxItems": 256,
25
+ "type": "array",
26
+ "items": {
27
+ "type": "string"
28
+ }
29
+ },
30
+ "format": {
31
+ "default": "markdown",
32
+ "type": "string",
33
+ "enum": [
34
+ "markdown",
35
+ "json"
36
+ ]
37
+ }
38
+ },
39
+ "required": [
40
+ "allWorkspaceRoots",
41
+ "format"
42
+ ],
43
+ "additionalProperties": false
44
+ }
@@ -383,6 +383,103 @@
383
383
  ],
384
384
  "additionalProperties": false
385
385
  },
386
+ "git_diff": {
387
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
388
+ "type": "object",
389
+ "properties": {
390
+ "workspaceRoot": {
391
+ "description": "Highest-priority override.",
392
+ "type": "string"
393
+ },
394
+ "rootIndex": {
395
+ "description": "0-based index into the MCP file roots list; ignored when workspaceRoot is set.",
396
+ "type": "integer",
397
+ "minimum": 0,
398
+ "maximum": 9007199254740991
399
+ },
400
+ "allWorkspaceRoots": {
401
+ "default": false,
402
+ "description": "Fan out across all MCP file roots.",
403
+ "type": "boolean"
404
+ },
405
+ "absoluteGitRoots": {
406
+ "description": "Absolute paths to git repo roots. Use for many sibling clones under a non-git parent directory.",
407
+ "maxItems": 256,
408
+ "type": "array",
409
+ "items": {
410
+ "type": "string"
411
+ }
412
+ },
413
+ "format": {
414
+ "default": "markdown",
415
+ "type": "string",
416
+ "enum": [
417
+ "markdown",
418
+ "json"
419
+ ]
420
+ },
421
+ "base": {
422
+ "description": "Base ref (e.g. \"main\", \"HEAD~3\"). Required for range diffs. If omitted and `staged: false`, shows unstaged changes.",
423
+ "type": "string"
424
+ },
425
+ "head": {
426
+ "description": "Head ref (e.g. \"feature-branch\"). If omitted, defaults to HEAD. Only used if `base` is provided.",
427
+ "type": "string"
428
+ },
429
+ "path": {
430
+ "description": "Scope diff to a single file path (e.g. \"src/main.ts\").",
431
+ "type": "string"
432
+ },
433
+ "staged": {
434
+ "default": false,
435
+ "description": "If true, show staged changes (git diff --staged). Ignored if `base` is provided.",
436
+ "type": "boolean"
437
+ }
438
+ },
439
+ "required": [
440
+ "allWorkspaceRoots",
441
+ "format",
442
+ "staged"
443
+ ],
444
+ "additionalProperties": false
445
+ },
446
+ "git_show": {
447
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
448
+ "type": "object",
449
+ "properties": {
450
+ "workspaceRoot": {
451
+ "description": "Highest-priority override.",
452
+ "type": "string"
453
+ },
454
+ "rootIndex": {
455
+ "description": "0-based index into the MCP file roots list; ignored when workspaceRoot is set.",
456
+ "type": "integer",
457
+ "minimum": 0,
458
+ "maximum": 9007199254740991
459
+ },
460
+ "format": {
461
+ "default": "markdown",
462
+ "type": "string",
463
+ "enum": [
464
+ "markdown",
465
+ "json"
466
+ ]
467
+ },
468
+ "ref": {
469
+ "type": "string",
470
+ "description": "Commit reference (SHA, branch, tag, or any git rev-spec)."
471
+ },
472
+ "path": {
473
+ "description": "Optional file path to inspect at the ref. If provided, shows that path's content at the ref instead of the diff.",
474
+ "type": "string"
475
+ }
476
+ },
477
+ "required": [
478
+ "format",
479
+ "ref"
480
+ ],
481
+ "additionalProperties": false
482
+ },
386
483
  "git_worktree_list": {
387
484
  "$schema": "https://json-schema.org/draft/2020-12/schema",
388
485
  "type": "object",
@@ -411,6 +508,84 @@
411
508
  ],
412
509
  "additionalProperties": false
413
510
  },
511
+ "git_stash_list": {
512
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
513
+ "type": "object",
514
+ "properties": {
515
+ "workspaceRoot": {
516
+ "description": "Highest-priority override.",
517
+ "type": "string"
518
+ },
519
+ "rootIndex": {
520
+ "description": "0-based index into the MCP file roots list; ignored when workspaceRoot is set.",
521
+ "type": "integer",
522
+ "minimum": 0,
523
+ "maximum": 9007199254740991
524
+ },
525
+ "format": {
526
+ "default": "markdown",
527
+ "type": "string",
528
+ "enum": [
529
+ "markdown",
530
+ "json"
531
+ ]
532
+ }
533
+ },
534
+ "required": [
535
+ "format"
536
+ ],
537
+ "additionalProperties": false
538
+ },
539
+ "git_fetch": {
540
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
541
+ "type": "object",
542
+ "properties": {
543
+ "workspaceRoot": {
544
+ "description": "Highest-priority override.",
545
+ "type": "string"
546
+ },
547
+ "rootIndex": {
548
+ "description": "0-based index into the MCP file roots list; ignored when workspaceRoot is set.",
549
+ "type": "integer",
550
+ "minimum": 0,
551
+ "maximum": 9007199254740991
552
+ },
553
+ "format": {
554
+ "default": "markdown",
555
+ "type": "string",
556
+ "enum": [
557
+ "markdown",
558
+ "json"
559
+ ]
560
+ },
561
+ "remote": {
562
+ "default": "origin",
563
+ "description": "Remote to fetch from (default: origin).",
564
+ "type": "string"
565
+ },
566
+ "branch": {
567
+ "description": "If specified: fetch only this branch (e.g. 'main').",
568
+ "type": "string"
569
+ },
570
+ "prune": {
571
+ "default": false,
572
+ "description": "Pass --prune to remove deleted remote branches (default: false).",
573
+ "type": "boolean"
574
+ },
575
+ "tags": {
576
+ "default": false,
577
+ "description": "Pass --tags to also fetch all tags (default: false).",
578
+ "type": "boolean"
579
+ }
580
+ },
581
+ "required": [
582
+ "format",
583
+ "remote",
584
+ "prune",
585
+ "tags"
586
+ ],
587
+ "additionalProperties": false
588
+ },
414
589
  "batch_commit": {
415
590
  "$schema": "https://json-schema.org/draft/2020-12/schema",
416
591
  "type": "object",
@@ -454,10 +629,52 @@
454
629
  "minItems": 1,
455
630
  "type": "array",
456
631
  "items": {
457
- "type": "string",
458
- "minLength": 1
632
+ "anyOf": [
633
+ {
634
+ "type": "string",
635
+ "minLength": 1
636
+ },
637
+ {
638
+ "type": "object",
639
+ "properties": {
640
+ "path": {
641
+ "type": "string",
642
+ "minLength": 1,
643
+ "description": "File path relative to git root."
644
+ },
645
+ "lines": {
646
+ "type": "object",
647
+ "properties": {
648
+ "from": {
649
+ "type": "integer",
650
+ "minimum": 1,
651
+ "maximum": 9007199254740991,
652
+ "description": "Start line number (1-indexed)."
653
+ },
654
+ "to": {
655
+ "type": "integer",
656
+ "minimum": 1,
657
+ "maximum": 9007199254740991,
658
+ "description": "End line number (1-indexed, inclusive)."
659
+ }
660
+ },
661
+ "required": [
662
+ "from",
663
+ "to"
664
+ ],
665
+ "additionalProperties": false,
666
+ "description": "Line range to stage. Only hunks overlapping [from, to] are staged."
667
+ }
668
+ },
669
+ "required": [
670
+ "path",
671
+ "lines"
672
+ ],
673
+ "additionalProperties": false
674
+ }
675
+ ]
459
676
  },
460
- "description": "Paths to stage, relative to the git root."
677
+ "description": "Paths to stage, relative to the git root. Each can be a string path or { path, lines } for hunk-level staging."
461
678
  }
462
679
  },
463
680
  "required": [
@@ -476,13 +693,19 @@
476
693
  "never",
477
694
  "after"
478
695
  ]
696
+ },
697
+ "dryRun": {
698
+ "default": false,
699
+ "description": "When true, stage files, collect preview (files staged, commit messages), return preview response without writing commits. Unstages any files that were staged for the preview. Response indicates DRY RUN mode.",
700
+ "type": "boolean"
479
701
  }
480
702
  },
481
703
  "required": [
482
704
  "allWorkspaceRoots",
483
705
  "format",
484
706
  "commits",
485
- "push"
707
+ "push",
708
+ "dryRun"
486
709
  ],
487
710
  "additionalProperties": false
488
711
  },
@@ -712,6 +935,54 @@
712
935
  ],
713
936
  "additionalProperties": false
714
937
  },
938
+ "git_tag": {
939
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
940
+ "type": "object",
941
+ "properties": {
942
+ "workspaceRoot": {
943
+ "description": "Highest-priority override.",
944
+ "type": "string"
945
+ },
946
+ "rootIndex": {
947
+ "description": "0-based index into the MCP file roots list; ignored when workspaceRoot is set.",
948
+ "type": "integer",
949
+ "minimum": 0,
950
+ "maximum": 9007199254740991
951
+ },
952
+ "format": {
953
+ "default": "markdown",
954
+ "type": "string",
955
+ "enum": [
956
+ "markdown",
957
+ "json"
958
+ ]
959
+ },
960
+ "tag": {
961
+ "type": "string",
962
+ "minLength": 1,
963
+ "description": "Tag name (e.g. 'v1.2.3')."
964
+ },
965
+ "message": {
966
+ "description": "If provided, create an annotated tag with this message. If absent, create a lightweight tag.",
967
+ "type": "string"
968
+ },
969
+ "ref": {
970
+ "description": "Commit/ref to tag (default: HEAD). Ignored if `delete` is true.",
971
+ "type": "string"
972
+ },
973
+ "delete": {
974
+ "default": false,
975
+ "description": "If true, delete the named tag instead of creating it.",
976
+ "type": "boolean"
977
+ }
978
+ },
979
+ "required": [
980
+ "format",
981
+ "tag",
982
+ "delete"
983
+ ],
984
+ "additionalProperties": false
985
+ },
715
986
  "git_worktree_add": {
716
987
  "$schema": "https://json-schema.org/draft/2020-12/schema",
717
988
  "type": "object",
@@ -807,6 +1078,48 @@
807
1078
  "force"
808
1079
  ],
809
1080
  "additionalProperties": false
1081
+ },
1082
+ "git_stash_apply": {
1083
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1084
+ "type": "object",
1085
+ "properties": {
1086
+ "workspaceRoot": {
1087
+ "description": "Highest-priority override.",
1088
+ "type": "string"
1089
+ },
1090
+ "rootIndex": {
1091
+ "description": "0-based index into the MCP file roots list; ignored when workspaceRoot is set.",
1092
+ "type": "integer",
1093
+ "minimum": 0,
1094
+ "maximum": 9007199254740991
1095
+ },
1096
+ "format": {
1097
+ "default": "markdown",
1098
+ "type": "string",
1099
+ "enum": [
1100
+ "markdown",
1101
+ "json"
1102
+ ]
1103
+ },
1104
+ "index": {
1105
+ "default": 0,
1106
+ "description": "Stash index (defaults to 0 for stash@{0}).",
1107
+ "type": "integer",
1108
+ "minimum": 0,
1109
+ "maximum": 9007199254740991
1110
+ },
1111
+ "pop": {
1112
+ "default": false,
1113
+ "description": "If true, runs `git stash pop` instead of `git stash apply` (removes stash after applying).",
1114
+ "type": "boolean"
1115
+ }
1116
+ },
1117
+ "required": [
1118
+ "format",
1119
+ "index",
1120
+ "pop"
1121
+ ],
1122
+ "additionalProperties": false
810
1123
  }
811
1124
  }
812
1125
  }