# Git (MCP Server)

> Read, search and manipulate local Git repositories

- Type: MCP server
- Publisher: Model Context Protocol (official)
- Categories: Development
- Website: https://github.com/modelcontextprotocol/servers/tree/main/src/git
- Source: https://github.com/modelcontextprotocol/servers
- Transport: stdio
- Launch command: uvx mcp-server-git --repository path/to/git/repo
- Sign-in: none
- GitHub stars: 90924
- Listed: 2024-11-25

## About

Reference Python MCP server exposing Git operations such as status, diff, commit, log, branch and checkout on local repositories. Runs via uvx and can be scoped to a specific repository path.

## Install

1. **Add the server to Codex**

   Codex CLI:

   ```bash
   codex mcp add git -- uvx mcp-server-git --repository path/to/git/repo
   ```

   config.toml:

   ```toml
   [mcp_servers.git]
   command = "uvx"
   args = ["mcp-server-git", "--repository", "path/to/git/repo"]
   ```

   Agents SDK:

   ```python
   from agents import Agent, Runner
   from agents.mcp import MCPServerStdio
   
   async with MCPServerStdio(
       name="Git",
       params={"command": "uvx", "args": ["mcp-server-git", "--repository", "path/to/git/repo"]},
   ) as server:
       agent = Agent(name="Assistant", mcp_servers=[server])
       result = await Runner.run(agent, "Show me the unstaged changes in this repo")
       print(result.final_output)
   ```

## Tools

- `git_status`
- `git_diff_unstaged`
- `git_diff_staged`
- `git_diff`
- `git_commit`
- `git_add`
- `git_reset`
- `git_log`
- `git_create_branch`
- `git_checkout`
- `git_show`
- `git_branch`

## Example prompts

- "Show me the unstaged changes in this repo"
- "Summarize the last 10 commits"
- "Create a branch called feature/login and switch to it"
- "Commit the staged changes with a descriptive message"

## Related

- [Chrome DevTools MCP](https://chatgptplugins.directory/mcp/chrome-devtools.md): Let coding agents control and debug a live Chrome browser
- [Playwright MCP](https://chatgptplugins.directory/mcp/playwright.md): Browser automation for agents via Playwright accessibility snapshots
- [GitHub](https://chatgptplugins.directory/mcp/github.md): Manage repos, issues, pull requests and Actions from your AI agent
- [Context7](https://chatgptplugins.directory/mcp/context7.md): Pull up-to-date, version-specific library docs into your coding agent
- [Supabase](https://chatgptplugins.directory/mcp/supabase.md): Manage Supabase databases, migrations, edge functions and logs
- [Stripe](https://chatgptplugins.directory/mcp/stripe.md): Query and act on your Stripe account and search Stripe docs from any agent

---
Source: https://chatgptplugins.directory/mcp/git · Index: https://chatgptplugins.directory/llms.txt · Independent and community-run. Not affiliated with or endorsed by OpenAI. ChatGPT is a trademark of OpenAI.
