Git MCP server
Last verified: 2026-09
Read a local git repo: log, diff, status.
Official reference Developer tools No API key Claude Desktop, Cursor, Windsurf, Claude Code, VS Code
What it does
Talks to a local git checkout: status, diff, log, branch, commit. No GitHub/GitLab API. Safer when you only need history on disk.
It sits in Developer tools: Split this category in two.
Good for
- Ask for status, log, and diff on a local checkout — no PAT.
- Explain what changed since main without git log in the terminal.
- Read a blame-ish history for a file the model is editing.
- Keep forge write access off when you only needed history.
Tools
- git_status / git_diff / git_diff_unstaged / git_diff_staged — What changed.
- git_log / git_show — History.
- git_add / git_commit / git_reset — Stage and commit (writes).
- git_create_branch / git_checkout — Branches.
Config (Claude Desktop / Cursor / Windsurf)
Paste the JSON below. Same mcpServers shape. Replace placeholder paths and secrets.
Windows paths look like C:\\Users\\you\\project, not /path/to.
Host-side steps →
Claude Desktop
| OS | Config file |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json
(usually C:\Users\<you>\AppData\Roaming\Claude\) |
| Linux | ~/.config/Claude/claude_desktop_config.json |
Cursor
| Scope | macOS / Linux | Windows |
|---|---|---|
| This project | .cursor/mcp.json in the repo root | |
| This user | ~/.cursor/mcp.json |
%USERPROFILE%\.cursor\mcp.json |
Windsurf
| OS | Config file |
|---|---|
| macOS / Linux | ~/.codeium/windsurf/mcp_config.json |
| Windows | %USERPROFILE%\.codeium\windsurf\mcp_config.json |
{
"mcpServers": {
"git": {
"command": "uvx",
"args": [
"mcp-server-git",
"--repository",
"/path/to/repo"
]
}
}
}
Windsurf remote MCP: use serverUrl instead of url if the block below is HTTP.
One-liner: uvx mcp-server-git --repository /path/to/repo
Secrets it wants: none — pass --repository
How to get started
- Point --repository at the checkout.
- Ask for status and a diff before you enable commits.
- Keep GitHub/GitLab MCP off unless you also need the forge API.
Access risk
git_commit and git_reset change the repo. Review the diff; do not auto-commit on a shared branch.
When to skip it
Skip it if you need issues and PRs (GitHub / GitLab). Skip commits if you only want the model to read.
Instead: GitHub, Filesystem.
Vs alternatives
| Server | Official? | Needs a secret? | Best for |
|---|---|---|---|
| Git | Yes | No | Read a local git repo: log, diff, status. |
| GitHub | Yes | Yes | Repos, issues, PRs, and file contents on GitHub. |
| Filesystem | Yes | No | Read and write files inside a folder you choose. |
More in Developer tools
FAQ
Does it talk to GitHub?
No. --repository is a local path. No network, no PAT.
Can it commit or push?
The official server is a read-oriented git surface. Do not assume commit is safe even if a tool appears — review the current list.
Git or Filesystem?
Git for history. Filesystem for file contents and edits. People often want both on the same repo.
Multiple repos?
One --repository per server entry. Add a second named server if you need two checkouts.