Git Stuff Server

Integrations

  • Provides Git-related functionality, specifically a tool to generate the diff for a Git merge commit against its first parent by running 'git show -m --first-parent' on a specified commit hash.

Git Stuff 服务器

此仓库包含一个 Node.js 应用程序,它充当 MCP(模型上下文协议)服务器,提供与 Git 相关的功能。目前,它提供了一个工具,用于生成 Git 合并提交与其第一个父提交的 diff。

特征

  • **MCP 服务器:**作为标准 MCP 服务器运行,使用 stdio 进行通信。
  • get_git_merge_diff工具:
    • 接受 Git 合并提交哈希。
    • 执行GenerateMergeDiff.ps1 PowerShell 脚本。
    • 返回由git show -m --first-parent <commitHash>生成的文本差异内容。

先决条件

  • Node.js (支持 ES 模块的版本,如果指定,请检查package.json中的engines ,否则检查tsconfig.json目标 - ES2022)
  • npm (通常随 Node.js 提供)
  • Git已安装并可在系统 PATH 中访问。
  • PowerShell (Windows)或pwsh (Linux/macOS)已安装并可在系统 PATH 中访问。

安装

  1. 克隆存储库:
    git clone <your-repo-url> cd GitStuffServer
  2. 安装依赖项:
    npm install

用法

  1. 构建 TypeScript 代码:
    npm run build
    这会将src/中的 TypeScript 代码编译为build/中的 JavaScript。
  2. 运行服务器:
    • 运行已编译的代码:
      npm start
    • 要在开发模式下构建并运行:
      npm run dev

服务器将启动并监听标准输入/输出上的 MCP 请求。

使用get_git_merge_diff工具

通过 MCP 客户端连接后,您可以使用以下输入调用get_git_merge_diff工具:

  • commitHash (字符串):您想要比较的合并提交的 Git 提交哈希(SHA)。

该工具将以文本形式返回差异内容。

工作原理

  1. MCP 服务器( src/index.ts )接收到get_git_merge_diff工具的请求。
  2. 它验证commitHash输入。
  3. 它执行GenerateMergeDiff.ps1 PowerShell 脚本,并传递commitHash
  4. PowerShell 脚本运行git show -m --first-parent <commitHash>并将输出(包括任何错误)保存到服务器当前工作目录中名为merge_changes.diff的临时文件中。
  5. Node.js 服务器读取merge_changes.diff的内容。
  6. 服务器删除临时的merge_changes.diff文件。
  7. 服务器将 diff 内容(或错误消息)返回给 MCP 客户端。

配置

关键配置点在src/index.ts中定义为常量:

  • SERVER_NAME :MCP 服务器注册的名称。
  • SCRIPT_NAME :要执行的 PowerShell 脚本的文件名。
  • OUTPUT_DIFF_FILE :脚本创建的临时差异文件的名称。

执照

该项目采用 MIT 许可证 - 有关详细信息,请参阅package.json文件。

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

MCP 服务器提供与 Git 相关的功能,主要是一种用于生成 Git 合并提交与其第一个父级的差异的工具。

  1. 特征
    1. 先决条件
      1. 安装
        1. 用法
          1. 使用get_git_merge_diff工具
        2. 工作原理
          1. 配置
            1. 执照

              Related MCP Servers

              • A
                security
                F
                license
                A
                quality
                MCP Server for the GitHub API, providing features for file operations, repository management, and advanced search, with automatic branch creation and comprehensive error handling.
                Last updated -
                18
                4
                1
                TypeScript
              • -
                security
                A
                license
                -
                quality
                A specialized MCP server for in-depth analysis of git repositories, offering tools for branch overview, time period analysis, file changes, and merge recommendations.
                Last updated -
                4
                1
                JavaScript
                Apache 2.0
              • A
                security
                A
                license
                A
                quality
                MCP Tool Server for Gitee, supporting the management of repository files/branches, Issues, and Pull Requests.
                Last updated -
                20
                10
                4
                TypeScript
                MIT License
              • A
                security
                F
                license
                A
                quality
                MCP server for managing Git operations on local repositories, allowing users to list repositories, get and create tags, list commits, push tags, and refresh repositories through a standardized interface.
                Last updated -
                6
                Python

              View all related MCP servers

              ID: piyephrxc1