Cette page est affichée en anglais. Une traduction française est en cours.
MCP ConfigsApr 8, 2026·2 min de lecture

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.

MCP Hub
MCP Hub · Community
Prêt pour agents

Staging sûr pour cet actif

Cet actif est d'abord staged. Le prompt copié demande à l'agent d'inspecter les fichiers staged avant d'activer scripts, config MCP ou config globale.

Stage only · 17/100Policy : staging
Surface agent
Tout agent MCP/CLI
Type
Mcp Config
Installation
Stage only
Confiance
Confiance : Established
Point d'entrée
Git MCP — Version Control Server for AI Agents
Commande de staging sûr
npx -y tokrepo@latest install 85eacf96-3b2b-43f5-ad6f-fd4413ad0b69 --target codex

Stage les fichiers d'abord; l'activation exige la revue du README et du plan staged.

TL;DR
Git MCP enables AI agents to perform Git operations like commits, diffs, and branch management via tool calls.
§01

What it is

Git MCP is a Model Context Protocol server that gives AI agents full Git capabilities. It enables Claude Code, Cursor, and other MCP-compatible tools to manage repositories, branches, commits, diffs, and history through structured tool calls rather than raw shell commands.

Developers who use AI coding agents for automated development workflows benefit from Git MCP. It provides a safe, structured interface for version control operations that agents can invoke without parsing command-line output.

§02

How it saves time or tokens

Without Git MCP, agents must execute raw git commands via shell and parse text output. Git MCP provides structured JSON responses, eliminating parsing errors and reducing the token overhead of interpreting unstructured terminal output. The workflow estimates approximately 3,600 tokens per session.

§03

How to use

  1. Install the Git MCP server in your MCP configuration.
  2. Point it at a local repository path.
  3. Your AI agent can now call Git tools like git_status, git_commit, git_diff, and git_log.
{
  "mcpServers": {
    "git": {
      "command": "uvx",
      "args": ["mcp-server-git", "--repository", "/path/to/repo"]
    }
  }
}
§04

Example

Once configured, an AI agent can check the repository status and create a commit:

Tool call: git_status
Result: { 'modified': ['src/main.py'], 'untracked': ['tests/test_new.py'] }

Tool call: git_add, files: ['src/main.py', 'tests/test_new.py']
Tool call: git_commit, message: 'Add new test file for main module'
§05

Related on TokRepo

§06

Common pitfalls

  • Git MCP operates on local repositories. Remote operations like push and fetch may require SSH key or credential configuration.
  • Agents may create excessive commits without guidance. Set clear commit policies in your agent instructions.
  • Ensure the MCP server has appropriate file system permissions for the target repository.

Questions fréquentes

What AI tools support Git MCP?+

Any MCP-compatible AI tool can use Git MCP. This includes Claude Code, Cursor, Cline, and other editors or agents that implement the Model Context Protocol for tool use.

Does Git MCP support GitHub operations?+

Git MCP focuses on local Git operations (commits, branches, diffs, log). For GitHub-specific features like pull requests, issues, and code review, use the separate GitHub MCP server.

Can Git MCP handle merge conflicts?+

Git MCP exposes the conflict state through status and diff tools. The AI agent can read conflicted files and resolve them, but the resolution logic depends on the agent's capabilities rather than Git MCP itself.

Is Git MCP safe for production repositories?+

Git MCP performs real Git operations. It is as safe as giving any tool write access to your repository. Use it on development branches and ensure your agent instructions include safeguards against force pushes or destructive operations.

How do I install Git MCP?+

Install via uvx (Python) or npx (Node.js) depending on the implementation. Add the server configuration to your MCP settings file with the repository path as an argument.

Sources citées (3)
🙏

Source et remerciements

Part of the official Model Context Protocol Servers collection.

modelcontextprotocol/servers/git — Official MCP server

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires