You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/rules/rethunk-git-mcp.mdc
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Dogfood and all client wiring: **[docs/install.md](../../docs/install.md)** (*Fr
11
11
12
12
## When to use it
13
13
14
-
Prefer **`rethunk-git_git_*`** and **`rethunk-git_list_presets`** over shell **`git status`** / ad-hoc loops for multi-root or preset-driven git state. Use resource **`rethunk-git://presets`** when the client supports MCP resources.
14
+
Prefer **`rethunk-git_git_*`** and **`rethunk-git_list_presets`** over shell **`git status`** / ad-hoc loops for multi-root or preset-driven git state. For sibling clones under a non-git directory, use **`absoluteGitRoots`** (see **[docs/mcp-tools.md](../../docs/mcp-tools.md)** — *Workspace root resolution*). Use resource **`rethunk-git://presets`** when the client supports MCP resources.
|[`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)|
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,16 @@
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
+
## [2.3.3] — 2026-04-21
6
+
7
+
### Added
8
+
9
+
-**`absoluteGitRoots`** on the workspace pick schema: pass absolute paths to many independent git clones in one MCP call for **`git_status`**, **`git_inventory`**, **`git_log`**, **`git_parity`**, **`git_diff_summary`** (single distinct toplevel only), and **`list_presets`**. Mutating tools omit this parameter from their Zod surface. See **`docs/mcp-tools.md`** (*Workspace root resolution*).
10
+
11
+
### Changed
12
+
13
+
-**`requireGitAndRoots`** / **`requireSingleRepo`**: new prelude **`resolveAbsoluteGitRootsList`** with dedupe, fail-fast on invalid paths, and mutual exclusion with `workspaceRoot` / `rootIndex` / `allWorkspaceRoots` / `preset` (and `nestedRoots`+`preset` guarded in **`git_inventory`**).
|`git_status`|`rethunk-git_git_status`|`git status --short -b` per MCP root and optional submodules (`includeSubmodules`); parallel submodule status. Args include `allWorkspaceRoots`, `rootIndex`, `workspaceRoot`, `format`. **Read-only.**|
15
-
|`git_inventory`|`rethunk-git_git_inventory`| Status + ahead/behind per path; default upstream each repo’s `@{u}`; pass **both**`remote` and `branch` for fixed tracking. `nestedRoots`, `preset`, `presetMerge`, `maxRoots`, `format`, plus workspace pick args. **Read-only.**|
14
+
|`git_status`|`rethunk-git_git_status`|`git status --short -b` per MCP root and optional submodules (`includeSubmodules`); parallel submodule status. Args include `absoluteGitRoots`, `allWorkspaceRoots`, `rootIndex`, `workspaceRoot`, `format`. **Read-only.**|
15
+
|`git_inventory`|`rethunk-git_git_inventory`| Status + ahead/behind per path; default upstream each repo’s `@{u}`; pass **both**`remote` and `branch` for fixed tracking. `nestedRoots`, `preset`, `presetMerge`, `maxRoots`, `format`, plus workspace pick args (`absoluteGitRoots` cannot combine with `preset`/`nestedRoots`). **Read-only.**|
16
16
|`git_parity`|`rethunk-git_git_parity`| Compare `git rev-parse HEAD` for path pairs. `pairs`, `preset`, `presetMerge`, `format`, plus workspace pick args. **Read-only.**|
17
-
|`list_presets`|`rethunk-git_list_presets`| List preset names/counts from `.rethunk/git-mcp-presets.json`; invalid JSON/schema surface as errors. Workspace pick + `format` only. **Read-only.**|
18
-
|`git_log`|`rethunk-git_git_log`| Path-filtered, time-windowed `git log` across one or more workspace roots. Returns commit history with author, date, subject, and shortstat. Args: `since`, `paths`, `grep`, `author`, `maxCommits`, `branch`, plus workspace pick args + `format`. **Read-only.**|
19
-
|`git_diff_summary`|`rethunk-git_git_diff_summary`| Structured, token-efficient diff viewer. Returns per-file diffs with additions/deletions counts, truncated to configurable line limits, with lock files/dist/vendor excluded by default. Args: `range`, `fileFilter`, `maxLinesPerFile`, `maxFiles`, `excludePatterns`, plus workspace pick args + `format`. **Read-only.**|
17
+
|`list_presets`|`rethunk-git_list_presets`| List preset names/counts from `.rethunk/git-mcp-presets.json`; invalid JSON/schema surface as errors. Workspace pick + `format` only (includes `absoluteGitRoots`). **Read-only.**|
18
+
|`git_log`|`rethunk-git_git_log`| Path-filtered, time-windowed `git log` across one or more workspace roots. Returns commit history with author, date, subject, and shortstat. Args: `since`, `paths`, `grep`, `author`, `maxCommits`, `branch`, plus workspace pick args (`absoluteGitRoots` for sibling clones) + `format`. **Read-only.**|
19
+
|`git_diff_summary`|`rethunk-git_git_diff_summary`| Structured, token-efficient diff viewer. Returns per-file diffs with additions/deletions counts, truncated to configurable line limits, with lock files/dist/vendor excluded by default. Args: `range`, `fileFilter`, `maxLinesPerFile`, `maxFiles`, `excludePatterns`, plus workspace pick args (optional single-entry `absoluteGitRoots`) + `format`. **Read-only.**|
20
20
|`git_worktree_list`|`rethunk-git_git_worktree_list`| List all worktrees (`git worktree list --porcelain`). Workspace pick + `format`. **Read-only.**|
21
21
|`git_push`|`rethunk-git_git_push`| Push the current branch to its upstream. Optional `remote`, `branch`, `setUpstream` (passes `-u`). Refuses on detached HEAD; never force-pushes. Workspace pick + `format`. **Mutating.**|
22
22
|`git_worktree_add`|`rethunk-git_git_worktree_add`| Create a new linked worktree, creating the branch from `baseRef` if it does not yet exist. Refuses on protected branch names. Args: `path`, `branch`, `baseRef?`, plus workspace pick + `format`. **Mutating.**|
@@ -106,6 +106,12 @@ v2 field-omission rules still apply: `filesChanged`, `insertions`, `deletions` o
106
106
|`invalid_paths`| One of the `paths` entries contains shell metacharacters and was rejected. |
|`root_index_out_of_range`|`rootIndex` exceeds the number of MCP file roots. |
109
+
|`absolute_git_roots_exclusive`|`absoluteGitRoots` was combined with `workspaceRoot`, `rootIndex`, or `allWorkspaceRoots: true`. |
110
+
|`absolute_git_roots_preset_conflict`|`absoluteGitRoots` was combined with a `preset` argument (root resolution). |
111
+
|`invalid_absolute_git_root`| An `absoluteGitRoots` entry is empty, not inside a git worktree, or not a directory git recognizes. |
112
+
|`absolute_git_roots_too_many`| More than 256 entries in `absoluteGitRoots`. |
113
+
|`absolute_git_roots_empty`|`absoluteGitRoots` produced zero git toplevels after resolution. |
114
+
|`absolute_git_roots_single_repo_only`| A single-repo tool received `absoluteGitRoots` resolving to more than one distinct git toplevel. |
109
115
110
116
### `git_diff_summary` — parameters
111
117
@@ -456,6 +462,32 @@ Repo state is cleaned (`git cherry-pick --abort`) before returning — no partia
456
462
457
463
## Workspace root resolution
458
464
465
+
### `absoluteGitRoots` (sibling clones)
466
+
467
+
When **`absoluteGitRoots`** is a **non-empty** string array, it **replaces** the normal workspace pick for that tool call:
468
+
469
+
- Each entry is passed through `path.resolve`, then resolved to a **git toplevel** via the same logic as `workspaceRoot`. Duplicate toplevels are dropped (stable order, first wins).
470
+
-**Maximum****256** paths (same cap as `git_inventory``maxRoots` upper bound).
471
+
-**Mutually exclusive** with **`workspaceRoot`**, **`rootIndex`**, and **`allWorkspaceRoots: true`**. Combining them returns `{ "error": "absolute_git_roots_exclusive" }`.
472
+
-**Mutually exclusive** with a **`preset`** argument on root resolution (`absolute_git_roots_preset_conflict`).
473
+
-**`git_inventory` only:** also mutually exclusive with **`nestedRoots`** or **`preset`** on the same call (`absolute_git_roots_nested_or_preset_conflict`).
474
+
-**Mutating** tools (`batch_commit`, `git_push`, `git_merge`, …) **omit** this parameter from their schema; callers must use `workspaceRoot` / MCP roots for writes.
475
+
-**Read tools** that use **`requireSingleRepo`** (`git_diff_summary`, …) accept at most **one** distinct toplevel from `absoluteGitRoots`; more than one returns `absolute_git_roots_single_repo_only`.
476
+
477
+
Example — two sibling repos in one `git_status` call:
0 commit comments