JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 39
  • Score
    100M100P100Q61881F
  • License MIT

MCP Server with Code Review

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (code-review-mcp-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    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
    • Compare code differences from GitHub pull request URLs
    • Add summary comments to GitHub pull requests
    • Add line-specific comments to GitHub pull requests
    • 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

    Prerequisites

    GitHub CLI Installation

    This tool requires the GitHub CLI to be installed globally on your machine:

    # MacOS
    brew install gh
    
    # Windows
    winget install -e --id GitHub.cli
    
    # Linux
    sudo apt install gh  # Debian/Ubuntu

    After installation, authenticate with your GitHub account:

    gh auth login

    For more installation options, visit the GitHub CLI documentation.

    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"
          }
        }
      }
    }

    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

    Local Git Branch Review

    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

    GitHub PR Review

    In the Cursor chat window, enter the following command:

    code review
    https://github.com/owner/repo/pull/123
    
    After generating the review report, please:
    
    1.  Add PR summary comment
    2.  Use **line comments** directly within the provided code to suggest specific improvements.

    This will fetch the PR's diff and provide a code review.

    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.