
How to add Git (Reference) to Claude Desktop
Official MCP server for reading, searching, and manipulating a local Git repository's files and history. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.
Last updated June 15, 2026 ยท 74kโ ยท stdio ยท no auth ยท official
Claude Desktop config for Git (Reference)
uvx mcp-server-git --repository /absolute/path/to/repo{
"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.
Setup steps
- 1Open Claude Desktop โ Settings โ Developer โ Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
- 2Paste the Git (Reference) config below under the top-level "mcpServers" key.
- 3Fill in any placeholder secrets (API keys, paths) in the snippet.
- 4Save the file, then fully quit and reopen Claude Desktop.
- 5Open a chat and confirm Git (Reference)'s tools appear under the ๐ tools menu.
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
What Git (Reference) can do in Claude Desktop
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.
Security
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) + Claude Desktop FAQ
Where is the Claude Desktop config file?
Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the Git (Reference) config there under the "mcpServers" key and restart the client.
Is Git (Reference) safe to use with Claude Desktop?
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.
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.