How to set up the Git MCP server in Claude
- Install uv and Git. Replace the sample path in the command and configuration with the full path to a repository you own.
- In Claude Code run the matching command. For Claude Desktop, merge the relevant JSON entry into your existing MCP configuration and restart the app.
- Confirm the server appears in /mcp in Claude Code or the tools menu in Claude Desktop, then try the small task below.
claude mcp add --transport stdio git -- uvx mcp-server-git --repository "/absolute/path/to/your-test-repo"{
"mcpServers": {
"git": {
"command": "uvx",
"args": [
"mcp-server-git",
"--repository",
"/absolute/path/to/your-test-repo"
]
}
}
}Explain the latest change in a test repository
Ask for the current branch and latest commit summary for one test repository. Compare the branch and commit hash with `git status --short --branch` and `git log -1 --oneline` in your own shell.
Check your configuration and results
The reference server includes tools capable of working-tree changes. Start with status and history queries. Review the selected repository path and scope before asking for staging, commits, or checkout actions.