code-review
A Model Context Protocol (MCP) tool that automates code review and leaves comments directly on GitHub PRs, with support for Notion integration for custom review guidelines.
claude mcp add --transport stdio orcus2021-code-review-mcp-server npx -y code-review-mcp-server \ --env GITHUB_TOKEN="github_token" \ --env NOTION_API_KEY="notion_api_key" \ --env IGNORE_PATTERNS="pattern1,pattern2,pattern3" \ --env LOCAL_INSTRUCTIONS_FILE_PATH="/path/to/complete-instructions.md" \ --env NOTION_STYLE_GUIDELINE_CODE_BLOCK_URL="notion_code_block_url_here" \ --env NOTION_CODE_REVIEW_GUIDELINE_CODE_BLOCK_URL="notion_code_block_url_here"
How to use
This MCP server provides automated code review capabilities and can post comments to GitHub pull requests on behalf of MCP-enabled client applications. It offers a suite of tools to generate diffs, analyze code, and prepare review feedback, including the ability to fetch diffs from local branches, from GitHub PR URLs, or by creating new PRs. The server can combine review guidelines from a built-in default, optional Notion-based guidelines, and an optional local markdown file to tailor reviews to your project. It also supports producing line-specific PR comments or a concise PR summary, and can fetch and apply PR templates when creating new PRs. To use, configure an MCP client to call the server’s CodeReview workflow with a target repository context, then choose the appropriate tool (e.g., CodeReview, CodeReviewWithGithubUrl, GetLocalGitDiff, AddPRSummaryComment, AddPRLineComment, CreatePR).
How to install
Prerequisites:
- Node.js (v18+ recommended)
- Git installed on your system
- Optional: GitHub CLI (gh) installed and authenticated or a GitHub token for API access (GITHUB_TOKEN)
Installation steps:
-
Ensure Node.js and Git are installed. Verify with: node -v git --version
-
Install or run the MCP server via npx (no global install required): npm i -g code-review-mcp-server 2>/dev/null || true npx -y code-review-mcp-server
-
Provide required environment variables as part of your MCP configuration (see mcp_config example). Common options include:
- GITHUB_TOKEN (for GitHub API access)
- NOTION_API_KEY and NOTION_CODE_REVIEW_GUIDELINE_CODE_BLOCK_URL / NOTION_STYLE_GUIDELINE_CODE_BLOCK_URL (for Notion-guided guidelines)
- LOCAL_INSTRUCTIONS_FILE_PATH (path to a local markdown file with complete instructions)
-
If you prefer running via a package script, you can install locally and run with a script that launches the MCP server, for example in package.json: { "scripts": { "start-code-review-mcp": "npx -y code-review-mcp-server" } } Then run: npm run start-code-review-mcp
-
Verify the server starts and is reachable by your MCP-enabled client and that the configured environment variables are accessible to the running process.
Additional notes
Tips and potential issues:
- Ensure GITHUB_TOKEN has appropriate scopes for repo access if you plan to comment on PRs or create PRs.
- If you use Notion integration, make sure NOTION_API_KEY is valid and the code-block URLs point to the correct Notion <Code> blocks; if Notion data is unavailable, the server will fall back to default guidelines.
- LOCAL_INSTRUCTIONS_FILE_PATH fully replaces other instruction sources when provided; ensure the file contains complete and properly formatted markdown guidance.
- To avoid rate limits or auth issues when using GitHub API, prefer using a dedicated GitHub token or authenticated gh CLI setup.
- When integrating with Notion, understand that network access and Notion permissions are required for guideline retrieval.
- For PR operations, ensure the target repository URL context is correctly detected or explicitly provided by the MCP client.
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud