Git
v0.2.0Local Git via MCP: status, log, diff, file history, branches, and gated stage/commit.
Values you need
| Variable | What it is | |
|---|---|---|
GIT_ROOTS | required | Allowed repo root directories (comma-separated). Required — the server refuses to start without it. |
GIT_WRITABLE | optional | Set to 1 or true to enable local write tools (stage/commit/branch/checkout). |
npm (npx) discovery passed
Requires Node.js 18+
Run in a terminal
claude mcp add git -e 'GIT_ROOTS=<GIT_ROOTS>' -- npx -y --package=@abhishekmcp/git@0.2.0 mcp-gitAdd to
claude_desktop_config.json{
"mcpServers": {
"git": {
"args": [
"-y",
"--package=@abhishekmcp/git@0.2.0",
"mcp-git"
],
"command": "npx",
"env": {
"GIT_ROOTS": "<GIT_ROOTS>"
}
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"git": {
"args": [
"-y",
"--package=@abhishekmcp/git@0.2.0",
"mcp-git"
],
"command": "npx",
"env": {
"GIT_ROOTS": "<GIT_ROOTS>"
}
}
}
}Add to
.vscode/mcp.json{
"inputs": [
{
"description": "GIT_ROOTS",
"id": "git-roots",
"password": true,
"type": "promptString"
}
],
"servers": {
"git": {
"args": [
"-y",
"--package=@abhishekmcp/git@0.2.0",
"mcp-git"
],
"command": "npx",
"env": {
"GIT_ROOTS": "${input:git-roots}"
},
"type": "stdio"
}
}
}Add to
~/.codex/config.toml[mcp_servers.git]
command = "npx"
args = ["-y", "--package=@abhishekmcp/git@0.2.0", "mcp-git"]
env = { "GIT_ROOTS" = "<GIT_ROOTS>" }For AI agents
- Ask the user for: GIT_ROOTS. Never invent or guess these values; secrets go into the client config, not into chat logs.
- Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
- Restart or reload the client so it starts the server.
- Verify: the server should expose these tools: git_status, git_log, git_show, git_diff, git_file_history, read_file_at, list_branches, list_tags, ….
- If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.
Machine-readable: install.md · manifest.json