mcp-git-tools
mcp-git-tools
面向 AI 代理的 Git 仓库分析工具,通过 MCP(Model Context Protocol)提供服务。使用原生 git 命令分析本地仓库——无需 GitHub API。
工具
工具 | 描述 |
| 获取提交历史,支持按作者、日期范围和文件路径筛选 |
| 显示提交、分支或标签之间的差异,并附带变更摘要 |
| 显示文件中每一行的最后修改者及提交信息 |
| 仓库统计:提交数、贡献者、随时间变化的活动、变更最多的文件 |
| 列出分支,包含最后提交信息、领先/落后计数、已合并/未合并状态 |
Related MCP server: mcp-git
前置要求
Node.js >= 18
已安装 Git 且可在 PATH 中使用
安装
npm install
npm run build配置
添加到你的 MCP 客户端配置中:
{
"mcpServers": {
"git-tools": {
"command": "node",
"args": ["D:/products/mcp-servers/mcp-git-tools/dist/index.js"]
}
}
}工具详情
git_log
获取最近的提交历史,支持可选筛选条件。
参数:
repoPath(必填)— Git 仓库的绝对路径count— 要返回的提交数量(默认:20)author— 按作者姓名或邮箱筛选since/until— 日期范围筛选path— 筛选涉及特定文件或目录的提交
git_diff
比较两个引用并获取结构化的变更摘要。
参数:
repoPath(必填)— Git 仓库的绝对路径from— 起始引用(默认:HEAD~1)to— 结束引用(默认:HEAD)path— 将差异限制在特定文件或目录summaryOnly— 仅返回统计信息,不包含完整差异文本
git_blame
查看文件逐行的作者归属。
参数:
repoPath(必填)— Git 仓库的绝对路径filePath(必填)— 相对于仓库根目录的文件路径startLine/endLine— 对特定行范围进行 blameref— 在特定提交处进行 blame
git_stats
获取仓库活动的高层概览。
参数:
repoPath(必填)— Git 仓库的绝对路径topAuthors— 要列出的主要贡献者数量(默认:10)topFiles— 要列出的变更最多的文件数量(默认:10)
git_branch
列出并分析分支。
参数:
repoPath(必填)— Git 仓库的绝对路径baseBranch— 用于比较的分支(默认:main 或 master)includeRemote— 包含远程跟踪分支mergedOnly/unmergedOnly— 按合并状态筛选
许可证
MIT
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
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to interact with local Git repositories for operations like status, commits, branching, and diffs, plus GitHub API integration for managing pull requests when authenticated.
- AlicenseBqualityDmaintenanceEnables Git repository interaction and automation via LLMs, providing tools to read, search, and manipulate Git repositories.15159MIT
- FlicenseBqualityDmaintenanceEnables AI assistants to inspect local Git repositories and interact with the GitHub API for reading commits, diffs, files, issues, comments, pull requests, and project boards.10121
- FlicenseNot gradedqualityBmaintenanceEnables analysis of local Git repositories via standard git commands, providing insights like line authorship, commit frequency, code churn, and co-changed files.
Related MCP Connectors
Git-backed platform for skills, tools, and context for AI agents
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Repo intel for AI coding agents: overview, PRs, contributors, hot files, CI, deps. Remote MCP.
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/rog0x/mcp-git-tools'
If you have feedback or need assistance with the MCP directory API, please join our Discord server