reasonix-plugin-git-context
v0.1.0
Published
External MCP plugin for DeepSeek-Reasonix: read-only git blame / log / show / diff and PR-context helper tools over stdio JSON-RPC.
Maintainers
Readme
reasonix-plugin-git-context
An external MCP (Model Context Protocol) plugin for DeepSeek-Reasonix that gives the agent read-only git context tools — blame, log, show, diff, file history, and a one-shot PR-context summary — over stdio JSON-RPC.
By Kashif Mahi (@kashifmahi).
It is a standalone npm package that depends on Reasonix as a host; it is not
part of Reasonix core. Reasonix loads it as a subprocess declared in
reasonix.toml, exactly like any other MCP server (see the SPEC's
§3.3 Plugins).
All tools are declared with
annotations.readOnlyHint: true, so Reasonix treats them as safe readers — eligible for parallel-batch dispatch and its reader permission default. Inside Reasonix they appear namespaced asmcp__gitcontext__<tool>.
Tools
| Tool | What it does |
| --- | --- |
| git_blame | Who last changed each line of a file (optional line range / revision). |
| git_log | Recent commits; optionally scoped to a path, revision range, or author. |
| git_show | A commit's message + diffstat (and patch unless stat_only). |
| git_diff | Working-tree diff, or a diff between two revisions. |
| git_file_history | Commit history for one file, following renames. |
| git_pickaxe | Find commits that introduced/removed a string (-S) or matched a regex (-G). |
| git_pr_context | Branch-as-PR summary: base, merge-base, commits ahead, changed files. |
Install
npm install -g reasonix-plugin-git-context
# or run on demand without installing:
npx reasonix-plugin-git-contextRequires Node ≥ 18 and git on PATH.
Wire it into Reasonix
Add this to your project's reasonix.toml (or the user-global config.toml).
The [[plugins]] schema and ${VAR} expansion are defined in the
Reasonix SPEC §5:
[[plugins]]
name = "gitcontext" # type defaults to "stdio"
command = "npx"
args = ["reasonix-plugin-git-context"]
# env = { GIT_CONTEXT_ROOT = "${GIT_CONTEXT_ROOT:-}" } # optional: pin the repo dirIf you installed it globally you can skip npx:
[[plugins]]
name = "gitcontext"
command = "reasonix-plugin-git-context"
args = []Reasonix connects over stdio, runs the MCP handshake
(initialize → notifications/initialized → tools/list), and the tools become
available in-session as mcp__gitcontext__git_blame, mcp__gitcontext__git_pr_context, etc.
Type /mcp in the Reasonix chat TUI to confirm the server connected and see its tool count.
Configuration
| Env var | Purpose | Default |
| --- | --- | --- |
| GIT_CONTEXT_ROOT | Repository directory the tools operate in. | current working directory |
Every tool also accepts an optional cwd argument that overrides GIT_CONTEXT_ROOT
for a single call.
Example
Once wired in, you can ask Reasonix things like:
- "Blame lines 40–80 of
internal/agent/loop.goand tell me who owns that code." - "Give me the PR context for this branch against
main." - "Show the history of
README.mdand summarize how the install steps changed."
Safety
gitis invoked as an argv array (never through a shell), so there is no shell-injection surface.- Revision/path arguments beginning with
-are rejected to prevent git option-injection. - Output is capped (~60k chars) and each call has a 20s timeout so a large repo cannot overwhelm the session context or hang the agent.
- The server is strictly read-only — it never writes to the repository.
Development
npm install
npm run build # tsc -> dist/
npm test # builds, then runs a real stdio JSON-RPC round-trip (node --test)
npm run typecheckThe test in test/roundtrip.test.mjs spins up a throwaway git repo, launches the
built server, performs the full MCP handshake over stdio, and calls the tools —
the same path Reasonix uses.
Author
Built and maintained by Kashif Mahi — Senior Web & Blockchain developer.
- GitHub: @kashifmahi
- LinkedIn: kashifmahi
- X/Twitter: @kashifmahi271
Contributions and issues welcome at github.com/kashifmahi/reasonix-plugin-git-context.
License
MIT © Kashif Mahi — matches upstream DeepSeek-Reasonix.
