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 分