CodeRabbit MCP Server

CodeRabbit MCP Server

Enables LLMs to retrieve, analyze, and programmatically implement CodeRabbit AI code review suggestions on GitHub pull requests, with automated workflows for processing and resolving review comments.

Category
访问服务器

README

CodeRabbit MCP Server

A Model Context Protocol (MCP) server for interacting with CodeRabbit AI reviews on GitHub pull requests. This server enables Large Language Models (LLMs) to analyze, understand, and implement CodeRabbit suggestions programmatically.

Features

  • Get CodeRabbit Reviews: Retrieve all CodeRabbit reviews for a specific pull request
  • Review Details: Get detailed information about specific reviews including configuration and files reviewed
  • Extract Comments: Get individual line comments with AI prompts and suggestions
  • Comment Details: Deep dive into specific comments with context and fix examples
  • Resolve Comments: Mark comments as addressed, won't fix, or not applicable
  • Automated Workflow Prompt: Use /coderabbit-review slash command for complete review processing

Quick Start

Installation (NPX - Recommended)

No installation required! Run directly with npx:

# Install the latest stable version explicitly
npx coderabbitai-mcp@latest

Prerequisites

  1. GitHub Personal Access Token: Create at https://github.com/settings/tokens
    • Required scopes: repo (for private repos) or public_repo (for public only)
  2. Node.js 18+: Required for running the server

Configuration

Claude Desktop Configuration

To use the CodeRabbit MCP server in Claude Desktop, add it to your configuration file:

Configuration file locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Step-by-step setup:

  1. Open your Claude Desktop configuration file (create it if it doesn't exist)
  2. Add the CodeRabbit MCP server configuration:
{
  "mcpServers": {
    "coderabbitai": {
      "command": "npx",
      "args": ["coderabbitai-mcp@latest"],
      "env": {
        "GITHUB_PAT": "ghp_your_token_here"
      }
    }
  }
}
  1. Replace ghp_your_token_here with your actual GitHub Personal Access Token
  2. Save the file and restart Claude Desktop

Claude Code Configuration

To use the CodeRabbit MCP server in Claude Code, configure it in your project:

Step-by-step setup:

  1. Create a .claude directory in your project root (if it doesn't exist):

    mkdir .claude
    
  2. Create or edit .claude/config.json:

{
  "mcpServers": {
    "coderabbitai": {
      "command": "npx",
      "args": ["coderabbitai-mcp@latest"],
      "env": {
        "GITHUB_PAT": "ghp_your_token_here"
      }
    }
  }
}
  1. Replace ghp_your_token_here with your actual GitHub Personal Access Token
  2. The server will be available next time you start Claude Code in this project

Pro tip: For security, you can use environment variables instead of hardcoding the token:

{
  "mcpServers": {
    "coderabbitai": {
      "command": "npx",
      "args": ["coderabbitai-mcp@latest"],
      "env": {
        "GITHUB_PAT": "${GITHUB_PAT}"
      }
    }
  }
}

Then set the GITHUB_PAT environment variable in your shell before starting Claude Code.

Usage

Automated Review Processing (Recommended)

Use the built-in MCP prompt for complete workflow automation:

/coderabbit-review owner:bradthebeeble repo:wiseguys pullNumber:15

This prompt automatically:

  • Finds and analyzes CodeRabbit reviews
  • Classifies issues by priority (high/medium/low)
  • Gets your approval before making changes
  • Systematically implements fixes
  • Marks resolved comments in CodeRabbit
  • Provides a completion summary

Manual Tool Usage

<details> <summary>Available Tools</summary>

1. get_coderabbit_reviews

Get all CodeRabbit reviews for a specific pull request.

{
  "owner": "bradthebeeble",
  "repo": "wiseguys", 
  "pullNumber": 15
}

2. get_review_details

Get detailed information about a specific CodeRabbit review.

{
  "owner": "bradthebeeble",
  "repo": "wiseguys",
  "pullNumber": 15,
  "reviewId": 2969007538
}

3. get_review_comments

Get all individual line comments from CodeRabbit reviews.

{
  "owner": "bradthebeeble",
  "repo": "wiseguys",
  "pullNumber": 15,
  "reviewId": 2969007538
}

4. get_comment_details

Get detailed information about a specific CodeRabbit comment.

{
  "owner": "bradthebeeble",
  "repo": "wiseguys",
  "commentId": 2173534099
}

5. resolve_comment

Mark a CodeRabbit comment as resolved.

{
  "owner": "bradthebeeble", 
  "repo": "wiseguys",
  "commentId": 2173534099,
  "resolution": "addressed",
  "note": "Implemented asyncHandler wrapper as suggested"
}

</details>

<details> <summary>Development Installation</summary>

For development or local customization:

git clone https://github.com/bradthebeeble/coderabbitai-mcp.git
cd coderabbitai-mcp
npm install
npm run build

Development Commands

# Build TypeScript
npm run build

# Watch mode for development
npm run dev

# Clean build files
npm run clean

# Test the server
npm test

</details>

<details> <summary>Environment Variables</summary>

Create a .env file (optional):

# GitHub Configuration (shorter variable name)
GITHUB_PAT=ghp_your_token_here

# Optional: CodeRabbit MCP Configuration
CODERABBIT_LOG_LEVEL=info

</details>

<details> <summary>Troubleshooting</summary>

Common Issues

Server not loading (NPX):

  • Verify Node.js 18+ is installed: node --version
  • Test npx execution manually: npx coderabbitai-mcp
  • Check your internet connection (npx downloads the latest version)

GitHub API errors:

  • Verify your GitHub token has the required permissions
  • Check that you have access to the repositories you're querying

No CodeRabbit reviews found:

  • Verify the PR has CodeRabbit reviews (check GitHub web interface)
  • Ensure you're using the correct owner/repo/pullNumber

Debug Mode

Enable debug logging:

CODERABBIT_LOG_LEVEL=debug npx coderabbitai-mcp

</details>

Integration Requirements

Supported AI Clients

  • Claude Desktop: Full support with configuration
  • Claude Code: Project-level MCP integration with /coderabbit-review prompt
  • Other MCP Clients: Any client supporting the Model Context Protocol

Authentication

The GitHub Personal Access Token needs these permissions:

  • repo (for private repositories) or public_repo (for public only)
  • read:org (if accessing organization repositories)

Architecture

  • TypeScript: Fully typed implementation with Zod validation
  • MCP SDK: Built on the official Model Context Protocol SDK
  • Modular Design: Each tool is implemented in its own module
  • MCP Prompts: Automated workflows available as slash commands

API Rate Limits

The server respects GitHub's API rate limits:

  • 5,000 requests/hour for authenticated requests
  • Automatically handles rate limit responses

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes and add tests
  4. Run the build: npm run build
  5. Submit a pull request

License

MIT

Support

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选