Git MCP Server
Provides comprehensive Git functionality, allowing users to perform repository operations such as checking status, managing branches, viewing diffs and logs, staging and committing changes, and interacting with remote repositories.
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., "@Git MCP Server summarize my current changes and commit them with a clear message"
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.
Git MCP Server
A Model Context Protocol (MCP) server for Git operations that provides comprehensive Git functionality to MCP clients like Claude Desktop.
Features
Context-aware: Automatically detects the current project based on working directory
Comprehensive Git operations: status, branches, diffs, logs, file contents, commits, and more
Multi-project support: Works seamlessly across different project directories
Error handling: Proper MCP error responses
Branch management: Create, switch, and manage branches
Remote operations: Push, pull, and fetch from remote repositories
Related MCP server: mcp-git
Installation
Option 1: Global Installation (Recommended)
npm install -g git-mcp-serverOption 2: Local Development Setup
Clone and install:
git clone https://github.com/yourusername/git-mcp-server.git cd git-mcp-server npm installBuild the project:
npm run build
Configuration
Claude Desktop
Add this server to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"git": {
"command": "git-mcp-server",
"args": []
}
}
}Other MCP Clients
For other MCP clients, use the server binary directly:
git-mcp-serverThe server will automatically use the current working directory as the Git repository context.
Usage
Once configured, you can use Git operations through your MCP client. The server automatically detects the Git repository in your current working directory.
Example Commands
Ask your MCP client (like Claude) to perform Git operations:
"What's the current git status?"
"Show me the diff with the main branch"
"Create a new branch called feature/new-feature"
"Commit these changes with message 'Fix bug in parser'"
"Push the current branch to origin"
Testing the Server
You can test the server manually from any Git repository:
cd /path/to/your/git/repo
git-mcp-serverAvailable Tools
Repository Information
git_status- Get current git statusgit_current_branch- Get current branch namegit_staged_changes- Get staged changesgit_working_directory- Get current working directory info
File and History Operations
git_diff- Show diff between branches/commitsgit_log- Get commit historygit_show_file- Show file contents at specific commit
Branch Operations
git_branches- List all branchesgit_checkout- Switch to different branch or create new branch
Staging and Commit Operations
git_add- Add files to staging areagit_commit- Create commits with message and files
Remote Operations
git_pull- Pull changes from remote repositorygit_fetch- Fetch changes from remote without merging
Repository Management
git_init- Initialize a new git repository
Prerequisites
Node.js 18+
npm or yarn
Git installed on your system
Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
License
MIT License - see LICENSE file for details.
Project Structure
git-mcp-server/
├── package.json # Project dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── src/
│ └── index.ts # Main server implementation
├── build/
│ └── index.js # Compiled JavaScript (generated)
└── README.md # This fileDevelopment
npm run build- Build the TypeScript codenpm run dev- Watch mode for developmentnpm start- Run the built server
Available Tools
16 toolsgit_addC
Add files to the staging area
Inputs: files, all.
git_branchesC
List all branches
Inputs: remote.
git_checkoutC
Switch to a different branch or create a new branch
Inputs: branch (required), create.
git_commitC
Create a new commit with the specified message and files
Inputs: message (required), files.
git_create_branchB
Create a new branch and switch to it (git checkout -b)
Inputs: branchName (required), startPoint.
git_current_branchA
Get the current branch name
Inputs: no named parameters.
git_diffC
Show diff between branches or commits
Inputs: target, staged.
git_fetchA
Fetch changes from remote repository without merging
Inputs: remote.
git_initC
Initialize a new git repository
Inputs: bare, initialBranch.
git_logC
Get commit history
Inputs: limit, oneline.
git_pullC
Pull changes from remote repository
Inputs: remote, branch.
git_pushC
Push changes to remote repository
Inputs: remote, branch, setUpstream.
git_show_fileC
Show contents of a file at a specific commit
Inputs: file (required), commit.
git_staged_changesB
Get the currently staged changes
Inputs: no named parameters.
git_statusB
Get the current git status of the repository
Inputs: no named parameters.
git_working_directoryB
Get the current working directory of the git server
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Most tools have distinct purposes with clear boundaries, such as git_add for staging, git_commit for committing, and git_pull for fetching and merging. However, git_checkout and git_create_branch have overlapping functionality (both can create branches), which could cause slight confusion for an agent.
All tool names follow a consistent git_verb_noun pattern, using snake_case throughout. This predictability makes it easy for agents to understand and select tools based on their names, with no deviations or mixed conventions.
With 16 tools, the server is slightly heavy but reasonable for covering core Git operations like init, add, commit, push, pull, and branch management. It includes essential utilities but might benefit from consolidation, such as merging git_checkout and git_create_branch.
The tool set provides comprehensive coverage of Git workflows, including repository setup (git_init), staging (git_add), committing (git_commit), branching (git_branches, git_create_branch), remote operations (git_fetch, git_pull, git_push), and inspection (git_status, git_log, git_diff). No obvious gaps exist for typical agent tasks.
Maintenance
Related MCP Connectors
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
Plain-English git for agents: 22 tools to branch, commit, push and tag. Free tier.
A MCP server built for developers enabling Git based project management with project and personal…
Git-backed platform for skills, tools, and context for AI agents
Related MCP Servers
AlicenseNot gradedqualityDmaintenanceProvides 15 MCP tools for AI-powered Git intelligence, enabling commit messages, branch creation, PR descriptions, code review, diff analysis, and push operations directly from your AI assistant.MIT- AlicenseNot gradedqualityDmaintenanceA complete Git CLI wrapper for the Model Context Protocol (MCP), enabling AI assistants to perform all git operations through MCP tools.MIT
- AlicenseNot gradedqualityFmaintenanceProvides comprehensive git tooling via MCP, including status, diffs, commits, branches, stashes, and multi-root inventory, enabling AI agents to manage repositories.38 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to search commits, retrieve diffs, and inspect file change history in a Git repository using MCP.67 npmMIT