A Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.
This package is designed to be used as an MCP server with clients like Claude Desktop. Here's how to configure it:
Add this to your MCP client configuration:
{
"mcpServers": {
"git": {
"command": "npx",
"args": ["-y", "mcp-git"]
}
}
}
For custom settings:
{
"mcpServers": {
"git": {
"command": "npx",
"args": ["-y", "mcp-git"]
}
}
}
npm install -g mcp-git
# or
bun install -g mcp-git
Then use in your MCP config:
{
"mcpServers": {
"git": {
"command": "mcp-git"
}
}
}
- Clone this repository
- Install dependencies:
bun install
- Build:
bun run build
- Run:
bun run start
The server provides these MCP-accessible Git operations:
-
git_status
- Show working tree status -
git_init
- Initialize new repository -
git_log
- View commit history (withmax_count
parameter)
-
git_diff_unstaged
- View unstaged changes -
git_diff_staged
- View staged changes -
git_diff
- Compare with branch/commit -
git_add
- Stage files -
git_reset
- Unstage changes -
git_commit
- Create commit
-
git_create_branch
- Create new branch -
git_checkout
- Switch branches
-
git_show
- View commit contents
- Bun v1.2.8 or later
- Git installed system-wide
bun run build
bun test
Pull requests are welcome. For major changes, please open an issue first to discuss proposed changes.