{"_id":"@ahmedshaikh/git-workbench-mcp","name":"@ahmedshaikh/git-workbench-mcp","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@ahmedshaikh/git-workbench-mcp","version":"0.1.0","type":"module","description":"Structured git for agents as an MCP server — the dirty tree as stable hunk IDs, non-interactive partial staging (commit exactly the hunks you name, hard-verified), and structured blame/history.","bin":{"git-workbench":"dist/server.js"},"engines":{"node":">=22"},"scripts":{"serve":"tsx src/server.ts","build":"tsc","test":"node --import tsx --test --test-force-exit test/*.test.ts","prepublishOnly":"npm run build"},"dependencies":{"@modelcontextprotocol/sdk":"^1.0.0","zod":"^3.23.8"},"devDependencies":{"@types/node":"^24.0.0","tsx":"^4.7.0","typescript":"^5.4.0"},"license":"MIT","author":{"name":"ahmedshaikh"},"keywords":["mcp","model-context-protocol","claude","agent","ai","git","partial-staging","hunk","blame","commit"],"repository":{"type":"git","url":"git+https://github.com/RaziStuff/git-workbench-mcp.git"},"homepage":"https://github.com/RaziStuff/git-workbench-mcp#readme","bugs":{"url":"https://github.com/RaziStuff/git-workbench-mcp/issues"},"publishConfig":{"access":"public"},"gitHead":"f3aa24e8aa50748d9bba0e406198646afea90494","_id":"@ahmedshaikh/git-workbench-mcp@0.1.0","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-rboU1VOED42GFB0gDpOKqceMF03PjY1CLXN6Ap9Qp6gW+a9M3lvtxm8tlmXn0djtwzaeocn5h9afKjaHSEPIoA==","shasum":"1288b25119728fadb9e4cdcee5fc86a202f84893","tarball":"https://registry.npmjs.org/@ahmedshaikh/git-workbench-mcp/-/git-workbench-mcp-0.1.0.tgz","fileCount":8,"unpackedSize":26900,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGiD5xSV0tIdR6GXjqKlhnMyvWo/BYRdTa9p/9/EXQUcAiAEHK4LiQskwFa13yMFUoKbhlcqC8rIcxmVXzjfNo+XZg=="}]},"_npmUser":{"name":"ahmedshaikh","email":"ahmed@shaikh1.com"},"directories":{},"maintainers":[{"name":"ahmedshaikh","email":"ahmed@shaikh1.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/git-workbench-mcp_0.1.0_1783369659621_0.43382630486581664"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-06T20:27:39.397Z","0.1.0":"2026-07-06T20:27:39.769Z","modified":"2026-07-06T20:27:40.015Z"},"maintainers":[{"name":"ahmedshaikh","email":"ahmed@shaikh1.com"}],"description":"Structured git for agents as an MCP server — the dirty tree as stable hunk IDs, non-interactive partial staging (commit exactly the hunks you name, hard-verified), and structured blame/history.","homepage":"https://github.com/RaziStuff/git-workbench-mcp#readme","keywords":["mcp","model-context-protocol","claude","agent","ai","git","partial-staging","hunk","blame","commit"],"repository":{"type":"git","url":"git+https://github.com/RaziStuff/git-workbench-mcp.git"},"author":{"name":"ahmedshaikh"},"bugs":{"url":"https://github.com/RaziStuff/git-workbench-mcp/issues"},"license":"MIT","readme":"# git-workbench-mcp\n\n**Structured git for agents — the version-control axis of the task lifecycle, both directions.**\n\nEverything before \"tests pass\" has structured tooling; after that, agents fall back to\nshell gymnastics: parsing `git status --porcelain`, eyeballing 400-line diffs to mentally\ngroup changes, and — the real blocker — no way to stage *part* of a file, because\n`git add -p` is interactive and agent harnesses can't drive it. Going backwards in time\nis the same: \"why does this guard exist?\" means re-deriving `blame`/`log -S` incantations\nwith unstructured output.\n\n## Tools\n\n### `change_set` — the dirty tree as stable hunk IDs\n\n```\nchange_set\n→ 2 changed file(s):\n    api.js [modified]\n      h_1be309f253 lines 1-5 (+1/-1): +  return { id: String(id) }; // fix: ids are strings\n      h_8c5ef44ddc lines 10-14 (+1/-1): +  console.log(\"access\", user.id);\n    notes.txt [untracked] — whole-file only (select via paths=[...])\n```\n\nHunk IDs are **content-addressed** (path + hunk body, not line numbers), so they survive\nunrelated edits elsewhere in the file.\n\n### `commit` — non-interactive partial staging, hard-verified\n\n```\ncommit message=\"fix: user ids are strings\" hunk_ids=[\"h_1be309f253\"]\n→ committed 3359f51a: 1 file(s) — api.js\n  working tree still has uncommitted changes (as selected)\n```\n\nOne mixed working tree becomes several clean commits. A wrong partial stage would\nsilently commit a state that never existed in the working tree — so the surgery is\nguarded on both sides:\n\n- hunk IDs are **re-derived from a fresh diff at commit time**: if the tree moved since\n  `change_set`, the commit refuses (never fuzzy-applies) and tells you to re-select\n- after staging, the cached diff's hunk IDs must equal **exactly** the selection — any\n  mismatch resets the index and commits nothing\n- a dirty index is refused unless `reset_index=true` (files are never touched)\n\nAlso does the boring cases: `commit message=...` commits everything;\n`paths=[...]` commits whole files.\n\n### `history` — structured \"why is this code like this?\"\n\n```\nhistory file=app.py line_start=2 line_end=2        # blame mode\n→ lines 2: 8a1f3c2d 2026-03-14 jane: add safety guard to top\n\nhistory query=\"safety guard\"                        # pickaxe mode\n→ 1 commit(s) touching \"safety guard\":\n    8a1f3c2d 2026-03-14 jane: add safety guard to top\n      +    if True:  # safety guard\n\nhistory file=app.py                                 # file log, renames followed\n```\n\n## Install\n\n```jsonc\n// .mcp.json\n{\n  \"mcpServers\": {\n    \"git-workbench\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@ahmedshaikh/git-workbench-mcp\"]\n    }\n  }\n}\n```\n\nRepo root defaults to the server cwd (`GIT_WORKBENCH_ROOT` or per-call `cwd`).\n\n## Limits\n\n- renamed and binary files are whole-file only (no hunk addressing)\n- quoted/unusual paths (spaces work; embedded quotes don't) — v1\n- overlapping hunk selections that git cannot stage independently are refused\n  with a suggestion to commit the whole file\n- no push/PR tooling (deliberate: creating commits is the stall; `gh` is not)\n\n## Development\n\n```\nnpm install\nnpm test\nnpm run build\n```\n\nMIT\n","readmeFilename":"README.md","_rev":"1-362a119be677e0ad848ad9063ed655e0"}