MCP Directory

How to add Git (Reference) to Cursor

Official MCP server for reading, searching, and manipulating a local Git repository's files and history. Paste the config into ~/.cursor/mcp.json and restart Cursor.

Last updated June 15, 2026 · 74k · stdio · no auth · official

Cursor config for Git (Reference)

uvx mcp-server-git --repository /absolute/path/to/repo
{
  "mcpServers": {
    "git-reference": {
      "command": "uvx",
      "args": [
        "mcp-server-git",
        "--repository",
        "/absolute/path/to/repo"
      ]
    }
  }
}

Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.

Setup steps

  1. 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
  2. 2Paste the Git (Reference) config below into the "mcpServers" object.
  3. 3Fill in placeholder secrets, then save.
  4. 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
  5. 5Ask Cursor to use one of Git (Reference)'s tools to confirm it's connected.

Before you start

  • Python 3.10+ with `uv`/`uvx` (recommended) so you can run `uvx mcp-server-git` directly, OR `pip` to install `mcp-server-git`
  • Git installed and a local Git repository to operate on
  • Docker is an optional alternative (image `mcp/git`), bind-mounting the repo into the container
  • No credentials or auth — it acts on the local repo only

What Git (Reference) can do in Cursor

git_status

Show the working tree status.

git_diff_unstaged

Show changes in the working directory that aren't yet staged.

git_diff_staged

Show changes staged for the next commit.

git_diff

Diff the current state against a branch or commit.

git_commit

Record staged changes with a commit message.

git_add

Stage file contents for the next commit.

git_reset

Unstage all staged changes.

git_log

Show commit history, with optional filtering.

Security

The server can modify repository state (stage, commit, create branches) within the repo you point it at, so scope it to a non-critical working copy. It does not push to remotes by itself but can alter local history.

Git (Reference) + Cursor FAQ

Where is the Cursor config file?

Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the Git (Reference) config there under the "mcpServers" key and restart the client.

Is Git (Reference) safe to use with Cursor?

The server can modify repository state (stage, commit, create branches) within the repo you point it at, so scope it to a non-critical working copy. It does not push to remotes by itself but can alter local history.

Is this the same as the GitHub MCP server?

No. This server operates on a local Git repository on disk; the GitHub server talks to the GitHub API for issues, PRs, and remote repos. Many setups use both.

Do I need to install anything to run it?

Not with uv — `uvx mcp-server-git` fetches and runs it on demand. Otherwise `pip install mcp-server-git` and run `python -m mcp_server_git`.

How does it know which repository to use?

Pass `--repository /path/to/repo` at startup, or provide a `repo_path` argument to the tools that accept one.

View repo Full Git (Reference) page