Code Review MCP Tool for Cursor

Code Review MCP Tool for Cursor

Orcus2021

Developer Tools
Visit Server

README

Code Review MCP Tool for Cursor

This tool is a Cursor plugin based on the Model Context Protocol (MCP) that automatically generates git diffs and performs code reviews within Cursor.

Features

  • Compare code differences between two git branches
  • Provide detailed code review guidelines
  • Support Notion integration to retrieve review guidelines from Notion code blocks, with default guidelines as fallback
  • Include pre-configured style and code review guidelines

Cursor Configuration

To use this tool in Cursor, you need to add the following configuration to your Cursor settings:

  1. Open Cursor settings (typically located at ~/.cursor/config.json)
  2. Add the following configuration:
{
  "mcpServers": {
    "code-review-tool": {
      "command": "npx",
      "args": ["-y", "code-review-mcp-server"],
      "env": {
        "NOTION_API_KEY": "notion_api_key",
        "NOTION_CODE_REVIEW_GUIDELINE_CODE_BLOCK_URL": "notion_code_block_url_here",
        "NOTION_STYLE_GUIDELINE_CODE_BLOCK_URL": "notion_code_block_url_here"
      }
    }
  }
}

Enhancing AI Tool Usage with Cursor Rules

For optimal integration with Cursor's AI assistant, we recommend adding the following rule to your Cursor Rules:

Tools
- Whenever the terms 'code review' and 'base branch' appear in the chat, utilize the codeReview MCP tool to generate a diff and associated instructions. Subsequently, use the generated diff and instructions to conduct a thorough code review of the files of the proposed changes.

This rule instructs the AI to automatically utilize the Code Review MCP tool when relevant keywords are detected in your conversations, significantly enhancing workflow efficiency.

Reference documentation: Cursor Model Context Protocol

Notion Integration Setup

1. Request Notion API Token

  1. Visit Notion Developers
  2. Create a new Integration
  3. Obtain the API token

For detailed instructions, refer to: Notion API Authorization Guide

2. Configure Environment Variables

The tool requires the following environment variables:

NOTION_API_KEY=your_token_here
NOTION_CODE_REVIEW_GUIDELINE_CODE_BLOCK_URL=your_notion_code_block_url
NOTION_STYLE_GUIDELINE_CODE_BLOCK_URL=your_notion_style_guideline_url

These can be provided in the env section of your Cursor configuration as shown above.

3. Add Integration to Notion Page

  1. Click the Share button on your Notion page
  2. Add your Integration to the page's share list

Note: Currently only supports reading code blocks from Notion

For detailed instructions, refer to: Notion API Connections Guide

Usage

In the Cursor chat window, enter the following command:

code review
base branch: branch/any_branch

This will:

  1. Compare differences between the current branch and the specified base branch
  2. Automatically generate a git diff
  3. Perform a review based on style and code review guidelines
  4. Provide detailed review results and improvement suggestions

Review Guidelines

This tool provides two default sets of guidelines:

  1. Style Guide: Includes code style standards for variable naming, function naming, constant naming, etc.
  2. Code Review Guidelines: Includes code quality standards based on SOLID principles, readability, immutability, etc.

You can also customize these guidelines through Notion integration.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
mermaid-mcp-server

mermaid-mcp-server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.

Featured
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python