Git Prompts MCP Server

by ceshine
Verified

local-only server

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

Integrations

  • Provides tools for generating prompts based on Git repository content, including the ability to generate PR descriptions by comparing differences between branches or commits.

Git 提示 MCP 服务器

该存储库提供了一个模型上下文协议 (MCP) 服务器,该服务器提供了多个命令来根据 Git 存储库的内容生成提示。

(该存储库从MarkItDown MCP 服务器和示例Git MCP 服务器中汲取了大量灵感。)

安装

手动安装

  1. 克隆此存储库
  2. 安装依赖项: uv sync --frozen

用法

作为 Zed Editor 的 MCP 服务器

将以下内容添加到您的settings.json

"context_servers": { "git_prompt_mcp": { "command": { "path": "uv", "args": [ "--directory", "/path/to/local/git_prompts_mcp_server", "run", "git-prompts-mcp-server", "/path/to/repo/", // parent folder of the .git directory "--excludes", // exclude files and directories from diff results "**/uv.lock", "--excludes", "**/.gitignore", "--format", // format for diff results "json" // options: json, text ] }, "settings": {} } }

命令

服务器响应以下命令:

  1. /git-diff <ancestor_branch_or_commit> :填充 HEAD 与指定祖先分支或提交之间的差异结果。
  2. /generate-pr-desc <ancestor_branch_or_commit> :根据 HEAD 与指定祖先分支或提交之间的差异结果生成拉取请求描述。
  • 注意:这与/git-diff大致相同,但它包含在输出末尾生成拉取请求描述的说明。
  1. /git-cached-diff :填充阶段性变更和 HEAD 的差异结果。

例子:

  1. /generate-pr-desc main
  2. /git-diff dev
  3. /git-cached-diff

执照

MIT 许可证。详情请参阅许可证

-
security - not tested
A
license - permissive license
-
quality - not tested

一个基于 Git 存储库内容生成提示的模型上下文协议服务器,包括从差异生成 PR 描述的命令。

  1. Installation
    1. Manual Installation
  2. Usage
    1. As a MCP Server for Zed Editor
  3. License
    ID: pslnaj9dsy