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 "Install 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 Servershow 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: GitHub MCP Server Plus
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Sheshiyer/git-mcp-v2'
If you have feedback or need assistance with the MCP directory API, please join our Discord server