This MCP server provides Git repository analysis tools for AI assistants, enabling diff generation, commit history extraction, and pull request description creation.
Core Features:
Compare branches or commits - Get detailed diffs between HEAD and any ancestor branch or commit
Review staged changes - View differences between staged files and HEAD
Extract commit history - Retrieve commit messages between any ancestor and HEAD
Generate PR descriptions - Automatically create pull request descriptions based on diffs and commit history
Filter diff output - Exclude specific files and directories using pattern matching
Flexible output formats - View results in JSON or text format
Environment-based configuration - Configure repository path, excludes, and output format via environment variables
MCP integration - Works with MCP-compatible clients like Zed editor through standardized tools and commands
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 Prompts MCP Server
This repository provides a Model Context Protocol (MCP) server that offers several commands to generate prompts based on the Git repository's content.
(This repository draws heavy inspiration from MarkItDown MCP server and the example Git MCP server.)
Installation
Manual Installation
Clone this repository
Install dependencies:
uv sync --frozen
Related MCP server: Git MCP Server
Usage
As a MCP Server for Zed Editor
Add the following to your settings.json:
Commands
The server responds to the following commands:
/git-diff <ancestor_branch_or_commit>: Populate the diff results between HEAD and the specified ancestor branch or commit./generate-pr-desc <ancestor_branch_or_commit>: Generate a pull request description based on the diff results between HEAD and the specified ancestor branch or commit.
Note: This is largely the same as
/git-diff, but it includes instructions for generating a pull request description at the end of the output.
/git-cached-diff: Populate the diff results for the staged changes and HEAD.
Examples:
/generate-pr-desc main/git-diff dev/git-cached-diff
License
MIT License. See LICENSE for details.