Esta página se muestra en inglés. Una traducción al español está en curso.
MCP ConfigsApr 8, 2026·2 min de lectura

Git MCP — Version Control Server for AI Agents

MCP server that gives AI agents full Git capabilities. Git MCP enables Claude Code and Cursor to manage repositories, branches, commits, diffs, and history via tool calls.

What is Git MCP?

Git MCP is a Model Context Protocol server that gives AI agents structured access to Git repositories. Instead of running raw shell commands, agents use typed tools for git operations — log, diff, status, branch, commit, and more. It provides clean, parseable output that agents can reason about effectively.

Answer-Ready: Git MCP is an MCP server for AI agent Git access. Provides typed tools for log, diff, status, branch, commit, and blame operations. Clean structured output for agent reasoning. Part of the official MCP server collection. Works with Claude Code and Cursor.

Best for: AI agents needing structured Git repository access. Works with: Claude Code, Claude Desktop, Cursor, any MCP client. Setup time: Under 1 minute.

Core Tools

1. git_status

Get working tree status — staged, modified, untracked files.

2. git_log

View commit history with filtering by author, date, path.

Agent: git_log(max_count=10, since="2026-04-01")
→ Returns structured commit objects with hash, author, date, message

3. git_diff

Show changes between commits, branches, or working tree.

Agent: git_diff(ref1="main", ref2="feature/auth")
→ Returns structured diff with file paths, additions, deletions

4. git_show

View contents of a specific commit.

5. git_branch

List, create, delete, and switch branches.

6. git_commit

Create commits with message and optional file selection.

7. git_blame

Annotate file lines with commit information.

Configuration Options

{
  "mcpServers": {
    "git": {
      "command": "uvx",
      "args": [
        "mcp-server-git",
        "--repository", "/path/to/repo",
        "--read-only"
      ]
    }
  }
}
Flag Purpose
--repository Path to git repo
--read-only Disable write operations

Use Cases

Use Case Tools Used
Code Review git_log + git_diff + git_show
Branch Management git_branch + git_status
History Analysis git_log + git_blame
Automated Commits git_status + git_commit

FAQ

Q: Is it read-only by default? A: No, it supports both read and write operations. Use --read-only flag to restrict to read-only if needed.

Q: Can it handle multiple repos? A: Configure multiple Git MCP instances with different repository paths.

Q: How does it differ from Claude Code's built-in git? A: Claude Code has built-in git access via Bash. Git MCP provides structured tool output that is easier for agents to parse and reason about.

🙏

Fuente y agradecimientos

Part of the official Model Context Protocol Servers collection.

modelcontextprotocol/servers/git — Official MCP server

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.