Skip to main content
Glama
rog0x

mcp-git-tools

by rog0x

mcp-git-tools

面向 AI 代理的 Git 仓库分析工具,通过 MCP(Model Context Protocol)提供服务。使用原生 git 命令分析本地仓库——无需 GitHub API。

工具

工具

描述

git_log

获取提交历史,支持按作者、日期范围和文件路径筛选

git_diff

显示提交、分支或标签之间的差异,并附带变更摘要

git_blame

显示文件中每一行的最后修改者及提交信息

git_stats

仓库统计:提交数、贡献者、随时间变化的活动、变更最多的文件

git_branch

列出分支,包含最后提交信息、领先/落后计数、已合并/未合并状态

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 — 对特定行范围进行 blame

  • ref — 在特定提交处进行 blame

git_stats

获取仓库活动的高层概览。

参数:

  • repoPath(必填)— Git 仓库的绝对路径

  • topAuthors — 要列出的主要贡献者数量(默认:10)

  • topFiles — 要列出的变更最多的文件数量(默认:10)

git_branch

列出并分析分支。

参数:

  • repoPath(必填)— Git 仓库的绝对路径

  • baseBranch — 用于比较的分支(默认:main 或 master)

  • includeRemote — 包含远程跟踪分支

  • mergedOnly / unmergedOnly — 按合并状态筛选

许可证

MIT

A
license - permissive license
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables 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.
  • A
    license
    B
    quality
    D
    maintenance
    Enables Git repository interaction and automation via LLMs, providing tools to read, search, and manipulate Git repositories.
    15
    159
    MIT
  • F
    license
    B
    quality
    D
    maintenance
    Enables 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.
    10
    121
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables analysis of local Git repositories via standard git commands, providing insights like line authorship, commit frequency, code churn, and co-changed files.

View all related MCP servers

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.

View all MCP Connectors

Latest Blog Posts

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