Git MCP Server
Allows interaction with Git repositories, providing tools for listing repositories, branches, tags, reading files, viewing commit history, diffs, blame, and code search, as well as LLM-powered code analysis and diff review.
Click on "Deploy 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 the git log for the main branch and analyze the latest commit"
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
基于 MCP (Model Context Protocol) 的 Git 仓库管理服务。
核心功能
🔐 Access Key 权限管理:通过 Key 精准控制每个用户可访问的 Git 仓库及权限级别
📦 仓库管理:配置 Git 仓库 URL、认证凭据、主分支
🔒 细粒度权限:仓库级 (read_only/read_write/admin) + 分支正则 + 路径正则
📋 完整审计:记录所有 MCP 操作,支持按 Key/仓库/操作/状态筛选
🤖 内置大模型:集成 LLM 分析代码逻辑、审查差异
🖥️ Web 管理后台:Svelte 5 + Tailwind CSS + daisyUI
Related MCP server: github-mcp-proxy
快速开始
Docker 部署(推荐)
# 1. 配置
cp config/config.yml.example config/config.yml
# 编辑 config/config.yml,修改密钥和数据库密码
# 2. 启动
docker compose up -d --build
# 3. 访问
# 管理后台: http://localhost:3001/admin
# 默认账号: admin / admin123本地开发
# 1. PostgreSQL
docker run -d --name git-mcp-server-pg \
-e POSTGRES_DB=git_mcp_admin \
-e POSTGRES_USER=git_mcp_admin \
-e POSTGRES_PASSWORD=git_mcp_dev \
-p 5433:5432 postgres:16-alpine
# 2. 安装依赖
pip install -r requirements.txt
cd frontend && npm install && npm run build && cd ..
# 3. 配置
cp config/config.yml.example config/config.yml
# 编辑 config/config.yml
# 4. 运行
python -m src.serverMCP 工具列表
工具 | 说明 |
| 列出可访问的 Git 仓库 |
| 列出分支 |
| 列出标签 |
| 列出目录树 |
| 读取文件内容 |
| 提交历史 |
| 查看提交详情 |
| 比较差异 |
| 查看修改者 |
| 代码搜索 |
| LLM 分析代码 |
| LLM 审查差异 |
IDE 集成
在 IDE 的 MCP 配置中添加:
{
"mcpServers": {
"git-mcp-server": {
"url": "http://localhost:3001/mcp/sse",
"transport": "sse",
"headers": {
"X-Access-Key": "your-access-key"
}
}
}
}AI 辅助开发
AGENTS.md — AI 编码助手(Claude Code / Codex / Cursor / Copilot)在本仓库的工作规则
docs/ai-coding-rules.md — 详细编码规范(后端 / 前端 / 安全红线 / 常见坑)
安全特性
所有凭据 (Git 密码/Token/LLM API Key) 加密存储
Access Key 支持 IP 白名单
仓库默认只读,
allow_write和allow_push需显式开启完整审计日志 (谁、何时、做了什么、结果如何)
JWT 认证的管理后台
目录结构
git_mcp_server/
├── config/ # 配置文件
├── docker/ # Docker 相关
├── frontend/ # Svelte 5 管理后台
├── script/ # 工具脚本
├── src/
│ ├── admin/ # 管理后台 API
│ ├── ai/ # 大模型集成
│ ├── git/ # Git 操作封装
│ ├── logging/ # 日志
│ ├── mcp/ # MCP 协议处理
│ ├── security/ # 安全工具
│ └── services/ # 外部服务
└── docs/ # 文档This server cannot be deployed
Maintenance
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Related MCP Servers
- AlicenseBqualityCmaintenanceAn enhanced Git MCP server that provides AI assistants with powerful code review, commit analysis, and branch management capabilities for Git repositories.542 npm1MIT
- FlicenseNot gradedqualityDmaintenanceA self-hosted GitHub MCP server with per-repository guardrails for AI agents, enabling fine-grained access control and audit trails.-
- AlicenseNot gradedqualityDmaintenanceMCP server for indexing and searching Git repositories with AI. Enables tools like listing repos, semantic search, file globbing, and regex grep.12 npm16MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides tools for interacting with Git repositories, enabling AI assistants to manage repositories, branches, commits, and files through a standardized interface.2,852 npm1Apache 2.0