MCP ExplorerExplorer

Code Reviewer Mcp

@joaomjon 10 months ago
5 MIT
FreeCommunity
AI Systems
#cline#mcp-server
An MCP server who do code reviewing.

Overview

What is Code Reviewer Mcp

The Code Reviewer MCP Server is an automated code review tool integrated with GitHub, utilizing OpenRouter’s AI models to analyze pull requests for quality, style, and potential issues. It operates using the Model Context Protocol (MCP).

Use cases

This server is ideal for developers and teams looking to enhance their code quality through automated reviews of GitHub pull requests. It provides instant feedback, helping to identify coding issues, style discrepancies, and overall code improvements before merging changes.

How to use

To use the server, clone the repository, install dependencies, set environment variables for GitHub and OpenRouter API keys, build the server, and then run it. Configure the MCP client to recognize this server by specifying the appropriate command, arguments, and environment variables.

Key features

Key features include automated code reviews, detailed feedback on code quality and style, integration with OpenRouter’s AI models, comprehensive logging for debugging, and support for open pull requests. Future plans include draft PR analysis and customizable review templates.

Where to use

The Code Reviewer MCP Server can be used in any development environment that integrates with GitHub, particularly for teams practicing continuous integration and delivery. It’s compatible with MCP-compatible clients, enhancing the workflow for developers seeking automated code analysis.

Content

Code Reviewer MCP Server

A GitHub Pull Request Code Review server using Model Context Protocol

This MCP server provides automated code review capabilities for GitHub pull requests by integrating with OpenRouter’s AI models.

Features

  • Automated code reviews for GitHub pull requests
  • Detailed feedback on code quality, style and potential issues
  • Integration with OpenRouter’s AI models (currently using Gemini 2.5 Pro)
  • Comprehensive logging for debugging

Requirements

  • A GitHub Personal Access Token (PAT) with repo scope for private repositories or public_repo scope for public repositories. This PAT is required to fetch pull request data.
  • An OpenRouter API Key.

Current Limitations

⚠️ Important: Currently this server only works with:

  • Open pull requests (not draft PRs)

Installation

  1. Clone this repository:
git clone https://github.com/joaomj/code-reviewer-mcp.git
cd code-reviewer-mcp
  1. Install dependencies:
npm install
  1. Set required environment variables:
export GITHUB_PAT=your_github_personal_access_token
export OPENROUTER_API_KEY=your_openrouter_api_key
  1. Build the server:
npm run build

Usage

To start the MCP server:

node build/index.js

The server will be available to any MCP-compatible client (like Claude Desktop).

Configuration

Add to your MCP client configuration:

{
  "mcpServers": {
    "code-reviewer-mcp": {
      "command": "node",
      "args": [
        "/path/to/code-reviewer-mcp/build/index.js"
      ],
      "env": {
        "GITHUB_PAT": "your_github_token",
        "OPENROUTER_API_KEY": "your_openrouter_key"
      }
    }
  }
}

Development

For development with auto-rebuild:

npm run watch

To run tests:

npm test

Debugging

Use the built-in logging which outputs to stderr with detailed information about:

  • GitHub API requests
  • OpenRouter API calls
  • Processing steps
  • Any errors encountered

For more advanced debugging, use the MCP Inspector:

npm run inspector

Next Steps

Planned improvements and features:

  • [ ] Draft pull request analysis
  • [ ] Customizable review templates
  • [ ] Support for multiple AI models (OpenAI, Claude, etc.)
  • [ ] File-specific feedback
  • [ ] Rate limiting and caching

Contributing

Suggestions are welcome. Please open an issue first to discuss what you would like to change.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers