@rethunk/mcp-multi-root-git 2.3.4 → 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.
- package/AGENTS.md +30 -4
- package/CHANGELOG.md +74 -0
- package/HUMANS.md +54 -5
- package/README.md +15 -1
- package/dist/server/batch-commit-tool.js +266 -19
- package/dist/server/git-cherry-pick-tool.js +32 -8
- package/dist/server/git-diff-summary-tool.js +39 -21
- package/dist/server/git-diff-tool.js +132 -0
- package/dist/server/git-fetch-tool.js +131 -0
- package/dist/server/git-log-tool.js +37 -0
- package/dist/server/git-push-tool.js +8 -1
- package/dist/server/git-refs.js +72 -0
- package/dist/server/git-show-tool.js +148 -0
- package/dist/server/git-stash-tool.js +131 -0
- package/dist/server/git-tag-tool.js +162 -0
- package/dist/server/git.js +35 -4
- package/dist/server/roots.js +8 -4
- package/dist/server/test-harness.js +68 -5
- package/dist/server/tool-parameter-schemas.js +21 -1
- package/dist/server/tools.js +11 -0
- package/docs/install.md +19 -2
- package/docs/mcp-tools.md +443 -10
- package/package.json +18 -6
- package/schemas/batch_commit.json +125 -0
- package/schemas/git_cherry_pick.json +69 -0
- package/schemas/git_diff.json +62 -0
- package/schemas/git_diff_summary.json +75 -0
- package/schemas/git_fetch.json +52 -0
- package/schemas/git_inventory.json +74 -0
- package/schemas/git_log.json +77 -0
- package/schemas/git_merge.json +79 -0
- package/schemas/git_parity.json +74 -0
- package/schemas/git_push.json +50 -0
- package/schemas/git_reset_soft.json +42 -0
- package/schemas/git_show.json +39 -0
- package/schemas/git_stash_apply.json +44 -0
- package/schemas/git_stash_list.json +30 -0
- package/schemas/git_status.json +49 -0
- package/schemas/git_tag.json +50 -0
- package/schemas/git_worktree_add.json +52 -0
- package/schemas/git_worktree_list.json +30 -0
- package/schemas/git_worktree_remove.json +48 -0
- package/schemas/index.json +108 -0
- package/schemas/list_presets.json +44 -0
- package/tool-parameters.schema.json +327 -6
package/AGENTS.md
CHANGED
|
@@ -9,6 +9,7 @@ IDEs injecting this as context: do not re-link from rules.
|
|
|
9
9
|
- Tools, JSON shape, resources, root resolution → [docs/mcp-tools.md](docs/mcp-tools.md)
|
|
10
10
|
- Dev setup, CI, commit conventions → [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
11
11
|
- Presets, auth, publish → [HUMANS.md](HUMANS.md)
|
|
12
|
+
- Spec layout for repo planning → [specs/README.md](specs/README.md)
|
|
12
13
|
|
|
13
14
|
## Implementation map
|
|
14
15
|
|
|
@@ -21,7 +22,7 @@ IDEs injecting this as context: do not re-link from rules.
|
|
|
21
22
|
| [`src/server/presets.ts`](src/server/presets.ts) | `PRESET_FILE_PATH`, `loadPresetsFromGitTop`, `presetLoadErrorPayload`, `applyPresetNestedRoots`, `applyPresetParityPairs`; Zod schemas must match [`git-mcp-presets.schema.json`](git-mcp-presets.schema.json) |
|
|
22
23
|
| [`src/server/schemas.ts`](src/server/schemas.ts) | `WorkspacePickSchema`, `MAX_INVENTORY_ROOTS_DEFAULT`, **`MAX_ABSOLUTE_GIT_ROOTS`** (256), optional **`absoluteGitRoots`** on workspace pick |
|
|
23
24
|
| [`src/server/inventory.ts`](src/server/inventory.ts) | `InventoryEntryJson`, `validateRepoPath`, `makeSkipEntry`, `buildInventorySectionMarkdown`, `collectInventoryEntry` |
|
|
24
|
-
| [`src/server/git-refs.ts`](src/server/git-refs.ts) | `isProtectedBranch`, `isSafeGitRefToken`, `isSafeGitRangeToken`, `isSafeGitAncestorRef`; `getCurrentBranch`, `resolveRef`, `isWorkingTreeClean`, `isFullyMergedInto`, `commitListBetween`; `listWorktrees`, `worktreeForBranch`; `conflictPaths` |
|
|
25
|
+
| [`src/server/git-refs.ts`](src/server/git-refs.ts) | `isProtectedBranch`, `isSafeGitRefToken`, `isSafeGitRangeToken`, `isSafeGitAncestorRef`; `getCurrentBranch`, `resolveRef`, `isWorkingTreeClean`, `isFullyMergedInto`, `isContentEquivalentlyMergedInto`, `commitListBetween`; `listWorktrees`, `worktreeForBranch`; `inferRemoteFromUpstream`; `conflictPaths` |
|
|
25
26
|
| [`src/server/tools.ts`](src/server/tools.ts) | `registerRethunkGitTools` — dispatches to `register*` below |
|
|
26
27
|
| [`src/server/git-status-tool.ts`](src/server/git-status-tool.ts) | `git_status` |
|
|
27
28
|
| [`src/server/git-inventory-tool.ts`](src/server/git-inventory-tool.ts) | `git_inventory` |
|
|
@@ -29,6 +30,11 @@ IDEs injecting this as context: do not re-link from rules.
|
|
|
29
30
|
| [`src/server/list-presets-tool.ts`](src/server/list-presets-tool.ts) | `list_presets` |
|
|
30
31
|
| [`src/server/git-log-tool.ts`](src/server/git-log-tool.ts) | `git_log` — v3 JSON shape: `sha` (full), `workspaceRoot`, no `sha7`/`ageRelative`, optional `email` |
|
|
31
32
|
| [`src/server/git-diff-summary-tool.ts`](src/server/git-diff-summary-tool.ts) | `git_diff_summary` — structured token-efficient diff viewer; read-only |
|
|
33
|
+
| [`src/server/git-diff-tool.ts`](src/server/git-diff-tool.ts) | `git_diff` — raw scoped diff text; read-only |
|
|
34
|
+
| [`src/server/git-show-tool.ts`](src/server/git-show-tool.ts) | `git_show` — inspect commit message + diff or file content at a ref; read-only |
|
|
35
|
+
| [`src/server/git-stash-tool.ts`](src/server/git-stash-tool.ts) | `git_stash_list`, `git_stash_apply` |
|
|
36
|
+
| [`src/server/git-fetch-tool.ts`](src/server/git-fetch-tool.ts) | `git_fetch` — fetch remote refs without touching the working tree |
|
|
37
|
+
| [`src/server/git-tag-tool.ts`](src/server/git-tag-tool.ts) | `git_tag` — create/delete annotated or lightweight tags |
|
|
32
38
|
| [`src/server/git-worktree-tool.ts`](src/server/git-worktree-tool.ts) | `git_worktree_list`, `git_worktree_add`, `git_worktree_remove` |
|
|
33
39
|
| [`src/server/batch-commit-tool.ts`](src/server/batch-commit-tool.ts) | `batch_commit` — sequential multi-commit; mutating; exports `PushReport`, `runPushAfter` |
|
|
34
40
|
| [`src/server/git-push-tool.ts`](src/server/git-push-tool.ts) | `git_push` — standalone push with optional upstream tracking |
|
|
@@ -36,7 +42,7 @@ IDEs injecting this as context: do not re-link from rules.
|
|
|
36
42
|
| [`src/server/git-cherry-pick-tool.ts`](src/server/git-cherry-pick-tool.ts) | `git_cherry_pick` — mutating |
|
|
37
43
|
| [`src/server/git-reset-soft-tool.ts`](src/server/git-reset-soft-tool.ts) | `git_reset_soft` — soft-reset; mutating |
|
|
38
44
|
| [`src/server/presets-resource.ts`](src/server/presets-resource.ts) | `rethunk-git://presets` resource |
|
|
39
|
-
| [`src/server/tool-parameter-schemas.ts`](src/server/tool-parameter-schemas.ts) | `buildToolParameterSchemaDocument`, `captureToolParameterSchemas`; backs `tool-parameters.schema.json` |
|
|
45
|
+
| [`src/server/tool-parameter-schemas.ts`](src/server/tool-parameter-schemas.ts) | `buildToolParameterSchemaDocument`, `captureToolParameterSchemas`; backs `tool-parameters.schema.json` and published `schemas/*.json` snapshots |
|
|
40
46
|
| [`src/repo-paths.ts`](src/repo-paths.ts) | `resolvePathForRepo`, `assertRelativePathUnderTop`, `isStrictlyUnderGitTop` |
|
|
41
47
|
|
|
42
48
|
## Changing contracts
|
|
@@ -44,7 +50,7 @@ IDEs injecting this as context: do not re-link from rules.
|
|
|
44
50
|
- **No banner paragraphs** in shipped docs. Use normal titles + cross-links.
|
|
45
51
|
- **JSON format version** (currently `"3"`, discoverable via MCP `initialize`): bump on incompatible JSON changes (renamed/nested/omitted fields). Document migration here + [docs/mcp-tools.md](docs/mcp-tools.md). v2 removed the `rethunkGitMcp` envelope; payloads are minified; optional fields omitted when empty/null/false. v3 changes in `git_log`: `sha7` → `sha` (full SHA), `workspace_root` → `workspaceRoot`, `ageRelative` removed, `email` omitted when empty.
|
|
46
52
|
- **Preset file:** keep `presets.ts` Zod schemas aligned with [`git-mcp-presets.schema.json`](git-mcp-presets.schema.json).
|
|
47
|
-
- **Public tool surface:** rename/add → update [docs/mcp-tools.md](docs/mcp-tools.md) + [README.md](README.md) (if mentioned). Install/client wiring → [docs/install.md](docs/install.md) only.
|
|
53
|
+
- **Public tool surface:** rename/add → update [docs/mcp-tools.md](docs/mcp-tools.md) + [README.md](README.md) (if mentioned), then regenerate the shipped schema artifacts (`tool-parameters.schema.json`, `schemas/index.json`, `schemas/*.json`). Install/client wiring → [docs/install.md](docs/install.md) only.
|
|
48
54
|
|
|
49
55
|
## Validate + CI
|
|
50
56
|
|
|
@@ -54,10 +60,30 @@ Optional [`.githooks/`](.githooks): `bun run setup-hooks` once per clone. pre-co
|
|
|
54
60
|
|
|
55
61
|
Path confinement: [`src/repo-paths.ts`](src/repo-paths.ts) — extend tests when changing.
|
|
56
62
|
|
|
63
|
+
## AI constraints
|
|
64
|
+
|
|
65
|
+
Rules for LLMs operating in or against this repository.
|
|
66
|
+
|
|
67
|
+
**End-user Git/MCP preference** (status/log/diff/commits): **`~/.claude/CLAUDE.md`** § **Git & GitHub** — same policy when dogfooding this server from a harness.
|
|
68
|
+
|
|
69
|
+
**Mutating tools require workspace-root confirmation** — `git_fetch`, `batch_commit`, `git_push`, `git_merge`, `git_cherry_pick`, `git_reset_soft`, `git_tag`, and `git_stash_apply` operate only on roots confirmed by `requireGitAndRoots` / `requireSingleRepo`. Never pass caller-supplied absolute paths to mutating tools; use `workspaceRoot` or MCP roots.
|
|
70
|
+
|
|
71
|
+
**`batch_commit` atomic staging — single call per logical change** — Do NOT attempt incremental staging across multiple `batch_commit` calls. Each call is self-contained: it stages all files in all entries, commits them sequentially, and the moment the call completes, all commits have landed. Include all related files (for all related commit entries) in a single `batch_commit` call. A call cannot be resumed or extended by a later call — each is an independent transaction. If entry N fails, entries before N remain committed; entries after N are skipped (not rolled back).
|
|
72
|
+
|
|
73
|
+
**`absoluteGitRoots` is read-only** — pass it only on read tools (`git_status`, `git_inventory`, `git_parity`, `git_log`, `git_diff_summary`, `list_presets`). Mutating tools reject this parameter.
|
|
74
|
+
|
|
75
|
+
**Protected branches are enforced by the server** — do not attempt `git_worktree_add` with a branch name matching `main`, `master`, `dev`, `develop`, `stable`, `trunk`, `prod`, `production`, `release*`, or `hotfix*`. The server rejects such calls.
|
|
76
|
+
|
|
77
|
+
**Never force-push** — `git_push` has no force-push mode by design. `git_merge` with `strategy: "ff-only"` will fail cleanly rather than force.
|
|
78
|
+
|
|
79
|
+
**Contract bumps need documentation** — if a JSON output shape changes incompatibly, bump `MCP_JSON_FORMAT_VERSION` in `src/server.ts` and document the migration in both this file and [docs/mcp-tools.md](docs/mcp-tools.md).
|
|
80
|
+
|
|
81
|
+
**Path confinement** — any tool accepting file paths must use `resolvePathForRepo` / `assertRelativePathUnderTop` from [`src/repo-paths.ts`](src/repo-paths.ts) and include escaping-attempt tests.
|
|
82
|
+
|
|
57
83
|
## Repo MCP entry (contributors)
|
|
58
84
|
|
|
59
85
|
Dogfood from clone: [docs/install.md](docs/install.md) — *From source*.
|
|
60
86
|
|
|
61
|
-
|
|
87
|
+
Client Git policy is still **`~/.claude/CLAUDE.md`** § Git & GitHub (see **End-user Git/MCP preference** above).
|
|
62
88
|
|
|
63
89
|
User-level skills may mention README for discovery. Canonical refs: tools/JSON → [docs/mcp-tools.md](docs/mcp-tools.md); install → [docs/install.md](docs/install.md); presets → [HUMANS.md](HUMANS.md).
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,76 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@rethunk/mcp-multi-root-git` are documented here. Format loosely follows [Keep a Changelog](https://keepachangelog.com); the project uses [Semantic Versioning](https://semver.org).
|
|
4
4
|
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [2.5.0] — 2026-05-15
|
|
8
|
+
|
|
9
|
+
Bug-fix and documentation release; includes one new `git_log` output format.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **`git_log` `format: "oneline"`** — minimal `<sha7> <subject>` output per commit for low-token post-commit verification. Multi-root output uses `### repo (branch)` separators; single-root output emits one line per commit with no headers.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- **`git_stash_list`**: format string used for-each-ref placeholders (`%(subject)`, `%(objectname:short)`) instead of git-log format (`%s`, `%h`), printing literal placeholder text as the stash message.
|
|
18
|
+
- **`git_stash_list`**: stash message containing `|` caused the SHA field to be parsed as a mid-message fragment; SHA is now always the last pipe-separated field.
|
|
19
|
+
- **`batch_commit`**: deleted tracked files (missing on disk) could not be staged; now staged via `git rm --cached`. Combining `{ path, lines }` with a deleted file is validated as an error.
|
|
20
|
+
- **`batch_commit` hunk-level staging**: `newCount=0` pure-deletion hunks were excluded from line ranges that included the deletion point (`hunkEnd` was `newStart-1`); now `hunkEnd = newStart` for zero-count hunks.
|
|
21
|
+
- **`git_diff_summary`**: diff header regex mis-parsed file paths containing ` b/` (e.g. `src/b/file.ts`), reporting wrong path and zero stats; now uses midpoint-symmetry split for non-renames, falls back to regex for renames.
|
|
22
|
+
- **`git_diff_summary`**: `git diff --stat` bar-graph character counting is scaled to terminal width and under-reports for large files; replaced with `git diff --numstat` for exact addition/deletion counts.
|
|
23
|
+
- **`git_cherry_pick`**: branch deletion after cherry-pick now uses patch-id equivalence by default so source branches with differing SHAs but identical content are correctly detected as merged. Pass `strictMergedRefEquality: true` for strict SHA-reachability semantics.
|
|
24
|
+
- **`parseGitSubmodulePaths`**: non-regular files at `.gitmodules` (character devices, sockets — common in Claude Code / sandbox environments) are now rejected via `lstatSync().isFile()` before `readFileSync`, preventing `EACCES` errors.
|
|
25
|
+
|
|
26
|
+
### Tests
|
|
27
|
+
|
|
28
|
+
- Integration tests added for `git_stash_list`, `git_stash_apply`, `git_fetch`, `git_status`, `git_inventory`, and `git_parity` execute paths.
|
|
29
|
+
- `isContentEquivalentlyMergedInto` integration tests via real git repos with cherry-picked and diverged histories.
|
|
30
|
+
- `batch_commit` dryRun tests covering deleted-file unstaging.
|
|
31
|
+
|
|
32
|
+
### Documentation
|
|
33
|
+
|
|
34
|
+
- **`git_status`, `git_inventory`, `git_parity`, `list_presets`** now have complete parameter tables, JSON shape examples, and error code tables in `docs/mcp-tools.md`.
|
|
35
|
+
- **`git_cherry_pick`** `strictMergedRefEquality` parameter added to docs; `deleteMergedBranches` description corrected (default is patch-id equivalence, not SHA-reachability).
|
|
36
|
+
- **`batch_commit`** `files` parameter and `stage_failed` error code updated to document deleted-file staging path.
|
|
37
|
+
|
|
38
|
+
## [2.4.0] — 2026-05-07
|
|
39
|
+
|
|
40
|
+
New git MCP tools, better `batch_commit` ergonomics, published schema coverage for the full tool surface, and a broad docs/test refresh since `v2.3.4`.
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
|
|
44
|
+
- **New tools:** `git_fetch`, `git_diff`, `git_show`, `git_tag`, `git_stash_list`, and `git_stash_apply`.
|
|
45
|
+
- **`batch_commit` enhancements:** `dryRun: true` preview mode plus hunk-level staging via `{ path, lines: { from, to } }`.
|
|
46
|
+
- **Published per-tool schema artifacts:** `schemas/index.json` plus one JSON Schema file per tool alongside `tool-parameters.schema.json`.
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
|
|
50
|
+
- **`GIT_SUBPROCESS_PARALLELISM`** is now configurable via environment and clamps to a safe `2×CPU` maximum.
|
|
51
|
+
- **`git_show`**, **`git_fetch`**, and **`git_tag`** now use the standard single-repo workspace pick (`workspaceRoot` / `rootIndex`) and omit multi-root-only parameters.
|
|
52
|
+
- **Build / release tooling** now aligns on Bun `1.3.13`, updated dev dependencies, and the current prerelease tarball flow.
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
|
|
56
|
+
- **MCP roots** — workspace root collection now scans active MCP sessions and dedupes `file://` roots instead of relying on a fixed server `cwd`.
|
|
57
|
+
- **`git_push`** and **`batch_commit`** now surface raw git stdout/stderr on failure for easier recovery.
|
|
58
|
+
- **Published schema snapshots** are now complete and in sync with the registered tool surface, including `schema:tools:check`.
|
|
59
|
+
- **`publish:preflight`** now writes temporary coverage output under the platform temp directory instead of a hard-coded `/tmp` path.
|
|
60
|
+
|
|
61
|
+
### Documentation
|
|
62
|
+
|
|
63
|
+
- **README / HUMANS / AGENTS / CONTRIBUTING / install docs** refreshed for the current tool surface, shipped schema artifacts, and contributor workflow.
|
|
64
|
+
- **`SECURITY.md`** added with repository access, git-operation risk, and disclosure guidance.
|
|
65
|
+
- **`docs/mcp-tools.md`** now documents the full tool surface, `batch_commit` atomic staging semantics, and the shipped schema artifacts.
|
|
66
|
+
- **`TODO.md`** backlog entries now reflect genuine remaining gaps instead of listing already-implemented tools as missing.
|
|
67
|
+
- **`specs/` scaffold** added with standard `active`, `done`, and `parked` layout for repo planning.
|
|
68
|
+
- **CHANGELOG references** for `v2.3.2`–`v2.3.4` were restored.
|
|
69
|
+
|
|
70
|
+
### Tests
|
|
71
|
+
|
|
72
|
+
- Coverage expanded across `list_presets`, `git_parity`, `git_cherry_pick`, `git_merge`, `git_show`, schema generation, and roots handling.
|
|
73
|
+
- The shared git test harness now reuses repo-init / commit helpers and speeds up fixture setup.
|
|
74
|
+
|
|
5
75
|
## [2.3.4] — 2026-04-26
|
|
6
76
|
|
|
7
77
|
Publication-prep patch for the `absoluteGitRoots` line.
|
|
@@ -138,6 +208,10 @@ Mutating git operations: merge, cherry-pick, and optional push-after for `batch_
|
|
|
138
208
|
|
|
139
209
|
- Initial release: `git_status`, `git_inventory`, `git_parity`, `list_presets`.
|
|
140
210
|
|
|
211
|
+
[2.4.0]: https://github.com/Rethunk-AI/mcp-multi-root-git/releases/tag/v2.4.0
|
|
212
|
+
[2.3.4]: https://github.com/Rethunk-AI/mcp-multi-root-git/releases/tag/v2.3.4
|
|
213
|
+
[2.3.3]: https://github.com/Rethunk-AI/mcp-multi-root-git/releases/tag/v2.3.3
|
|
214
|
+
[2.3.2]: https://github.com/Rethunk-AI/mcp-multi-root-git/releases/tag/v2.3.2
|
|
141
215
|
[2.3.1]: https://github.com/Rethunk-AI/mcp-multi-root-git/releases/tag/v2.3.1
|
|
142
216
|
[2.3.0]: https://github.com/Rethunk-AI/mcp-multi-root-git/releases/tag/v2.3.0
|
|
143
217
|
[2.2.0]: https://github.com/Rethunk-AI/mcp-multi-root-git/releases/tag/v2.2.0
|
package/HUMANS.md
CHANGED
|
@@ -55,19 +55,21 @@ If you installed from **GitHub Packages**, use **`./node_modules/@rethunk-ai/mcp
|
|
|
55
55
|
|
|
56
56
|
## Tool parameter schema artifact
|
|
57
57
|
|
|
58
|
-
The package ships **`tool-parameters.schema.json`**, a generated JSON Schema snapshot of every registered tool's parameter schema. Maintainers regenerate
|
|
58
|
+
The package ships **`tool-parameters.schema.json`**, a generated JSON Schema snapshot of every registered tool's parameter schema, plus the published **`schemas/`** directory with **`schemas/index.json`** and one per-tool JSON Schema file. Maintainers regenerate them with:
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
61
|
bun run schema:tools
|
|
62
|
+
bun run schema:individual
|
|
62
63
|
```
|
|
63
64
|
|
|
64
65
|
CI and `prepublishOnly` use:
|
|
65
66
|
|
|
66
67
|
```bash
|
|
67
68
|
bun run schema:tools:check
|
|
69
|
+
bun run schema:individual
|
|
68
70
|
```
|
|
69
71
|
|
|
70
|
-
|
|
72
|
+
These artifacts are for inspection, drift checks, code generation, and clients that want offline schema snapshots. Runtime MCP schema discovery remains the source of truth for connected clients.
|
|
71
73
|
|
|
72
74
|
**Layouts:**
|
|
73
75
|
|
|
@@ -121,13 +123,60 @@ Example `git_parity` batch using the same pair in each sibling clone:
|
|
|
121
123
|
|
|
122
124
|
`absoluteGitRoots` is read-only by design. Mutating tools such as **`batch_commit`**, **`git_push`**, **`git_merge`**, and **`git_cherry_pick`** omit it from their schema; use `workspaceRoot` or MCP roots for writes. Full parameter rules and error codes live in **[docs/mcp-tools.md](docs/mcp-tools.md#absoluteGitRoots-sibling-clones)**.
|
|
123
125
|
|
|
126
|
+
## Prerequisites
|
|
127
|
+
|
|
128
|
+
- **Git** on `PATH` (`git --version`). Missing git → all tools return `git_not_found`.
|
|
129
|
+
- **Node.js ≥ 22** (for `npx`) or **Bun** (for `bunx`). See `engines` in `package.json`.
|
|
130
|
+
- No other runtime dependencies; the server is a self-contained MCP stdio process.
|
|
131
|
+
|
|
132
|
+
## Running the server
|
|
133
|
+
|
|
134
|
+
The server is a **stdio** MCP process — your MCP client starts it. You do not run it directly. Quick start:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# npmjs (public, may lag tags)
|
|
138
|
+
npx -y @rethunk/mcp-multi-root-git
|
|
139
|
+
|
|
140
|
+
# GitHub Packages (CI-aligned, every tag)
|
|
141
|
+
npx -y @rethunk-ai/mcp-multi-root-git # requires ~/.npmrc with @rethunk-ai registry token
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Add the server to your MCP client config under a stable name (e.g. `rethunk-git`). Full per-client config (Cursor, VS Code, Claude Desktop, Zed): **[docs/install.md](docs/install.md)**.
|
|
145
|
+
|
|
146
|
+
## Common operations
|
|
147
|
+
|
|
148
|
+
Call tools by their registered id (prefix depends on client config name):
|
|
149
|
+
|
|
150
|
+
| Operation | Tool |
|
|
151
|
+
|-----------|------|
|
|
152
|
+
| Check status across workspace roots | `git_status` |
|
|
153
|
+
| Status + ahead/behind for submodules | `git_inventory` |
|
|
154
|
+
| Compare HEAD between path pairs | `git_parity` |
|
|
155
|
+
| List preset names | `list_presets` |
|
|
156
|
+
| View commit log | `git_log` |
|
|
157
|
+
| View structured diff | `git_diff_summary` |
|
|
158
|
+
| View raw diff text | `git_diff` |
|
|
159
|
+
| Inspect commit content | `git_show` |
|
|
160
|
+
| List stashes | `git_stash_list` |
|
|
161
|
+
| Apply or pop a stash | `git_stash_apply` |
|
|
162
|
+
| Fetch remote refs | `git_fetch` |
|
|
163
|
+
| Create commits | `batch_commit` |
|
|
164
|
+
| Push a branch | `git_push` |
|
|
165
|
+
| Create or delete tags | `git_tag` |
|
|
166
|
+
| Merge branches | `git_merge` |
|
|
167
|
+
| Cherry-pick commits | `git_cherry_pick` |
|
|
168
|
+
| Soft-reset HEAD | `git_reset_soft` |
|
|
169
|
+
| Manage worktrees | `git_worktree_list` / `git_worktree_add` / `git_worktree_remove` |
|
|
170
|
+
|
|
171
|
+
Full parameter tables and JSON shapes: **[docs/mcp-tools.md](docs/mcp-tools.md)**.
|
|
172
|
+
|
|
124
173
|
## `git_not_found`
|
|
125
174
|
|
|
126
|
-
If **`git`** is missing or not runnable, tools and the presets resource respond with **`git_not_found`**.
|
|
175
|
+
If **`git`** is missing or not runnable, tools and the presets resource respond with **`git_not_found`**. Ensure `git` is on `PATH` in the environment that launches the MCP server.
|
|
127
176
|
|
|
128
177
|
## Installation
|
|
129
178
|
|
|
130
|
-
**
|
|
179
|
+
**Full install instructions and MCP client wiring:** **[docs/install.md](docs/install.md)**.
|
|
131
180
|
|
|
132
181
|
## Development
|
|
133
182
|
|
|
@@ -150,7 +199,7 @@ Before tagging, run the clean-tree preflight from the release commit:
|
|
|
150
199
|
bun run publish:preflight
|
|
151
200
|
```
|
|
152
201
|
|
|
153
|
-
It verifies the `package.json` version has a matching `CHANGELOG.md` section,
|
|
202
|
+
It verifies the `package.json` version has a matching `CHANGELOG.md` section, both schema artifacts are current, build/check/coverage pass, and `npm pack --dry-run` includes the expected package files.
|
|
154
203
|
|
|
155
204
|
### npmjs (manual) — maintainers only
|
|
156
205
|
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@rethunk/mcp-multi-root-git)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
|
|
7
|
-
**git** tools over MCP:
|
|
7
|
+
**git** tools over MCP: status, multi-root inventory, `HEAD` parity, presets, logs, structured and raw diff views, commit inspection, fetch, stash, tag, batch commit, push, merge, cherry-pick, worktrees, and soft-reset. **Install and MCP client wiring:** **[docs/install.md](docs/install.md)** only — do not duplicate those steps elsewhere.
|
|
8
8
|
|
|
9
9
|
**Repository:** [github.com/Rethunk-AI/mcp-multi-root-git](https://github.com/Rethunk-AI/mcp-multi-root-git) · **npmjs (manual releases):** [`@rethunk/mcp-multi-root-git`](https://www.npmjs.com/package/@rethunk/mcp-multi-root-git) · **GitHub Packages (CI on each tag):** [`@rethunk-ai/mcp-multi-root-git`](https://github.com/Rethunk-AI/mcp-multi-root-git/packages) — see [docs/install.md](docs/install.md) and [HUMANS.md](HUMANS.md) Publishing.
|
|
10
10
|
|
|
@@ -14,7 +14,21 @@
|
|
|
14
14
|
|-----|----------|
|
|
15
15
|
| **[docs/install.md](docs/install.md)** | Single source for prerequisites, running the package, and every supported MCP client (plus from-source and troubleshooting) |
|
|
16
16
|
| **[docs/mcp-tools.md](docs/mcp-tools.md)** | Tool ids, client naming, `format` / JSON, resource URI, workspace root resolution (canonical reference) |
|
|
17
|
+
| **[schemas/index.json](schemas/index.json)** | Published JSON schemas for all MCP tool parameters (JSON Schema draft 2020-12 format) |
|
|
17
18
|
| **[HUMANS.md](HUMANS.md)** | Preset file, dev commands, CI, publishing |
|
|
18
19
|
| **[AGENTS.md](AGENTS.md)** | Contributors: implementation map ([`src/server/`](src/server/) + entry [`src/server.ts`](src/server.ts)), contract bumps, CI |
|
|
20
|
+
| **[CONTRIBUTING.md](CONTRIBUTING.md)** | Dev setup, hooks, commit conventions, release checks, and how to add tools |
|
|
21
|
+
| **[SECURITY.md](SECURITY.md)** | Disclosure policy, threat model, and repository safety guidance |
|
|
22
|
+
| **[specs/README.md](specs/README.md)** | Active / done / parked specification layout used for repo planning |
|
|
19
23
|
|
|
20
24
|
**Tools at a glance:** see the table in **[docs/mcp-tools.md](docs/mcp-tools.md)**.
|
|
25
|
+
|
|
26
|
+
## JSON Schemas
|
|
27
|
+
|
|
28
|
+
All MCP tool parameters are published as JSON Schema (draft 2020-12) documents in the **[`schemas/`](schemas/)** directory. Tools and validators can use these schemas to validate tool input arguments without reading source code.
|
|
29
|
+
|
|
30
|
+
**Schema files:**
|
|
31
|
+
- `schemas/index.json` — Index of all 20 tool schemas with file paths
|
|
32
|
+
- `schemas/{tool_name}.json` — Individual schema for each tool (e.g., `schemas/batch_commit.json`, `schemas/git_status.json`)
|
|
33
|
+
|
|
34
|
+
For programmatic use, read `schemas/index.json` to discover available tools and their schema files.
|