mcp-git
Provides tools for Git repository interaction and automation, including status, commit, branch, diff, and log operations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-git Show me the status of the current repository."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-git - Git MCP Server
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.
MCP Server Usage
This package is designed to be used as an MCP server with clients like Claude Desktop. Here's how to configure it:
Basic Configuration
Add this to your MCP client configuration:
{
"mcpServers": {
"git": {
"command": "npx",
"args": ["-y", "mcp-git"]
}
}
}Advanced Configuration
For custom settings:
{
"mcpServers": {
"git": {
"command": "npx",
"args": ["-y", "mcp-git"]
}
}
}Related MCP server: Git Workflow MCP Server
Installation Options
From Source
Clone this repository
Install dependencies:
bun installBuild:
bun run buildRun:
bun run start
Available Git Tools
The server provides these MCP-accessible Git operations:
Repository Operations
git_status- Show working tree statusgit_init- Initialize new repositorygit_log- View commit history (withmax_countparameter)
Change Management
git_diff_unstaged- View unstaged changesgit_diff_staged- View staged changesgit_diff- Compare with branch/commitgit_add- Stage filesgit_reset- Unstage changesgit_commit- Create commit
Branch Operations
git_create_branch- Create new branchgit_checkout- Switch branches
Content Inspection
git_show- View commit contents
Development
Prerequisites
Bun v1.2.8 or later
Git installed system-wide
Building
bun run buildTesting
bun testContributing
Pull requests are welcome. For major changes, please open an issue first to discuss proposed changes.
License
Available Tools
15 toolsgit_addA
Adds file contents to the staging area
Inputs: repo_path (required), files (required).
git_checkoutC
Switches branches
Inputs: repo_path (required), branch_name (required).
git_commitC
Records changes to the repository
Inputs: repo_path (required), message (required).
git_create_branchC
Creates a new branch
Inputs: repo_path (required), branch_name (required), start_point.
git_diffC
Shows differences between branches or commits
Inputs: repo_path (required), target (required).
git_diff_stagedA
Shows changes that are staged for commit
Inputs: repo_path (required).
git_diff_unstagedA
Shows changes in working directory not yet staged
Inputs: repo_path (required).
git_initB
Initializes a Git repository
Inputs: repo_path (required).
git_logC
Shows the commit logs
Inputs: repo_path (required), max_count.
git_resetC
Unstages all staged changes
Inputs: repo_path (required).
git_showC
Shows the contents of a commit
Inputs: repo_path (required), revision (required).
git_stashB
Stashes changes in working directory
Inputs: repo_path (required).
git_stash_applyA
Applies a single stashed state without removing it
Inputs: repo_path (required).
git_stash_popB
Applies and removes a single stashed state
Inputs: repo_path (required).
git_statusB
Shows the working tree status
Inputs: repo_path (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Every tool has a clearly distinct purpose and targets a different Git operation. There is no ambiguity between tools like git_diff, git_diff_staged, and git_diff_unstaged, or between git_stash, git_stash_apply, and git_stash_pop.
All tools follow the consistent 'git_<verb>' pattern with snake_case. The naming is uniform and predictable, making it easy for an agent to infer tool behavior from its name.
With 15 tools, the server is well-scoped for a Git client. It covers essential operations without being overwhelming or too sparse. Each tool serves a clear purpose in the standard Git workflow.
The tool set covers core local Git operations such as staging, committing, branching, diffing, stashing, and log viewing. However, it lacks tools for remote operations like push, pull, fetch, and merge, which are important for typical Git usage and might require agents to work around.
Maintenance
Related MCP Connectors
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Plain-English git for agents: 22 tools to branch, commit, push and tag. Free tier.
Read and write KukGit repositories, files, issues and pull requests from an AI assistant.
Git-backed platform for skills, tools, and context for AI agents
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to fetch, search, and retrieve markdown content from remote Git repositories. Supports both public and private repositories with authentication, allowing AI assistants to access documentation and notes stored in Git.MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to interact with local Git repositories for operations like status, commits, branching, and diffs, plus GitHub API integration for managing pull requests when authenticated.-
- FlicenseBqualityDmaintenanceEnables analysis and querying of Git repository content (both public and private) through a unified tool that provides repository summaries, file structures, and full content optimized for LLM consumption.1-
- AlicenseBqualityDmaintenanceEnables AI assistants to inspect local Git repositories and interact with the GitHub API for reading commits, diffs, files, issues, comments, pull requests, and project boards.10145 npmISC