Token导航 LogoToken导航TokenDH.com
pr MCP logo
开发工具未说明官方级别未说明来源级核验

pr MCP

MCP Server

PR AI - MCP Server 是一个AI驱动的GitHub PR创建工具,专为Cursor、Claude Desktop等MCP兼容编辑器设计,实现无缝PR创建体验。

工具数

5

提示词数

0

GitHub Stars

1

资源数

0
JavaScriptClaude开发工具Claude DesktopClaudeCursorWindsurf

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

haidoan

提供方

haidoan

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

PR AI-MCP服务器

基于人工智能的GitHub公关创建 光标, 克劳德桌面, 帆板运动,以及其他MCP兼容编辑器。

为什么选择MCP?

与手动运行命令的CLI版本不同,MCP服务器允许您的AI IDE 直接 创建PR:

You: "Create a PR for my changes"
Cursor: [analyzes diff, generates description, creates PR]
        ✅ PR created: https://github.com/you/repo/pull/42

禁止复制/粘贴。禁止切换窗口。问吧。

快速安装

# Clone and install
git clone https://github.com/USER/pr-ai-mcp.git
cd pr-ai-mcp
npm install

# Or install globally
npm install -g pr-ai-mcp

光标设置

添加到光标MCP配置(~/.cursor/mcp.json 或项目 .cursor/mcp.json):

{
  "mcpServers": {
    "pr-ai": {
      "command": "node",
      "args": ["/path/to/pr-ai-mcp/src/index.js"]
    }
  }
}

或者通过npm全局安装:

{
  "mcpServers": {
    "pr-ai": {
      "command": "npx",
      "args": ["pr-ai-mcp"]
    }
  }
}

重新启动游标 添加配置后。

Claude桌面设置

添加到Claude桌面配置:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json 窗户: %APPDATA%\Claude\claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "pr-ai": {
      "command": "node",
      "args": ["/path/to/pr-ai-mcp/src/index.js"]
    }
  }
}

Windsurf设置/继续/其他

大多数MCP兼容编辑器使用类似的配置。使用以下命令添加服务器:

  • 命令: node (或 npx)
  • Args:路径 src/index.js (或 pr-ai-mcp 如果通过npm安装)

可用工具

工具说明
analyze_changes分析git diff、提交、更改的文件
generate_pr_description获取AI生成PR描述的上下文
create_pr创建GitHub PR
preview_pr预览PR而不创建
get_repo_config显示.pr-ai.json设置

使用示例

基础公关创建

You: Create a PR for my changes

AI: I'll analyze your changes and create a PR.
    [calls analyze_changes]
    [calls create_pr with generated description]
    
    ✅ PR Created!
    Title: [TK-1234] add user authentication
    URL: https://github.com/you/repo/pull/42

具有特定选项

You: Create a draft PR targeting main, add @alice as reviewer

AI: [calls create_pr with draft=true, target=main, reviewers=alice]
    ✅ Draft PR created...

先预览

You: Show me what the PR would look like

AI: [calls preview_pr]
    ## PR Preview
    Title: [TK-1234] add user auth
    Branch: feature/tk-1234-auth → develop
    ...

分析变化

You: What changes am I about to PR?

AI: [calls analyze_changes]
    ## Git Analysis
    Commits: 3
    - abc123 add login endpoint
    - def456 add auth middleware
    - ghi789 add tests
    ...

每回购配置(可选)

创建 .pr-ai.json 在您的repo根目录中:

{
  "reviewers": ["alice", "bob"],
  "targetBranch": "main",
  "draft": false,
  "customPrompt": "Focus on security implications",
  "excludeFiles": ["package-lock.json"]
}

MCP服务器会自动读取并应用:

  • 默认审阅者
  • 默认目标分支
  • 自定义AI指令
  • 默认情况下起草PR

需求

  • Node.js>=18
  • GitHub命令行界面(gh)已安装并验证
  • 使用GitHub远程的Git存储库

运作原理

┌─────────────────┐
│   Your IDE      │
│ (Cursor/Claude) │
└────────┬────────┘
         │ MCP Protocol
         ▼
┌─────────────────┐
│  PR AI Server   │
│  (this tool)    │
└────────┬────────┘
         │ Git + GitHub CLI
         ▼
┌─────────────────┐
│    GitHub       │
└─────────────────┘
  1. 你让你的人工智能创建一个PR
  2. AI调用MCP工具分析变化
  3. AI基于差异生成描述
  4. AI呼叫 create_pr 工具
  5. 服务器使用 gh CLI创建PR
  6. 您将获得PR URL

比较:CLI与MCP

特性CLI(pr-ai)MCP服务器
用法在终端中运行命令在IDE中询问AI
AI提供商Claude/Gemini/OpenAI API您的IDE的AI
API密钥必需不需要(使用IDE)
集成手动无缝
最适合终端用户IDE用户

故障排除

光标中“找不到工具”

  1. 检查MCP配置路径是否正确
  2. 完全重新启动游标
  3. 检查Cursor的MCP日志

“不在git存储库中”

确保您从git存储库打开了一个文件,或指定 working_directory.

“gh:找不到命令”

安装GitHub命令行界面:https://cli.github.com/

然后进行身份验证: gh auth login

PR创建失败

检查:

# Is gh authenticated?
gh auth status

# Can you create PR manually?
gh pr create --help

许可证

麻省理工学院

pr mcp

目录标签

目录标签

JavaScriptClaude开发工具GitHubPR本地部署AI自动化代码协作IDE集成

支持客户端

Claude DesktopClaudeCursorWindsurf

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

session

工具数量(toolCount,工具数)

5

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明session部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP