Git Enhanced

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

Enhanced Git MCP Server - Code review, commit analysis, and branch management

已验证STDIO仅桌面文件与存储开发者工具

概览

AI 生成的概览

一个本地 MCP 服务器,为 AI 编程助手提供只读的 Git 上下文,用于代码审查、提交分析、分支比较和发布准备。

可以做什么
检查工作区、暂存区、分支、提交或指定路径的差异,并用状态工具汇总已暂存、未暂存和未跟踪的改动。按作者、日期范围、分支、路径和统计信息筛选查看提交历史。列出分支、将分支与其基线比较,并给出已合并或陈旧分支的清理建议。分析单个提交的元数据、变更文件、统计信息和差异输出。
适用场景
适合维护者和审查者让助手回答日常仓库问题,例如某分支改了什么、哪些提交应写入发布说明、分支是否落后于基线,而无需执行宽泛的 shell 命令。
运行要求
以本地进程通过 stdio 运行。需要 Node.js 18 或更高版本,并需在 PATH 中安装 Git。README 说明可从源码运行,发布后也可通过 npx 运行。清单声明了一个名为 YOUR_API_KEY 的必需密钥环境变量,但 README 未说明其用途。
安装前请注意
清单要求提供 API 密钥环境变量,但 README 描述的是纯本地、只读的服务器,并未解释该密钥的用途,对此请求应保持警惕。该服务器自称只读,不提供删除、重置、检出、变基或推送工具,并会校验 repoPath 指向 Git 仓库。仅适用于你掌控的本地仓库。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

MCP Git Enhanced

[CI] [License] [MCP]

MCP Git Enhanced is a Model Context Protocol server that helps AI coding assistants inspect repository state for day-to-day open-source maintenance.

It gives maintainers structured Git context for code review, commit analysis, branch comparison, and release preparation without asking the assistant to run broad shell commands.

Why Maintainers Use It

Open-source maintainers spend a lot of time answering the same repository questions before they can review or merge work:

  • What changed in this branch?
  • Which commits matter for the release notes?
  • Is this branch behind the base branch?
  • What is staged, unstaged, or untracked?
  • Which merged or stale branches need cleanup?

This server exposes those workflows as focused MCP tools so assistants can help with PR review, issue triage, release management, and repository hygiene.

Available Tools

ToolPurpose
git_diffAnalyze working tree, staged, branch, commit, or path-specific diffs.
git_logReview commit history with filters for author, date range, branch, path, and stats.
git_branchList branches, compare a branch to its base, or suggest cleanup candidates.
git_statusSummarize staged, unstaged, and untracked repository state.
git_commit_analyzeInspect one commit with metadata, changed files, statistics, and diff output.

Installation

From Source

bash
git clone https://github.com/davidweb3-ctrl/mcp-git-enhanced.gitcd mcp-git-enhancednpm installnpm run build

Claude Code Configuration

Use the built server from this repository:

json
{  "mcpServers": {    "git-enhanced": {      "command": "node",      "args": ["/absolute/path/to/mcp-git-enhanced/dist/index.js"]    }  }}

Future npm Install

The package is published as @davidweb3-ctrl/mcp-git-enhanced:

bash
npm install -g @davidweb3-ctrl/mcp-git-enhanced

After publication, clients can use:

json
{  "mcpServers": {    "git-enhanced": {      "command": "npx",      "args": ["@davidweb3-ctrl/mcp-git-enhanced"]    }  }}

Example Workflows

PR Review

text
Use git_diff to compare this branch with master and summarize the risky files.Use git_log to list commits since the last release.Use git_commit_analyze on the largest commit before I review it.

Issue Triage

text
Use git_log to find recent commits touching src/tools.ts.Use git_status to check whether the local reproduction has uncommitted changes.

Release Management

text
Use git_branch compare against master to prepare release notes.Use git_log with --stat style output to identify user-visible changes.Use git_branch suggest_cleanup after the release branch is merged.

Tool Examples

git_diff

json
{  "repoPath": "/absolute/path/to/repo",  "target": "HEAD~5",  "source": "HEAD~10",  "filePath": "src/",  "staged": false}

git_log

json
{  "repoPath": "/absolute/path/to/repo",  "maxCount": 20,  "author": "Maintainer Name",  "since": "1 week ago",  "stat": true}

git_branch

json
{  "repoPath": "/absolute/path/to/repo",  "action": "list",  "includeRemote": true}
json
{  "repoPath": "/absolute/path/to/repo",  "action": "compare",  "branchName": "feature/pr-review-summary",  "baseBranch": "master"}

git_status

json
{  "repoPath": "/absolute/path/to/repo",  "short": false}

git_commit_analyze

json
{  "repoPath": "/absolute/path/to/repo",  "commitHash": "abc123"}

Security Model

MCP Git Enhanced is designed as a read-oriented repository inspection server.

  • It runs fixed git subcommands through spawnSync without shell interpolation.
  • It does not expose destructive branch deletion, reset, checkout, rebase, push, or force-push tools.
  • It validates that repoPath points to a Git repository before executing tool handlers.
  • It is intended for local repositories controlled by the user or maintainer.

See SECURITY.md for reporting and supported-version details.

Development

bash
npm installnpm run buildnpm testnpm run lintnpm run format:check

Project Files

Requirements

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

License

MIT

来源:README.md,提交 6dda5c1

工具

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

版本历史

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

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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