Skip to content

mfrancisc/pull-request-mcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pull Request Analyzer MCP Server

A Model Context Protocol (MCP) server that analyzes git repository changes by comparing against a base branch.

Features

  • File Change Analysis: List all modified, added, and deleted files
  • Diff Statistics: Show summary statistics of changes
  • Commit History: Display commits between base and current branch
  • Full Diff Output: Optional detailed diff with smart truncation
  • Configurable Base Branch: Compare against any branch (default: main)
  • Working Directory Support: Analyze repositories in any directory

Building

Recommended: Using Makefile

# Build with timestamp version (builds to bin/pull-request-analyzer)
make build

# Clean build artifacts
make clean

# See all available targets
make help

Usage

Transport Modes

The server supports multiple transport modes:

# HTTP mode (default) - Best for web applications and API access
./bin/pull-request-analyzer -transport http -addr :8080

# SSE mode - Server-Sent Events for real-time updates
./bin/pull-request-analyzer -transport sse -addr :8080

# stdio mode - For MCP client integration (Claude Desktop, etc.)
./bin/pull-request-analyzer -transport stdio

Available MCP Tools

The server provides the following tools:

Tool Name Description Key Parameters
analyze-file-changes Analyze file changes in a git repository by comparing against a base branch baseBranch (default: "main"), includeDiff (default: false), maxDiffLines (default: 500), workingDirectory (optional)
list-pr-templates List available PR templates with their content None
suggest-template Suggest the most appropriate PR template based on changes analysis and change type changes_summary (required), change_type (required)

Usage Examples

HTTP Mode (Default)

# Start HTTP server
./bin/pull-request-analyzer -transport http -addr :8080

# The server will be accessible at http://localhost:8080
# Use with MCP clients that support HTTP transport

SSE Mode

# Start SSE server
./bin/pull-request-analyzer -transport sse -addr :8080

# Connect with SSE clients at http://localhost:8080
# Provides real-time streaming updates

Stdio Mode

# Start stdio server (for MCP clients like Claude Desktop)
./bin/pull-request-analyzer -transport stdio

# Add to your MCP client configuration:
# {
#   "mcpServers": {
#     "pull-request-analyzer": {
#       "command": "/path/to/bin/pull-request-analyzer",
#       "args": ["-transport", "stdio"]
#     }
#   }
# }

Requirements

  • Go 1.25 or later
  • Git installed and available in PATH
  • Repository must be a valid git repository
  • Base branch must exist in the repository

TODO

Upcoming features planned for future releases:

  • Custom Template Folders: Ability to provide local folder with custom templates
  • Git Repo Templates: Support for git repo based templates
  • GitHub PR Integration: Tool for opening the PR in GitHub

About

An MCP server that analyzes git repository changes by comparing against a base branch.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published