mcp-git
A complete Git CLI wrapper for the Model Context Protocol (MCP), enabling AI assistants to perform all git operations through MCP tools.
README
🔧 MCP Git Server
A complete Git CLI wrapper for the Model Context Protocol (MCP). Provides 100% of git functionality through MCP tools for AI assistants like Claude.
✨ Features
- 🎯 Complete Git CLI wrapper - All git commands available as MCP tools
- 📝 Repository information - Status, logs, diffs, and commit details
- 🌿 Branch management - Create, delete, switch, and merge branches
- 📦 Staging & commits - Add files, commit changes, reset, and stash
- 🌐 Remote operations - Clone, fetch, pull, push, and remote management
- 🔒 Secure - No credential storage, uses your existing git configuration
📋 Prerequisites
- Git CLI must be installed and accessible in PATH
- Node.js 16+ for running the MCP server
- Existing git configuration (
git config --global user.nameanduser.email)
🚀 Quick Start
Using with npx (recommended)
npx @artik0din/mcp-git
Install globally
npm install -g @artik0din/mcp-git
mcp-git
🔧 MCP Client Setup
Add this server to your MCP client configuration:
Claude Desktop Configuration
{
"mcpServers": {
"git": {
"command": "npx",
"args": ["@artik0din/mcp-git"]
}
}
}
Other MCP Clients
{
"name": "git",
"command": "npx",
"args": ["@artik0din/mcp-git"]
}
📚 Available Tools
Repository Information
-
git_status - Show working tree status
path(string, required) - Repository pathshort(boolean) - Give output in short format
-
git_log - Show commit logs
path(string, required) - Repository pathlimit(number) - Number of commits (default: 10)oneline(boolean) - One line per commitbranch(string) - Branch nameauthor(string) - Filter by authorsince(string) - Show commits since dateuntil(string) - Show commits until dategrep(string) - Filter by commit message
-
git_diff - Show changes between commits/working tree
path(string, required) - Repository pathstaged(boolean) - Show staged changescommit(string) - Compare with commitfile(string) - Specific file to diffstat(boolean) - Show diffstat only
-
git_show - Show commit details and diff
path(string, required) - Repository pathcommit(string) - Commit SHA (default: HEAD)stat(boolean) - Show diffstat only
Branch Management
-
git_branch - List, create, or delete branches
path(string, required) - Repository pathaction(string) - Action: list, create, delete, renamename(string) - Branch namenew_name(string) - New name for renameall(boolean) - List all branches including remoteforce(boolean) - Force delete
-
git_checkout - Switch branches or restore files
path(string, required) - Repository pathbranch(string) - Branch to checkoutcreate(boolean) - Create new branch (-b)file(string) - File to restore
-
git_merge - Merge branches
path(string, required) - Repository pathbranch(string) - Branch to mergeno_ff(boolean) - Create merge commit even if fast-forward possiblesquash(boolean) - Squash commitsmessage(string) - Merge commit messageabort(boolean) - Abort current merge
Staging & Commits
-
git_add - Add file contents to staging area
path(string, required) - Repository pathfiles(array) - Files to add (use ['.'] for all)all(boolean) - Add all changes (-A)update(boolean) - Update tracked files only (-u)
-
git_commit - Record changes to repository
path(string, required) - Repository pathmessage(string, required) - Commit messageall(boolean) - Automatically stage modified files (-a)amend(boolean) - Amend previous commitallow_empty(boolean) - Allow empty commit
-
git_reset - Reset current HEAD to specified state
path(string, required) - Repository pathcommit(string) - Commit to reset to (default: HEAD)mode(string) - Reset mode: soft, mixed, hard (default: mixed)files(array) - Unstage specific files
-
git_stash - Stash changes in working directory
path(string, required) - Repository pathaction(string) - Action: push, pop, apply, list, drop, clearmessage(string) - Stash message (for push)index(number) - Stash index (for pop/apply/drop)include_untracked(boolean) - Include untracked files
Remote Operations
-
git_remote - Manage remote repositories
path(string, required) - Repository pathaction(string) - Action: list, add, remove, show, set-urlname(string) - Remote nameurl(string) - Remote URL
-
git_fetch - Download objects and refs from remote
path(string, required) - Repository pathremote(string) - Remote name (default: origin)all(boolean) - Fetch all remotesprune(boolean) - Prune deleted remote branchestags(boolean) - Fetch tags
-
git_pull - Fetch and integrate with remote branch
path(string, required) - Repository pathremote(string) - Remote name (default: origin)branch(string) - Branch namerebase(boolean) - Rebase instead of mergeff_only(boolean) - Fast-forward only
-
git_push - Update remote refs and objects
path(string, required) - Repository pathremote(string) - Remote name (default: origin)branch(string) - Branch nameforce(boolean) - Force pushforce_with_lease(boolean) - Force push with lease (safer)set_upstream(boolean) - Set upstream for branch (-u)tags(boolean) - Push tagsdelete(boolean) - Delete remote branch
-
git_clone - Clone a repository
url(string, required) - Repository URLdestination(string) - Destination directorybranch(string) - Branch to checkoutdepth(number) - Shallow clone depthrecursive(boolean) - Clone submodules recursively
🔒 Security
This server uses your existing git configuration and credentials. It does not store or manage any sensitive information:
- Uses system-installed git CLI
- Respects your existing SSH keys and credentials
- No network requests outside of git operations
- All operations performed in specified directories only
📝 License
MIT License - see LICENSE file for details.
🤝 Contributing
Contributions welcome! Please feel free to submit a Pull Request.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。