Back to MCP directory
publicPublicdnsLocal runtime

ceshine_git-prompts-mcp-server

一个基于Git仓库内容生成提示词的MCP服务器,支持PR描述生成等功能

article

README

🚀 Git 提示 MCP 服务器

本仓库提供了一个模型上下文协议(MCP)服务器,它能依据 Git 仓库的内容,提供多个生成提示的命令,为开发者在处理 Git 仓库时提供便利。

(此仓库从MarkItDown MCP 服务器和示例Git MCP 服务器中获取了大量灵感。)

🚀 快速开始

本服务器可根据 Git 仓库内容生成提示,帮助开发者更好地处理 Git 仓库相关事务。下面将介绍其安装和使用方法。

✨ 主要特性

  • 依据 Git 仓库内容提供生成提示命令。
  • 可作为 Zed 编辑器的 MCP 服务器使用。
  • 能根据 HEAD 和祖先分支或提交之间的差异生成 PR 描述。

📦 安装指南

手动安装

  1. 克隆此仓库。
  2. 安装依赖:uv sync --frozen

💻 使用示例

作为 Zed 编辑器的 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/", // .git 目录的父文件夹路径
        "--excludes", // 从 diff 结果中排除文件和目录
        "**/uv.lock",
        "--excludes",
        "**/.gitignore",
        "--format", // diff 结果的格式
        "json"  // 选项:json、text
      ]
    },
    "settings": {}
  }
}

命令使用

该服务器响应以下命令:

基础用法

  • /generate-pr-desc <ancestor_branch_or_commit>: 根据 HEAD 和祖先分支或提交之间的差异生成 PR 描述。
/generate-pr-desc main

📄 许可证

本项目采用 MIT 许可证。有关详细信息,请参阅LICENSE

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client