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:
git clone https://github.com/yourusername/git-mcp-v2.git
cd git-mcp-v2
- Install dependencies:
npm install
- Build the project:
npm run build
Configuration
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 format
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
Recommend MCP Servers 💡
mcp-server-fetch
An MCP server enabling LLMs to fetch and process web content as markdown.
@alanse/fish-audio-mcp-server
MCP server integrating Fish Audio's TTS API with LLMs for natural language-driven speech synthesis.
doris-mcp-server
Doris MCP (Model Context Protocol) Server is a backend service built with Python and FastAPI. It implements the MCP, allowing clients to interact with it through defined "Tools". It's primarily designed to connect to Apache Doris databases, potentially leveraging Large Language Models (LLMs) for tasks like converting natural language queries to SQL (NL2SQL), executing queries, and performing metadata management and analysis.
@waystation/mcp
The only MCP Server you need. Connect any MCP host with the tools you use daily through our no-code, secure integration hub.
TAMA-MCP-Server
An AI-powered command-line interface (CLI) task manager that functions as an MCP server, enabling AI-driven task generation, expansion, and standard task management with dependency tracking.
slack-mcp-server
A powerful Model Context Protocol (MCP) server for Slack Workspaces, supporting Stdio and SSE transports, stealth/OAuth modes, DMs, Group DMs, smart history fetch, and message search.