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.
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
Installation
- Clone the repository:
- Install dependencies:
- Build the project:
Configuration
Add to your MCP settings file:
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
License
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
You must be authenticated.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
The Git MCP Server allows AI assistants to perform enhanced Git operations via the Model Context Protocol, supporting core Git functions, branch and tag management, GitHub integration, and more.
Related Resources
Related MCP Servers
- AsecurityFlicenseAqualityMCP server for managing Git operations on local repositories, allowing users to list repositories, get and create tags, list commits, push tags, and refresh repositories through a standardized interface.Last updated -6Python
- AsecurityFlicenseAqualityAn MCP server that enables AI assistants to manage GitHub Actions workflows by providing tools for listing, viewing, triggering, canceling, and rerunning workflows through the GitHub API.Last updated -932TypeScript
- -securityAlicense-qualityAn MCP server that enables AI assistants like Claude to help users manage their GitHub notifications through natural language commands.Last updated -5511TypeScriptMIT License
- -securityAlicense-qualityAn MCP server that analyzes codebases and generates contextual prompts, making it easier for AI assistants to understand and work with code repositories.Last updated -10PythonMIT License