Mcp Git Enhanced

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

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

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

概览

AI 生成的概览

一个本地 MCP 服务器,为 AI 编程助手提供结构化的只读 Git 上下文,用于代码审查、提交分析和分支管理。

可以做什么
  • 分析工作区、暂存区、分支、提交或指定路径的差异
  • 按作者、日期范围、分支、路径和统计筛选查看提交历史
  • 列出分支、将分支与其基线比较,或给出可清理分支建议
  • 汇总已暂存、未暂存和未跟踪的仓库状态
  • 查看单个提交的元数据、变更文件、统计信息和差异内容
适用场景
适合在助手协助进行拉取请求审查、问题分诊、发布说明整理或仓库清理时使用,让它无需执行宽泛的 shell 命令即可获得仓库信息。最适用于你或团队自己维护的本地仓库。
运行要求
以本地 stdio 进程运行;需要 Node.js 18.0.0 或更高版本,以及已安装并在 PATH 中可用的 Git。每次工具调用需提供指向 Git 仓库的绝对 repoPath。未声明任何账号、API 密钥或环境变量。
安装前请注意
设计上偏向只读:通过固定 git 子命令执行且不做 shell 插值,不提供删除分支、reset、checkout、rebase 或 push 等工具。仅适用于用户自己掌控的本地仓库;工具结果包含提交元数据和差异内容,会传给助手。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp 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.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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