mxxx222/git-mcp-server
3.2
If you are the rightful owner of git-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A comprehensive Model Context Protocol (MCP) server that provides Git operations through a standardized interface.
Tools
14
Resources
0
Prompts
0
Git MCP Server
A comprehensive Model Context Protocol (MCP) server that provides Git operations through a standardized interface. This server enables AI assistants to interact with Git repositories programmatically.
Features
- Complete Git Operations: Status, log, branch management, commit operations
- Remote Repository Management: Clone, push, pull, remote configuration
- Advanced Git Features: Stash, tag management, reset operations, diff viewing
- Working Directory Control: Operate on any Git repository path
- Type-Safe Implementation: Built with TypeScript for reliability
Installation
- Clone or download this repository
- Install dependencies:
npm install - Build the TypeScript code:
npm run build - Start the server:
npm start
Available Tools
Repository Status
git_status- Get git status of a repositorygit_log- Show commit history with configurable formattinggit_branch- List all branches (local and remote)git_diff- Show changes between commits or working tree
Staging and Committing
git_add- Stage files for commit (specific files or all changes)git_commit- Create new commits with messagesgit_stash- Save/apply/drop changes temporarily
Repository Management
git_init- Initialize new repositoriesgit_clone- Clone remote repositoriesgit_push- Push commits to remote branchesgit_pull- Fetch and merge changes from remotegit_remote- Add/remove/rename remote repositoriesgit_reset- Reset current HEAD to specified stategit_tag- Create/delete/list tags
Usage Examples
Check Repository Status
{
"tool": "git_status",
"arguments": {
"cwd": "/path/to/repository"
}
}
Create a Commit
{
"tool": "git_commit",
"arguments": {
"message": "Add new feature implementation",
"cwd": "/path/to/repository"
}
}
Clone a Repository
{
"tool": "git_clone",
"arguments": {
"url": "https://github.com/user/repo.git",
"cwd": "/local/path",
"depth": 1
}
}
Configuration
The server automatically detects the current working directory but allows specifying alternative paths for repository operations.
Requirements
- Node.js 18+ (for ES modules support)
- Git installed and available in PATH
- TypeScript 5.0+ (for building)
Development
For development mode with automatic rebuilding:
npm run dev
License
MIT License - feel free to use in your projects.