Skip to main content
Glama

pr-mcp-server

MCP (Model Context Protocol) server to automate Pull Request creation with AI. Analyzes Git branches, generates descriptions, titles, suggests reviewers, and performs code reviews. Designed to speed up reviews and improve PR quality.

✨ Features

  • πŸš€ Unified PR Workflow - Complete PR creation with one command ("Create a PR")

  • 🧠 AI-Powered Code Review - Context-aware review integrated into PR description

  • πŸ” Project Context Analysis - Detects TypeScript, i18n, state management, styling, testing frameworks

  • πŸ“ PR Generation - Generate PR descriptions (standard, detailed, minimal templates | EN/FR)

  • 🏷️ Conventional Titles - Generate conventional PR titles (feat, fix, docs, etc.)

  • 🎨 Smart GIFs - Automatically adds relevant GIFs based on work type

  • πŸ‘₯ Auto Reviewers - Suggest and add reviewers based on contribution history

  • πŸ”Ž Code Review - Automated code review with actionable feedback

  • πŸ€– AI-Ready - Works with MCP Inspector, Cursor, and Claude Desktop

Related MCP server: Cursor Auto-Review MCP Server

πŸ“š Documentation

πŸš€ Quick Start

Requirements

  • Node.js 18+

  • A Git repository

Installation

Local development:

npm install
npm run build

Global installation (recommended):

npm link

This makes the pr-mcp-server command available globally.

Test with MCP Inspector

After npm link, run:

npx @modelcontextprotocol/inspector pr-mcp-server

The Inspector will list all available tools. Run it inside a Git repository for full functionality.

Use with Cursor

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "pr-mcp-server": {
      "command": "pr-mcp-server",
      "cwd": "{workspaceFolder}"
    }
  }
}

Restart Cursor, then ask:

  • "Create a PR" - Uses the unified workflow (recommended)

  • "GΓ©nΓ¨re le titre de ma PR"

  • "Analyse ma branche et gΓ©nΓ¨re la description de la PR"

  • "CrΓ©e une PR sur GitHub avec des reviewers"

See Configuration Guide for more details.

🎯 Unified PR Creation Workflow (AI-Powered)

When you say "Create a PR", Claude (the AI) orchestrates an intelligent workflow:

How It Works

  1. Call review tool - Gathers comprehensive project context:

    • Detects language/framework (TypeScript, PHP, Python, Go, Rust, etc.)

    • Identifies technologies (i18n, state management, styling, testing)

    • Extracts full diff and commit history

    • Returns structured prompt with all context

  2. Claude analyzes and generates review - True AI-powered analysis:

    • Understands project conventions automatically

    • Identifies issues specific to YOUR tech stack

    • Provides intelligent, context-aware suggestions

    • Works for ANY language/framework (not just TypeScript!)

  3. Call create_pr_complete with review - Creates complete PR:

    • Generates conventional commit-style title

    • Creates comprehensive description

    • Includes Claude's intelligent review

    • Adds smart GIF based on PR type

    • Creates/updates GitHub PR

    • Assigns reviewers from Git history

What Makes It Intelligent

Unlike rule-based tools, this uses Claude's intelligence to:

  • βœ… Adapt to ANY project (PHP Laravel, Python Django, Go, Rust, etc.)

  • βœ… Understand complex patterns and context

  • βœ… Provide project-specific recommendations

  • βœ… Detect violations of YOUR project's conventions

Example: In a PHP Laravel project, it will flag SQL injection vulnerabilities and suggest Eloquent ORM. In a React i18n project, it will catch hardcoded strings. All automatically!

Example Usage

# In Cursor or Claude Desktop, simply say:
"Create a PR"

# Claude will automatically:
# 1. Call 'review' to get project context
# 2. Analyze the context and generate intelligent review
# 3. Call 'create_pr_complete' with the review
# 4. Return the PR URL

# With specific options:
"Create a PR in English with the detailed template"
"Create a draft PR without reviewers"

See AI_POWERED_REVIEW.md for technical details on how the AI review works.

πŸ› οΈ Available Tools

Tool

Description

Recommended

create_pr_complete

πŸš€ Unified workflow - Complete PR creation with AI review

⭐ YES

create_pr

Create PR on GitHub with auto-reviewers (no AI review)

analyze_branch

Analyze differences between branches

generate_pr_title

Generate conventional PR title

generate_pr_description

Generate PR description

generate_pr_complete

Generate both title and description

suggest_reviewers

Suggest reviewers based on Git history

review

Automated code review (context-aware)

Recommendation: Use create_pr_complete for the best experience. It combines all features with intelligent, context-aware code review.

See Tools Reference for detailed documentation.

πŸ“¦ Useful Scripts

npm run build        # Compile TypeScript to dist/
npm start            # Start the MCP server
npm test             # Run tests
npm run test:watch   # Run tests in watch mode
npm run test:ui      # Run tests with UI
npm run dev          # Run in development mode

πŸ› Troubleshooting

  • "Not a git repository": Run the server inside a Git repo

  • ESM import issues: Use Node 18+ and build the project (npm run build)

  • Permission errors: Ensure your shell has access to the repo

  • "GitHub token is required": Set GITHUB_TOKEN environment variable

  • "Branch does not exist on remote": Push your branch first

See GitHub Integration for more troubleshooting.

πŸ“„ License

MIT

Available Tools

8 tools
analyze_branchA

Analyzes the differences between the current Git branch and a base branch. Automatically detects the main branch (dev/main/master) and current Git repository from the working directory. Use this when the user asks to analyze a branch, check changes, or understand what's in the current branch.

Inputs: detailed, baseBranch.

create_prA

Creates a Pull Request on GitHub WITHOUT AI review. RECOMMENDED WORKFLOW: (1) Call 'generate_pr_title' β†’ get prompt, (2) YOU analyze and generate title, (3) Call 'generate_pr_description' β†’ get prompt, (4) YOU analyze and generate description, (5) Call THIS tool with 'title' and 'description' parameters. If not provided, simple versions are auto-generated from commits/templates. NOTE: This tool does NOT include AI code review. For complete PR WITH AI review, use 'create_pr_complete' instead. This tool: analyzes branch, creates/updates PR, adds reviewers automatically. Requires GITHUB_TOKEN. Use when user asks to create a simple PR without code review.

Inputs: draft, title, language, template, +7 more.

create_pr_completeA

πŸš€ UNIFIED PR CREATION WORKFLOW - WHEN USER SAYS 'Create a PR', YOU MUST FOLLOW THESE STEPS IN ORDER: (1) Call 'generate_pr_title' β†’ get prompt, (2) YOU analyze and generate intelligent title, (3) Call 'generate_pr_description' β†’ get prompt, (4) YOU analyze and generate intelligent description, (5) Call 'review' β†’ get context/diff prompt, (6) YOU analyze and write code review, (7) Call THIS tool with 'title', 'description', and 'aiReviewText' parameters. IMPORTANT: ALL 3 parameters (title, description, aiReviewText) should be YOUR generated content, NOT the tool outputs (which are prompts). If any are omitted, simple fallbacks are auto-generated. This creates a professional PR with: YOUR intelligent title, YOUR comprehensive description, YOUR AI code review, smart GIF, automatic reviewer assignment. Works for ANY language/framework. Requires GITHUB_TOKEN.

Inputs: draft, title, language, template, +8 more.

generate_pr_completeA

Generates both a conventional commit-style PR title and a complete Pull Request description in one operation. Combines the functionality of generate_pr_title and generate_pr_description. Automatically analyzes the current Git branch from the working directory. Use this when the user wants both title and description generated together.

Inputs: language, template, baseBranch, includeStats, +1 more.

generate_pr_descriptionA

⚠️ CRITICAL: This tool returns an ANALYSIS PROMPT for YOU (Claude) to generate a description, NOT a final description. OUTPUT: You receive comprehensive context (project type, commits, files, diff sample) formatted as a detailed prompt with specific instructions. YOUR JOB: Analyze that context and generate an intelligent, well-structured PR description. The prompt includes format requirements (What/Why/How/Impact sections), language preferences (FR/EN), and style guidelines. YOU must read it, understand the changes, and write a clear description ready for GitHub. DO NOT return the prompt - generate YOUR description. Use when creating PR or when user asks for PR description. The generated description should then be passed to create_pr or create_pr_complete tools.

Inputs: title, language, template, includeStats.

generate_pr_titleA

⚠️ CRITICAL: This tool returns an ANALYSIS PROMPT for YOU (Claude) to generate a title, NOT a final title. OUTPUT: You receive comprehensive context about the code changes (commits, files, diff patterns) formatted as a prompt. YOUR JOB: Analyze that context and generate an intelligent conventional commit-style PR title (e.g., 'feat(auth): add OAuth support'). The prompt provides all the information you need to understand what changed. YOU must read it and create a concise, descriptive title that accurately reflects the changes. DO NOT return the prompt - generate YOUR title. Use when creating PR or when user asks for a PR title. The generated title should then be passed to create_pr or create_pr_complete tools.

Inputs: maxLength.

reviewA

⚠️ CRITICAL: This tool ONLY returns an ANALYSIS PROMPT for YOU (Claude), NOT a final review. OUTPUT: You receive comprehensive context (project type, diff, commits, structure) formatted as a detailed prompt with instructions. YOUR JOB: Analyze that context and generate the actual code review following the exact format specified in the prompt. The prompt includes everything you need: project context, full diff, testing framework, architecture details. YOU must read it, analyze the code changes, and write a concise review (max 10-15 lines) with sections: Summary, Critical Issues, Key Suggestions, Decision (APPROVE/REQUEST_CHANGES). DO NOT return the prompt itself - generate YOUR review. Works for ANY language/framework because context is provided. Use when user asks to review code or when creating PR with review.

Inputs: baseBranch.

suggest_reviewersA

Suggests code reviewers based on Git contribution history of modified files in the current branch. Automatically analyzes the working directory's Git repository. Use this when the user asks who should review the PR or to suggest reviewers.

Inputs: limit.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 8 tools

    Disambiguation4/5

    The tools have distinct purposes, but the similar names create_pr and create_pr_complete could confuse an agent without careful reading. The generate_* tools are clearly separated as prompt generators, and review is distinct. Detailed descriptions help, but the cognitive load is moderate.

    Naming Consistency4/5

    Most tools follow a verb_noun pattern in snake_case, e.g., create_pr, generate_pr_title. However, 'review' is a single verb without a noun, and 'suggest_reviewers' uses plural. The pattern is largely consistent with minor deviations.

    Tool Count5/5

    With 8 tools, the server covers the essential PR creation workflow (branch analysis, title/description generation, review, creation, reviewer suggestion) without being bloated or sparse. The count feels well-scoped for its purpose.

    Completeness3/5

    The server focuses on creating PRs with AI review, but lacks common PR lifecycle operations like listing, updating, merging, or commenting. For a 'pr-mcp-server', the surface is incomplete beyond the creation workflow, leaving notable gaps.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers