
Git (Reference)
OfficialOfficial MCP server for reading, searching, and manipulating a local Git repository's files and history.
Add to your client
Copy the config for your MCP client and paste it into its config file.
uvx mcp-server-git --repository /absolute/path/to/repoPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"git-reference": {
"command": "uvx",
"args": [
"mcp-server-git",
"--repository",
"/absolute/path/to/repo"
]
}
}
}Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.
Before you start
- Python 3.10+ with `uv`/`uvx` (recommended) so you can run `uvx mcp-server-git` directly, OR `pip` to install `mcp-server-git`
- Git installed and a local Git repository to operate on
- Docker is an optional alternative (image `mcp/git`), bind-mounting the repo into the container
- No credentials or auth — it acts on the local repo only
About Git (Reference)
The Git server is an official MCP reference server (Python-based) that lets a model read, search, and manipulate a local Git repository — inspecting status and diffs, staging changes, committing, branching, and reading history. It's the standard way to give an agent structured Git access without shelling out to raw commands.
Unlike the GitHub MCP server (which talks to the GitHub API for issues and PRs), this one operates directly on a local repo on disk via stdio. You point it at a repository path with --repository, or let tools take a repo_path argument. It exposes scoped operations like git_status, git_diff_staged, git_commit, and git_log rather than an open-ended shell, which keeps the agent's actions auditable.
It's distributed on PyPI as mcp-server-git and is most easily run with uvx mcp-server-git (no install step), or via pip install mcp-server-git then python -m mcp_server_git, or a Docker image. The README notes the server is in early development, so the tool surface may evolve.
Tools & capabilities (12)
git_statusShow the working tree status.
git_diff_unstagedShow changes in the working directory that aren't yet staged.
git_diff_stagedShow changes staged for the next commit.
git_diffDiff the current state against a branch or commit.
git_commitRecord staged changes with a commit message.
git_addStage file contents for the next commit.
git_resetUnstage all staged changes.
git_logShow commit history, with optional filtering.
git_create_branchCreate a new branch from an optional base branch.
git_checkoutSwitch to a different branch.
git_showShow the contents and metadata of a specific commit.
git_branchList local, remote, or all branches, with optional filtering.
When to use it
- Use it when you want an agent to inspect repo status and diffs before proposing or making changes.
- Use it when you want the model to stage and commit work with proper, descriptive commit messages.
- Use it when reviewing history — querying `git_log` or reading a specific commit with `git_show`.
- Use it when you need scoped, auditable Git operations instead of giving an agent an open shell.
- Use it when managing branches: creating, switching, or listing branches during an automated workflow.
Quick setup
- 1Ensure Git and Python (with uv) are installed.
- 2Add the server to your MCP client config, e.g. command `uvx` with args `mcp-server-git --repository /path/to/repo`.
- 3Alternatively `pip install mcp-server-git` and run `python -m mcp_server_git`, or use the `mcp/git` Docker image with a bind-mounted repo.
- 4Restart the MCP client so it launches the server.
- 5Verify by asking the model to run `git_status` on the repository.
Security notes
The server can modify repository state (stage, commit, create branches) within the repo you point it at, so scope it to a non-critical working copy. It does not push to remotes by itself but can alter local history.
Git (Reference) FAQ
Is this the same as the GitHub MCP server?
No. This server operates on a local Git repository on disk; the GitHub server talks to the GitHub API for issues, PRs, and remote repos. Many setups use both.
Do I need to install anything to run it?
Not with uv — `uvx mcp-server-git` fetches and runs it on demand. Otherwise `pip install mcp-server-git` and run `python -m mcp_server_git`.
How does it know which repository to use?
Pass `--repository /path/to/repo` at startup, or provide a `repo_path` argument to the tools that accept one.
Can it push to a remote or open pull requests?
No. It focuses on local operations (status, diff, add, commit, branch, log, show); pushing and PRs are out of scope — use the GitHub MCP server for that.
Is there an npm package?
No. This is a Python server published on PyPI as `mcp-server-git`; there is no npm distribution.
Alternatives to Git (Reference)
Official MCP reference server for secure local filesystem read/write within allowed directories.
Official AWS Labs MCP server to manage and query S3 Tables (table buckets, namespaces, tables).
Powerful local filesystem + terminal MCP server: search, diff-edit files, and run shell commands.
Compare Git (Reference) with: