Skip to main content
Glama
Git Prompts MCP Server

Git Prompts MCP Server

by ceshine

Git 提示 MCP 服务器

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

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

安装

手动安装

  1. 克隆此存储库

  2. 安装依赖项: uv sync --frozen

Related MCP server: GitHub MCP Server

用法

作为 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 许可证。详情请参阅许可证。

Available Tools

3 tools
git-cached-diffA

Get a diff between the files in the staging area (the index) and the HEAD

Inputs: no named parameters. Returns: result

git-commit-messagesB

Get commit messages between the ancestor and HEAD

Inputs: ancestor (required). Returns: result

git-diffB

Get a diff between the HEAD and the ancestor branch or commit

Inputs: ancestor (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 3 tools

    Disambiguation3/5

    The three tools have overlapping purposes focused on git diffs and commit history, which could cause confusion. git-cached-diff and git-diff both produce diffs but target different git states, while git-commit-messages retrieves commit messages. The descriptions help clarify the distinctions, but the domain overlap is significant.

    Naming Consistency5/5

    All tool names follow a consistent 'git-' prefix with hyphenated descriptive terms (cached-diff, commit-messages, diff). This pattern is predictable and readable throughout the set, with no deviations in style or convention.

    Tool Count3/5

    With only 3 tools, the server feels thin for a git-related domain, which typically involves more operations like status, log, branch, or push. While the tools cover specific diff and commit message scenarios, the scope appears limited and potentially incomplete for general git workflows.

    Completeness2/5

    For a git server, there are significant gaps in the tool surface. It lacks basic operations such as viewing status, checking out branches, pushing/pulling changes, or creating commits. The tools only cover diff and commit message retrieval, leaving most git workflows unsupported and likely to cause agent failures.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      A Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.
      14
      97,509 PyPI
      92,139
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that enables LLMs to interact with Git repositories, providing tools to read, search, and manipulate Git repositories through commands like status, diff, commit, and branch management.
      12
      MIT
    • A
      license
      C
      quality
      B
      maintenance
      A Model Context Protocol server that enables LLMs to interact with Git repositories, providing tools to read, search, and manipulate Git repositories through commands like status, diff, commit, and branch operations.
      22
      4
      MIT