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 "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 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 installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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.Last updated5871MIT
- Flicense-qualityDmaintenanceA self-hosted GitHub MCP server with per-repository guardrails for AI agents, enabling fine-grained access control and audit trails.Last updated
- Alicense-qualityDmaintenanceMCP server for indexing and searching Git repositories with AI. Enables tools like listing repos, semantic search, file globbing, and regex grep.Last updated3916MIT
- Alicense-qualityDmaintenanceAn MCP server that provides tools for interacting with Git repositories, enabling AI assistants to manage repositories, branches, commits, and files through a standardized interface.Last updated4,7301Apache 2.0
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
An MCP server for Arcjet - the runtime security platform that ships with your AI code.
An MCP server that gives your AI access to the source code and docs of all public github repos
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/redgreat/git_mcp_server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server