Skip to content

git

Git operations scoped to a single repository. Internally shells out to the git binary (which must be on PATH), so behavior matches whatever git is installed.

Usage

bash
native-mcp git [--read-only] REPO_PATH

REPO_PATH must be (or be inside) a git working tree. The server validates this on startup with git rev-parse --show-toplevel.

Flags

FlagDefaultDescription
--read-onlyoffHide the add and commit tools. The other tools never modify state.

Tools

status

git status --short --branch. No arguments.

log

FieldTypeRequiredDescription
limitintegernoMax commits to return (default 20, capped at 1000).
authorstringno--author=PATTERN filter.
sincestringno--since=DATE filter (e.g. '2 weeks ago').

diff

FieldTypeRequiredDescription
stagedboolnoIf true, show the index vs HEAD; otherwise unstaged changes.
filestringnoRestrict to one path.

show

FieldTypeRequiredDescription
refstringnoCommit-ish (default HEAD).

Runs git show --stat REF.

branch

FieldTypeRequiredDescription
allboolnoIf true, include remote-tracking branches (-a).

add (disabled in --read-only)

FieldTypeRequiredDescription
pathsarray<string>yesPaths to stage, relative to the repo root.

commit (disabled in --read-only)

FieldTypeRequiredDescription
messagestringyesCommit message.
allboolnoIf true, also stage tracked changes (-a).

Register in Claude Code

bash
# Read-only browsing of one repo
claude mcp add native-git-ro native-mcp git --read-only /home/you/project

# Full access for an autonomous agent in a sandbox repo
claude mcp add native-git-sandbox native-mcp git /tmp/agent-workspace

Released under the MIT License.