Git Stuff Server
Git Stuff 服务器
此仓库包含一个 Node.js 应用程序,它充当 MCP(模型上下文协议)服务器,提供与 Git 相关的功能。目前,它提供了一个工具,用于生成 Git 合并提交与其第一个父提交的 diff。
特征
**MCP 服务器:**作为标准 MCP 服务器运行,使用 stdio 进行通信。
get_git_merge_diff工具:接受 Git 合并提交哈希。
执行
GenerateMergeDiff.ps1PowerShell 脚本。返回由
git show -m --first-parent <commitHash>生成的文本差异内容。
Related MCP server: agent-services-mcp
先决条件
Node.js (支持 ES 模块的版本,如果指定,请检查package.json中的
engines,否则检查tsconfig.json目标 - ES2022)npm (通常随 Node.js 提供)
Git已安装并可在系统 PATH 中访问。
PowerShell (Windows)或
pwsh(Linux/macOS)已安装并可在系统 PATH 中访问。
安装
克隆存储库:
git clone <your-repo-url> cd GitStuffServer安装依赖项:
npm install
用法
构建 TypeScript 代码:
npm run build这会将
src/中的 TypeScript 代码编译为build/中的 JavaScript。运行服务器:
运行已编译的代码:
npm start要在开发模式下构建并运行:
npm run dev
服务器将启动并监听标准输入/输出上的 MCP 请求。
使用get_git_merge_diff工具
通过 MCP 客户端连接后,您可以使用以下输入调用get_git_merge_diff工具:
commitHash(字符串):您想要比较的合并提交的 Git 提交哈希(SHA)。
该工具将以文本形式返回差异内容。
工作原理
MCP 服务器(
src/index.ts)接收到get_git_merge_diff工具的请求。它验证
commitHash输入。它执行
GenerateMergeDiff.ps1PowerShell 脚本,并传递commitHash。PowerShell 脚本运行
git show -m --first-parent <commitHash>并将输出(包括任何错误)保存到服务器当前工作目录中名为merge_changes.diff的临时文件中。Node.js 服务器读取
merge_changes.diff的内容。服务器删除临时的
merge_changes.diff文件。服务器将 diff 内容(或错误消息)返回给 MCP 客户端。
配置
关键配置点在src/index.ts中定义为常量:
SERVER_NAME:MCP 服务器注册的名称。SCRIPT_NAME:要执行的 PowerShell 脚本的文件名。OUTPUT_DIFF_FILE:脚本创建的临时差异文件的名称。
执照
该项目采用 MIT 许可证 - 有关详细信息,请参阅package.json文件。
Available Tools
4 toolsado_pr_changesC
Fetches changes from an Azure DevOps Pull Request with full diff content using the Azure DevOps Node API.
Inputs: organizationId (required), pullRequestId (required).
ado_pr_commentB
Posts a comment to an Azure DevOps Pull Request. Can reply to existing threads or create new ones.
Inputs: commentsToPost (required), pullRequestId (required), organizationId.
ado_pr_threadsC
Fetches all active comment threads from an Azure DevOps Pull Request.
Inputs: pullRequestId (required), organizationId.
git_merge_diffB
Generates the text diff for a Git merge commit against its first parent within a specified local repository.
Inputs: commitHash (required), repoPath (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Three tools (ado_pr_changes, ado_pr_comment, ado_pr_threads) are clearly distinct and focused on Azure DevOps pull request operations, with no overlap in their purposes. The fourth tool (git_merge_diff) is unrelated to Azure DevOps and operates on local Git repositories, creating a minor domain mismatch but no functional ambiguity.
The naming is inconsistent across the tool set. The first three tools use a consistent 'ado_pr_' prefix with descriptive suffixes (changes, comment, threads), but the fourth tool uses a different 'git_' prefix with a different structure (merge_diff). This mixed convention reduces predictability and coherence.
With only 4 tools, the count feels thin for a server named 'Git Stuff Server', which implies broader Git-related functionality. The tools are split between Azure DevOps PR operations and a local Git diff tool, making the scope appear fragmented rather than comprehensive.
For Azure DevOps pull requests, the tools cover fetching changes, commenting, and fetching threads, but lack core operations like creating, updating, or merging pull requests. For local Git operations, only one diff tool is provided, missing basic commands like clone, commit, or push. This results in significant gaps that will hinder agent workflows.
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
Deterministic OpenAPI 3.x SemVer diff, SPF 10-lookup flattener & WCAG 2.2 / EN 301 549 MCP server.
Related MCP Servers
- AlicenseBqualityDmaintenanceA specialized MCP server for in-depth analysis of git repositories, offering tools for branch overview, time period analysis, file changes, and merge recommendations.47Apache 2.0
- FlicenseBqualityDmaintenanceMCP Server for Git operations, agent templates, and project utilities.9-
- AlicenseAqualityDmaintenanceA local MCP server that provides a safe, explicit set of Git operations for version control tasks like status, diff, branching, staging, committing, fetching, merging, and pushing.1315 npmMIT
- AlicenseAqualityCmaintenanceMCP server for git archaeology — churn hotspots, blame summaries, bus factor, commit forensics and file history over any local repository.113MIT