Correct the Git MCP install path

mcp-server-git uvx setup guide

Do not copy stale @modelcontextprotocol/server-git npx snippets. The official Git MCP reference server is a Python package. Use uvx mcp-server-git, set one repository path, and review write-capable Git tools before trusting the workflow.

Last reviewed on June 9, 2026 against the official MCP servers repository, the Git server README, PyPI metadata, and npm registry behavior.

npm check

Do not use

@modelcontextprotocol/server-git returned E404

PyPI check

Active package

mcp-server-git 2026.6.4, Python >=3.10

Official runner

Recommended path

uvx mcp-server-git with an explicit repository

What Is mcp-server-git?

mcp-server-git is the official Model Context Protocol Git reference server. It lets an MCP client inspect repository status, read diffs, view logs, compare revisions, create branches, stage files, and create commits through Git-specific tools.

The important correction is packaging. Git is not published as the checked npm package @modelcontextprotocol/server-git. The official path is the Python package mcp-server-git, usually launched with uvx. That makes this page a setup correction guide, not a generic Git tutorial.

How to Calculate the Correct Git MCP Setup

Calculate the setup from four decisions: runner, client, repository scope, and write posture. Use uvx for the recommended package runner, use your MCP client's JSON shape, point --repository at one exact repository, and keep write-capable tools behind human review until the workflow is proven.

Runner

Use uvx first, pip fallback second, Docker when your team wants bind-mount boundaries.

Client

Claude Desktop and VS Code use different outer config keys but the same Git server command.

Repository

One repo path is the permission boundary. Avoid parent workspaces and home folders.

Write posture

Treat add, commit, reset, branch, and checkout as reviewed actions, not smoke tests.

Claude Desktop with uvx

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

Use this for the normal official Git MCP route. Replace the repository path with one repo you are willing to expose.

VS Code MCP config

{
  "servers": {
    "git": {
      "command": "uvx",
      "args": ["mcp-server-git", "--repository", "${workspaceFolder}"]
    }
  }
}

Use workspace scope only when sharing the MCP config is intentional. User-level config is safer for private experiments.

Docker alternative

{
  "mcpServers": {
    "git": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "--mount",
        "type=bind,src=/Users/you/projects/my-repo,dst=/workspace",
        "mcp/git"
      ]
    }
  }
}

Use Docker when your team wants a stronger container boundary and explicit bind mounts around repository access.

Pip fallback

pip install mcp-server-git && python -m mcp_server_git --repository /path/to/git/repo

Use this when uvx is unavailable but Python and pip are managed on the machine.

MCP inspector debug command

npx @modelcontextprotocol/inspector uvx mcp-server-git --repository /path/to/git/repo

Use this when the client loads no tools and you need to debug the server outside the normal app.

Read-Only vs Write-Capable Git Tools

Git MCP is more sensitive than a simple package lookup page because several tools can change repository state. Start with status, diff, log, branch list, and show operations. Add stage, commit, reset, branch creation, and checkout only after the review path is explicit.

Risk groupToolsUseControl
Read-firstgit_status, git_diff_unstaged, git_diff_staged, git_diff, git_log, git_show, git_branchReview repository state, inspect diffs, compare commits, and understand history.Safe first smoke test, but still keep repository scope narrow.
Stage and commitgit_add, git_commit, git_resetChange the index, create commits, or unstage work.Require human diff review before staging or committing.
Branch movementgit_create_branch, git_checkoutCreate or switch branches.Confirm current branch and uncommitted work before branch actions.

Worked Examples

Read-only repository review

Point Git MCP at a single low-risk repository and ask for git_status plus unstaged diff summary. The goal is to confirm tool visibility and repository scope before any write operation is possible.

Code review helper

Use Git MCP to compare a feature branch against main, summarize changed files, and list test gaps. Keep commit creation outside the assistant path until the review workflow is trusted.

Disposable write pilot

Create a throwaway repository, let the server stage and commit a small test file, then inspect the resulting log. Only promote write-capable usage after the team sees the exact behavior.

Common Errors and Fixes

npm returns E404 for @modelcontextprotocol/server-git.

Likely cause: Git is not published as that scoped npm package in the checked registry state.

Fix: Use uvx mcp-server-git or pip install mcp-server-git instead.

uvx is not found.

Likely cause: The uv toolchain is not installed or is not on the desktop client PATH.

Fix: Install uv, restart the client, or use the pip fallback with python -m mcp_server_git.

The client starts but no repository tools are visible.

Likely cause: The config file was not saved in the right place, or the MCP client was not fully restarted.

Fix: Save the config, quit the client completely, reopen it, and inspect the MCP tools list.

The server sees the wrong repository.

Likely cause: The --repository argument points to a parent folder, old checkout, or unresolved placeholder.

Fix: Replace the path with an absolute path to the exact repository and run git_status first.

A write action affected the wrong branch.

Likely cause: Branch state was not checked before git_add, git_commit, or git_checkout.

Fix: Make git_status and git_branch mandatory before write-capable prompts.

Frequently Asked Questions

Is @modelcontextprotocol/server-git available on npm?

In the checked registry state, npm returned E404 for @modelcontextprotocol/server-git. The official Git MCP reference server is the Python package mcp-server-git, normally launched with uvx.

What is the correct command for the Git MCP server?

Use uvx mcp-server-git --repository /path/to/git/repo for the recommended direct launch. You can also use pip install mcp-server-git and python -m mcp_server_git when uvx is not available.

Why does Git MCP use uvx instead of npx?

The official MCP reference servers include both TypeScript and Python implementations. TypeScript servers such as Memory can use npx, while the Git server is Python-based and uses uvx or pip.

How do I configure Git MCP in Claude Desktop?

Add an mcpServers entry named git with command set to uvx and args set to mcp-server-git, --repository, and the exact repository path you want the server to inspect.

Is Git MCP safe to use on a real repository?

It can be useful, but start with read-only review tasks and a disposable or low-risk repository. Git MCP exposes tools that can stage, commit, branch, and checkout, so teams should require review before write actions.

Should I use Git MCP or Filesystem MCP?

Use Git MCP when the job is repository status, diffs, logs, branches, and commits. Use Filesystem MCP when the job is controlled file access inside allowed directories without Git-specific operations.

Can Git MCP make commits?

Yes, the official tool list includes write-capable operations such as git_add and git_commit. That is why the first setup should separate read-only review from write-capable workflows.

Next step

Treat repository access as a permission decision.

If a team will expose real repositories to an assistant, review the server source, allowed path, write-capable tools, and rollback path before adding it to shared profiles.

Review with audit