pr-mcp-server

pr-mcp-server

MCP server to automate Pull Request creation with AI. Analyzes Git branches, generates descriptions, titles, suggests reviewers, and performs code reviews.

Category
访问服务器

README

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

📚 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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选