Git MCP Server
The Git MCP Server provides a standardized interface for Git operations, integrating with the MCP ecosystem to support AI assistants.
Core Git Operations: Initialize, clone, check status, stage files, commit changes, push to remote, and pull from remote.
Branch Management: List, create, delete, and switch branches.
Tag Operations: List, create, and delete tags.
Remote Management: List, add, and remove remotes.
Stash Operations: List, save, and apply stashes.
Bulk Actions: Execute multiple Git operations sequentially for efficiency.
GitHub Integration: Support for GitHub operations via Personal Access Token.
Smart Path Resolution: Handle paths intelligently with optional default configurations.
Error Handling: Comprehensive error management with custom error types.
Repository Caching: Efficient management of repository states.
Performance Monitoring: Built-in tracking of performance metrics.
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 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.
Git MCP Server
A Model Context Protocol (MCP) server that provides enhanced Git operations through a standardized interface. This server integrates with the MCP ecosystem to provide Git functionality to AI assistants.
Features
Core Git Operations: init, clone, status, add, commit, push, pull
Branch Management: list, create, delete, checkout
Tag Operations: list, create, delete
Remote Management: list, add, remove
Stash Operations: list, save, pop
Bulk Actions: Execute multiple Git operations in sequence
GitHub Integration: Built-in GitHub support via Personal Access Token
Path Resolution: Smart path handling with optional default path configuration
Error Handling: Comprehensive error handling with custom error types
Repository Caching: Efficient repository state management
Performance Monitoring: Built-in performance tracking
Related MCP server: GitPilot MCP
Installation
Clone the repository:
git clone https://github.com/yourusername/git-mcp-v2.git
cd git-mcp-v2Install dependencies:
npm installBuild the project:
npm run buildConfiguration
Add to your MCP settings file:
{
"mcpServers": {
"git-v2": {
"command": "node",
"args": ["path/to/git-mcp-v2/build/index.js"],
"env": {
"GIT_DEFAULT_PATH": "/path/to/default/git/directory",
"GITHUB_PERSONAL_ACCESS_TOKEN": "your-github-pat"
}
}
}
}Environment Variables
GIT_DEFAULT_PATH: (Optional) Default path for Git operationsGITHUB_PERSONAL_ACCESS_TOKEN: (Optional) GitHub Personal Access Token for GitHub operations
Available Tools
Basic Operations
init: Initialize a new Git repositoryclone: Clone a repositorystatus: Get repository statusadd: Stage filescommit: Create a commitpush: Push commits to remotepull: Pull changes from remote
Branch Operations
branch_list: List all branchesbranch_create: Create a new branchbranch_delete: Delete a branchcheckout: Switch branches or restore working tree files
Tag Operations
tag_list: List tagstag_create: Create a tagtag_delete: Delete a tag
Remote Operations
remote_list: List remotesremote_add: Add a remoteremote_remove: Remove a remote
Stash Operations
stash_list: List stashesstash_save: Save changes to stashstash_pop: Apply and remove a stash
Bulk Operations
bulk_action: Execute multiple Git operations in sequence
Development
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Run linter
npm run lint
# Format code
npm run formatLicense
MIT
Contributing
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
Available Tools
21 toolsaddC
Stage files
Inputs: files (required), path.
branch_createC
Create a new branch
Inputs: name (required), force, path, setUpstream, +1 more.
branch_deleteC
Delete a branch
Inputs: name (required), path.
branch_listC
List all branches
Inputs: path.
bulk_actionA
Execute multiple Git operations in sequence. This is the preferred way to execute multiple operations.
Inputs: actions (required), path.
checkoutC
Switch branches or restore working tree files
Inputs: target (required), path.
cloneC
Clone a repository
Inputs: url (required), path.
commitC
Create a commit
Inputs: message (required), path.
initB
Initialize a new Git repository
Inputs: path.
pullC
Pull changes from remote
Inputs: branch (required), path, remote.
pushC
Push commits to remote
Inputs: branch (required), force, noVerify, path, +2 more.
remote_addC
Add a remote
Inputs: name (required), url (required), path.
remote_listC
List remotes
Inputs: path.
remote_removeC
Remove a remote
Inputs: name (required), path.
stash_listC
List stashes
Inputs: path.
stash_popC
Apply and remove a stash
Inputs: index, path.
stash_saveC
Save changes to stash
Inputs: all, includeUntracked, keepIndex, message, +1 more.
statusC
Get repository status
Inputs: path.
tag_createC
Create a tag
Inputs: name (required), annotated, force, message, +2 more.
tag_deleteC
Delete a tag
Inputs: name (required), path.
tag_listC
List tags
Inputs: path.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 21 tools
Every tool has a clearly distinct purpose targeting specific Git operations with no ambiguity. For example, branch_create, branch_delete, and branch_list are clearly differentiated, and tools like stash_save, stash_pop, and stash_list cover distinct aspects of stash management without overlap.
Tool names follow a highly consistent verb_noun pattern throughout, such as branch_create, tag_delete, remote_add, and stash_list. All tools use snake_case with clear, descriptive names that align with Git terminology, making the set predictable and readable.
With 21 tools, the count is borderline high for a Git server, as it includes many specific operations that might be overwhelming. While comprehensive, a typical Git scope could be covered with fewer tools (e.g., 10-15), making this feel slightly heavy but still within reason for the domain.
The tool set provides complete coverage of core Git workflows, including repository management (init, clone), branching (create, delete, list), committing (add, commit), remote operations (add, list, remove, push, pull), and stash/tag handling. No obvious gaps exist, and agents can perform full CRUD/lifecycle operations seamlessly.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
GitHub Copilot MCP: code, repo, PR, workflow tools for AI assistants.
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants to perform standard Git operations like staging, committing, and pushing changes. It facilitates a high-quality, standardized workflow for managing code repositories through natural language commands.138 npmISC
- AlicenseNot gradedqualityNot gradedmaintenanceA lightweight MCP server that enables AI assistants to manage local Git repositories by executing commands like status, add, and commit. It streamlines development workflows by providing repository context and diffs directly to the assistant.Apache 2.0
- AlicenseBqualityCmaintenanceAn enhanced Git MCP server that provides AI assistants with powerful code review, commit analysis, and branch management capabilities for Git repositories.570 npm1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides tools for interacting with Git repositories, enabling AI assistants to manage repositories, branches, commits, and files through a standardized interface.4,204 npm1Apache 2.0