Claude Code Review MCP server

Provides a server for obtaining structured and freeform code reviews from OpenAI, Google, and Anthropic models with support for project context, related files, and language detection.
Back to servers
Setup instructions
Provider
Praney Behl
Release date
May 15, 2025
Language
JavaScript
Stats
10 stars

This MCP server provides a powerful tool for performing code reviews using various Large Language Models (LLMs) through the Model Context Protocol. It analyzes git diff output to deliver detailed feedback on your code changes, making it compatible with AI coding assistants like Claude Code, Cursor, Windsurf, and other MCP-compatible clients.

Prerequisites

  • Node.js: Version 18 or higher
  • Git: Must be installed and accessible in your system's PATH
  • API Keys for LLMs: You need API keys for the LLM providers you want to use:
    • GOOGLE_API_KEY for Google models
    • OPENAI_API_KEY for OpenAI models
    • ANTHROPIC_API_KEY for Anthropic models

Installation & Usage

Using with npx (Recommended)

  1. Navigate to your project:

    cd /path/to/your-git-project
    
  2. Run the MCP Server:

    npx -y @vibesnipe/code-review-mcp
    

    The server will start and display: [MCP Server] Code Reviewer MCP Server is running via stdio and connected to transport.

Installing via Smithery

To install code-review-mcp for Claude Desktop automatically:

npx -y @smithery/cli install @praneybehl/code-review-mcp --client claude

Integration with Claude Code

Once the server is running:

  1. Add as an MCP Server in Claude Code:

    claude mcp add code-reviewer -s <user|local> -e GOOGLE_API_KEY="key" -- npx -y @vibesnipe/code-review-mcp
    
  2. Use Smart Slash Commands in Claude Code:

    • Copy example commands from the examples/claude-commands/ directory to your project's .claude/commands/ directory
    • Invoke a command in Claude Code with:
      claude > /project:review-staged-claude
      

Integration with Other AI IDEs

Cursor Integration

  1. Configure Cursor's Rules for Code Review: Create or open .cursor/rules/project.mdc and add slash commands like:

    ## Slash Commands
    
    /review-staged: Use the perform_code_review tool from the code-reviewer MCP server to review staged changes. Use anthropic provider with claude-3-7-sonnet-20250219 model. Base the task description on our current conversation context and focus on code quality and best practices.
    
  2. Add the MCP Server in Cursor settings:

    "code-reviewer": {
      "command": "npx",
      "args": ["-y", "@vibesnipe/code-review-mcp"],
      "env": {
        "GOOGLE_API_KEY": "your-google-api-key",
        "OPENAI_API_KEY": "your-openai-api-key",
        "ANTHROPIC_API_KEY": "your-anthropic-api-key"
      }
    }
    

Windsurf Integration

  1. Configure the MCP Server in Windsurf:

    "code-reviewer": {
      "command": "npx",
      "args": ["-y", "@vibesnipe/code-review-mcp"],
      "env": {
        "GOOGLE_API_KEY": "your-google-api-key",
        "OPENAI_API_KEY": "your-openai-api-key",
        "ANTHROPIC_API_KEY": "your-anthropic-api-key"
      }
    }
    
  2. Create custom workflows in .windsurf/workflows/ directory

Using the Code Review Tool

perform_code_review Tool Parameters

  • target: Specifies what changes to review:
    • 'staged': Reviews only changes staged for commit
    • 'HEAD': Reviews all uncommitted changes
    • 'branch_diff': Reviews changes between a base branch/commit and current HEAD
  • taskDescription: Description of the task or feature being implemented
  • llmProvider: Select from 'google', 'openai', or 'anthropic'
  • modelName: Specific model to use (examples):
    • Google: 'gemini-2.5-pro-preview-05-06'
    • OpenAI: 'o4-mini', 'gpt-4.1', 'o3'
    • Anthropic: 'claude-3-7-sonnet-20250219'
  • reviewFocus: Optional specific areas to focus on during review
  • projectContext: Optional background about the project architecture
  • diffBase: Required if target is 'branch_diff', specifies the base branch to compare against
  • maxTokens: Optional maximum tokens for the LLM response (default: 32000)

Environment Variables

Set these in your shell or in a .env file in your project's root:

GOOGLE_API_KEY="your_google_api_key"
OPENAI_API_KEY="your_openai_api_key"
ANTHROPIC_API_KEY="your_anthropic_api_key"

Troubleshooting

  • "Current directory is not a git repository...": Run the command from the root of a Git project
  • "API key for ... is not configured": Ensure the relevant environment variable is set
  • "Failed to get git diff. Git error: ...": Check if Git is installed and properly configured
  • LLM API Errors: Check error messages from the specific LLM provider
  • MCP Integration Issues: Verify your MCP server configuration in your IDE's settings

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "code-reviewer" '{"command":"npx","args":["-y","@vibesnipe/code-review-mcp"],"env":{"GOOGLE_API_KEY":"your-google-api-key","OPENAI_API_KEY":"your-openai-api-key","ANTHROPIC_API_KEY":"your-anthropic-api-key"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "code-reviewer": {
            "command": "npx",
            "args": [
                "-y",
                "@vibesnipe/code-review-mcp"
            ],
            "env": {
                "GOOGLE_API_KEY": "your-google-api-key",
                "OPENAI_API_KEY": "your-openai-api-key",
                "ANTHROPIC_API_KEY": "your-anthropic-api-key"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

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

2. Add this to your configuration file:

{
    "mcpServers": {
        "code-reviewer": {
            "command": "npx",
            "args": [
                "-y",
                "@vibesnipe/code-review-mcp"
            ],
            "env": {
                "GOOGLE_API_KEY": "your-google-api-key",
                "OPENAI_API_KEY": "your-openai-api-key",
                "ANTHROPIC_API_KEY": "your-anthropic-api-key"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later