The Git MCP server is Anthropic’s official bridge to a local repository. It lets Claude read commit history, inspect diffs, look at branches and stage changes without you copying terminal output into the chat window. It is one of the reference servers, so it is short, predictable, and a reasonable first install for anyone working in a codebase.
What it actually does
The server points at one repository on disk and exposes its plumbing as tools. Claude can list recent commits, read the diff for a specific change, check which files are modified, look at branches, and stage or commit work. Because it reads the real repository rather than a summary, the answers are grounded in what is actually committed.
Practical patterns:
- ‘What changed in the last five commits, and why?’
- ‘Show me the diff for the commit that introduced this function.’
- ‘Which files have uncommitted changes right now?’
- ‘Write a commit message for what is currently staged.‘
Why use it
Explaining a codebase’s history to an AI is the slow part of asking for help with it. Pasting a log truncates, pasting a diff blows the context window, and neither reflects what is on disk a minute later. Pointing the server at the repo turns all of that into a question. It pairs naturally with the Filesystem server: Git gives Claude the history, Filesystem gives it the current file contents.
Gotchas
It is scoped to the single path you pass in --repository, which is a feature rather than a limit; the agent cannot wander into other projects. Write operations are real, so commits it makes are commits you will have to unpick, and it is worth pointing it at a branch rather than main while you get a feel for it. It also has no idea about anything that lives on the remote, so pull requests, issues and review comments need the GitHub or GitLab server instead.