Git

v0.2.0
io.github.Abhishekkumar2021/git Checked 10 hours ago Published 5 months ago

Local Git via MCP: status, log, diff, file history, branches, and gated stage/commit.

Values you need

VariableWhat it is
GIT_ROOTSrequired Allowed repo root directories (comma-separated). Required — the server refuses to start without it.
GIT_WRITABLEoptional 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-git
Add 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

  1. Ask the user for: GIT_ROOTS. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. 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).
  3. Restart or reload the client so it starts the server.
  4. 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, ….
  5. 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