Code Review MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
npm install -g mcp-server-code-review
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add code-review -- node "<FULL_PATH_TO_MCP_SERVER_CODE_REVIEW>/dist/index.js"

Replace <FULL_PATH_TO_MCP_SERVER_CODE_REVIEW>/dist/index.js with the actual folder you prepared in step 1.

README.md

Read-Only Intelligence Provider for code reviews on GitHub and GitLab

Code Review MCP Server

An MCP server designed to act as a Read-Only Intelligence Provider for code reviews. It connects LLMs (like Claude Desktop or Gemini) to your Git hosting platforms (GitLab & GitHub) to analyze Merge/Pull Requests, understand project context, and provide expert feedback.

Features

  • Platform Agnostic: Supports both GitLab and GitHub.
  • List PRs/MRs: See what needs review.
  • Get Details: Understand the description, author, and intent.
  • Get Diff: Retrieve and analyze code changes.
  • Read Files: Fetch specific files from repositories at any ref (commit, branch, tag).
  • Custom Guidelines: Configure your own code review guidelines.

Installation & Setup

You can use this MCP server in two ways:

Option A: Global Installation (Recommended)

Install the package globally via npm:

npm install -g mcp-server-code-review

Option B: Clone & Build (For Development)

Clone the repository and build it locally:

git clone <your-repo-url> mcp-server-code-review
cd mcp-server-code-review
npm install
npm run build

Configuration

The server requires environment variables for authentication. You should add these to your MCP Client configuration (e.g., Claude Desktop).

Environment Variables

Variable Description Required For
GITLAB_TOKEN Your GitLab Personal Access Token. GitLab
GITLAB_URL GitLab instance URL (default: https://gitlab.com). GitLab (Self-Managed)
GITHUB_TOKEN Your GitHub Personal Access Token. GitHub
CODE_REVIEW_GUIDELINES_FILE Path to a file containing custom code review guidelines. Optional (Custom Rules)
CODE_REVIEW_GUIDELINES Inline custom code review guidelines text. Optional (Custom Rules)

Note: At least one of GITLAB_TOKEN or GITHUB_TOKEN must be provided. If CODE_REVIEW_GUIDELINES_FILE is set, it takes precedence over CODE_REVIEW_GUIDELINES.

MCP Server Configuration

Using Global Installation
{
  "mcpServers": {
    "code-review": {
      "command": "mcp-server-code-review",
      "env": {
        "GITLAB_TOKEN": "your_token_here",
        "GITHUB_TOKEN": "your_token_here"
      }
    }
  }
}
Using Local Clone

Replace /absolute/path/to/... with the actual full path to the project directory.

{
  "mcpServers": {
    "code-review": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-server-code-review/dist/index.js"],
      "env": {
        "GITLAB_TOKEN": "your_token_here",
        "GITHUB_TOKEN": "your_token_here"
      }
    }
  }
}
With Self-Managed GitLab
{
  "mcpServers": {
    "code-review": {
      "command": "mcp-server-code-review",
      "env": {
        "GITLAB_TOKEN": "your_token_here",
        "GITLAB_URL": "https://gitlab.yourcompany.com"
      }
    }
  }
}
With Custom Code Review Guidelines

You can provide custom guidelines either as a file path or inline text:

{
  "mcpServers": {
    "code-review": {
      "command": "mcp-server-code-review",
      "env": {
        "GITHUB_TOKEN": "your_token_here",
        "GITLAB_TOKEN": "your_token_here",
        "GITLAB_URL": "https://gitlab.yourcompany.com",
        "CODE_REVIEW_GUIDELINES_FILE": "/path/to/your/guidelines.md"
      }
    }
  }
}

Or use inline guidelines:

{
  "mcpServers": {
    "code-review": {
      "command": "mcp-server-code-review",
      "env": {
        "GITHUB_TOKEN": "your_token_here",
        "CODE_REVIEW_GUIDELINES": "Focus on performance and security. Ensure all functions have proper error handling."
      }
    }
  }
}

Claude Desktop Configuration

Add the following to your claude_desktop_config.json file.

Path locations:

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

Claude Code (CLI) Configuration

Add the following to your settings.json file for global configuration, or .claude/settings.local.json in your project directory for project-specific configuration.

Path locations (global):

  • macOS: ~/.claude/settings.json
  • Windows: %USERPROFILE%\.claude\settings.json
  • Linux: ~/.claude/settings.json

Gemini Configuration

Add the following to your settings.json file.

Path locations:

  • macOS: ~/.gemini/settings.json
  • Windows: %USERPROFILE%\.gemini\settings.json
  • Linux: ~/.gemini/settings.json

ChatGPT Configuration

Add the following to your mcp.json

Tools (4)

list_prs_mrsList pull or merge requests from the configured repository.
get_detailsRetrieve description, author, and intent of a specific pull or merge request.
get_diffRetrieve and analyze code changes for a specific pull or merge request.
read_fileFetch specific files from repositories at any ref.

Environment Variables

GITLAB_TOKENYour GitLab Personal Access Token.
GITLAB_URLGitLab instance URL (default: https://gitlab.com).
GITHUB_TOKENYour GitHub Personal Access Token.
CODE_REVIEW_GUIDELINES_FILEPath to a file containing custom code review guidelines.
CODE_REVIEW_GUIDELINESInline custom code review guidelines text.

Configuration

claude_desktop_config.json
{"mcpServers":{"code-review":{"command":"mcp-server-code-review","env":{"GITLAB_TOKEN":"your_token_here","GITHUB_TOKEN":"your_token_here"}}}}

Try it

List the open pull requests in my repository and summarize the changes in the most recent one.
Analyze the diff for PR #123 and check for potential security vulnerabilities.
Review the code changes in the latest merge request against my custom architectural guidelines.
Fetch the content of src/auth.js from the current branch and explain how it relates to the changes in the open PR.

Frequently Asked Questions

What are the key features of Code Review MCP Server?

Platform agnostic support for both GitHub and GitLab. Automated listing of pending pull and merge requests. Deep analysis of code diffs and PR metadata. Support for custom code review guidelines via file or inline text. Ability to fetch specific file contents at any commit or branch.

What can I use Code Review MCP Server for?

Automating initial code review feedback to catch logic errors before human review. Ensuring new code contributions align with project-specific architectural standards. Quickly summarizing large pull requests for faster team review cycles. Identifying security risks in incoming merge requests across multiple repositories.

How do I install Code Review MCP Server?

Install Code Review MCP Server by running: npm install -g mcp-server-code-review

What MCP clients work with Code Review MCP Server?

Code Review MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Code Review MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare