Git

io.github.rog0x由 GitHub 账号 rog0x 发布v1.0.1更新于 Oct 24, 2026

Git log, diff, blame, branch stats for AI agents

已验证STDIO仅桌面开发者工具数据与分析

概览

AI 生成的概览

一个本地 MCP 服务器,让 AI 助手查看 Git 仓库:提交历史、差异、逐行归属、分支状态和活动统计。

可以做什么
按作者、日期范围和文件路径筛选读取提交历史,并比较引用,返回结构化差异摘要或仅统计。查看文件的逐行作者信息,可限定行范围或指定提交。汇总仓库活动:提交数、主要贡献者、改动最多的文件和时间趋势。列出分支及其最后提交信息、领先/落后数量和已合并或未合并状态。
适用场景
适合让助手分析本地仓库的历史、查看分支或提交之间的改动、查明某几行最后由谁修改,或在不调用托管平台 API 的情况下快速了解仓库活跃度。
运行要求
以本地进程通过 stdio 运行,来自 npm 包 @rog0x/mcp-git-tools。需要 Node.js 18 或更高版本,以及已安装并在 PATH 中的 Git。每次工具调用需提供仓库的绝对路径。未声明认证、API 密钥或环境变量。
安装前请注意
这些工具读取本地仓库,助手因此可看到提交历史、差异和逐行归属中的文件内容,以及作者姓名和邮箱。只指向你愿意让模型看到的仓库。README 仅列出读取类分析工具,未描述写入、推送或删除操作。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Git,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-git-tools

Git repository analysis tools for AI agents, served over MCP (Model Context Protocol). Analyzes local repositories using native git commands — no GitHub API required.

Tools

ToolDescription
git_logGet commit history with filtering by author, date range, and file path
git_diffShow diff between commits, branches, or tags with change summaries
git_blameShow who last modified each line of a file with commit info
git_statsRepository statistics: commits, contributors, activity over time, most changed files
git_branchList branches with last commit info, ahead/behind counts, merged/unmerged status

Prerequisites

  • Node.js >= 18
  • Git installed and available in PATH

Setup

bash
npm installnpm run build

Configuration

Add to your MCP client configuration:

json
{  "mcpServers": {    "git-tools": {      "command": "node",      "args": ["D:/products/mcp-servers/mcp-git-tools/dist/index.js"]    }  }}

Tool Details

git_log

Retrieve recent commit history with optional filters.

Parameters:

  • repoPath (required) — Absolute path to the Git repository
  • count — Number of commits to return (default: 20)
  • author — Filter by author name or email
  • since / until — Date range filters
  • path — Filter to commits touching a specific file or directory

git_diff

Compare two refs and get a structured summary of changes.

Parameters:

  • repoPath (required) — Absolute path to the Git repository
  • from — Start ref (default: HEAD~1)
  • to — End ref (default: HEAD)
  • path — Limit diff to a specific file or directory
  • summaryOnly — Return only stats without full diff text

git_blame

See line-by-line authorship of a file.

Parameters:

  • repoPath (required) — Absolute path to the Git repository
  • filePath (required) — File path relative to repo root
  • startLine / endLine — Blame a specific line range
  • ref — Blame at a specific commit

git_stats

Get a high-level overview of repository activity.

Parameters:

  • repoPath (required) — Absolute path to the Git repository
  • topAuthors — Number of top contributors to list (default: 10)
  • topFiles — Number of most-changed files to list (default: 10)

git_branch

List and analyze branches.

Parameters:

  • repoPath (required) — Absolute path to the Git repository
  • baseBranch — Branch to compare against (default: main or master)
  • includeRemote — Include remote-tracking branches
  • mergedOnly / unmergedOnly — Filter by merge status

License

MIT

来源:README.md,提交 d7330b0

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分