Code Review MCP
Runs ESLint static analysis on pull request changes and can automatically apply fixes to code
Provides integration with Figma for design-related context during code reviews
Enables comprehensive GitHub pull request review workflows including fetching PR diffs, posting inline comments, and generating detailed review reports
Integrates with Jira to fetch issue information and context related to pull requests based on branch names, titles, or descriptions
Executes Prettier code formatting checks and can automatically apply formatting fixes to pull request changes
Runs TypeScript compiler checks to validate type safety and catch compilation errors in pull request changes
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Code Review MCP review the latest PR in our repo"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Code Review MCP — Cursor-first PR reviewer
End-to-end MCP that reviews GitHub PRs using your local toolchain and Cursor’s AI. It fetches PR diffs, loads project docs, runs static/security/tests, posts inline comments (when allowed), and generates a Markdown report.
Requirements
Node.js 18+
Cursor
GitHub Personal Access Token (repo permissions) — loaded via
.env.mcpOptional tools (auto-detected; skipped if missing):
ESLint, Prettier, TypeScript (
tsc) from project devDependenciesSemgrep CLI (
pipx install semgreporbrew install semgrep)Playwright (
npm i -D @playwright/testandnpx playwright install)
Related MCP server: CodeChecker MCP
Installation
Clone this repo (or copy
tools/mcp-code-review.mjsand.mcp/code-review/into your project repo)Install Node deps in the repo:
npm ci(ornpm i)Ensure
.cursor/mcp.jsonpoints to the absolute path oftools/mcp-code-review.mjs
Example .cursor/mcp.json:
{
"mcpServers": {
"code-review": {
"command": "node",
"args": ["/absolute/path/to/tools/mcp-code-review.mjs"]
}
}
}Environment (auth)
The MCP loads only
.env.mcp(repo root) by default, or--env-file=/path/to/envRequired:
GITHUB_TOKEN=...(must have access to the target repo; SSO-authorized if org enforces it)
Optional:
JIRA_BASE_URL,JIRA_EMAIL,JIRA_API_KEYFIGMA_TOKENSEMGREP_RULES_DIR=.mcp/code-review/semgrep-rules
Project files the MCP auto-detects
Repo docs (AI context):
codebase_structure.mdandwatchouts.mdat repo rootAll
.mdunder.mcp/code-review/(e.g.,your-rules.md)
Lint/format/types:
ESLint/Prettier run from local
node_modules/.binusing your project configsTypeScript runs if
tsconfig.jsonexists
Security:
Semgrep rules from
.mcp/code-review/semgrep-rules/if present, otherwisep/ci
Tests:
Playwright runs if
playwright.config.ts/jsexists at repo root
Usage
In Cursor chat inside the target repo:
@code-review 123(auto-detect repo from git origin)@code-review owner/repo#123@code-review https://github.com/owner/repo/pull/123@code-review latest
Flags:
--env-file=/abs/path/to/.env.mcp(override default)--dry-run(skip posting/comments, still generate report)--commit-report(commit report to PR branch when permitted)--auto-fixor--auto-fix=force(apply ESLint/Prettier fixes, commit & push)--skip-static--skip-security--skip-tests--skip-figma--semgrep-rules-dir=/path/to/rules(override rules)--max-diff-chars=20000--max-file-hunks=10--verbose
Outputs:
Logs:
mcp-logs/(per-run files)Artifacts:
mcp-artifacts/<owner>-<repo>-PR<#>-<ts>/Report:
mcp-reports/code-review-<owner>-<repo>-PR<#>-<ts>.md
Notes:
If the authenticated user is the PR author, GitHub may reject review posting; the MCP will skip comments but still write the report (see Pipeline Status in the report).
Older logs/reports (>1 day) are pruned, and only the latest report for a PR is kept.
Sub-tools (advanced)
You can call focused tools directly:
@github.resolve_pr { prId: "owner/repo#123" }@github.fetch_files { owner: "owner", repo: "repo", pull_number: 123 }@jira.fetch { prMeta: { title: "...", body: "...", branch: "..." } }@analysis.run_static { files: ["src/..."], runTsc: true }@security.run_semgrep {}@tests.run_playwright {}@report.generate {...}@cleanup.prune { owner:"owner", repo:"repo", pull_number:123 }
CI recommendations
Run the same tools in CI for consistent enforcement:
ESLint:
npx eslint . --max-warnings=0Prettier:
npx prettier --check .Semgrep:
pipx install semgrep && semgrep --config .mcp/code-review/semgrep-rules --error -- .Playwright:
npx playwright install --with-deps && npx playwright test --reporter=line
Troubleshooting
Bad credentials: ensure
.env.mcpis present and logs showAuth loaded from .env.mcp:.... Verify PAT:curl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/user→ must be 200.Jira skipped: ensure Jira key in PR branch/title/body, and
JIRA_*are set.Semgrep skipped: install CLI or set rules dir.
Playwright skipped: add
playwright.config.*and install browsers.
For platform-specific setup (macOS/Windows), see docs/Platform-Setup.md.
Available Tools
9 toolsanalysis.run_staticRun StaticC
Run ESLint/tsc/Prettier on files
Inputs: files (required), runPrettier, runTsc.
cleanup.prunePrune ArtifactsC
Prune old logs and reports
Inputs: owner (required), pull_number (required), repo (required).
code-reviewAI Code ReviewC
Run an AI-powered code review for a GitHub PR. Usage: @code-review [prId] [--flags]
Inputs: aiOutput, options, prId.
github.fetch_filesFetch PR FilesC
Fetch files/diff for a PR
Inputs: owner (required), pull_number (required), repo (required).
github.resolve_prResolve PRD
Resolve owner/repo and PR number from an input
Inputs: prId (required), options.
jira.fetchFetch JiraC
Fetch Jira tickets by keys or from prMeta
Inputs: keys, options, prMeta.
report.generateGenerate ReportC
Generate a code review report markdown
Inputs: owner (required), prUrl (required), pull_number (required), repo (required), +6 more.
security.run_semgrepRun SemgrepD
Run Semgrep scan
Inputs: files, rulesDir.
tests.run_playwrightRun PlaywrightD
Run Playwright tests
Inputs: full, grep.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Most tools have distinct purposes, such as static analysis, security scanning, and test running, but there is some potential overlap between 'analysis.run_static' and 'security.run_semgrep' as both involve code analysis, which could cause confusion. The descriptions help clarify their focuses, but the boundaries are not perfectly clear.
The naming conventions are inconsistent, mixing dot notation (e.g., 'analysis.run_static'), hyphenated names (e.g., 'code-review'), and snake_case (e.g., 'github.fetch_files'). There is no uniform pattern, making the set less predictable and harder for agents to parse reliably.
With 9 tools, the count is well-scoped for a code review server, covering key areas like analysis, security, testing, reporting, and integration with GitHub and Jira. Each tool appears to serve a specific function without redundancy, fitting the domain appropriately.
The toolset covers core code review workflows, including fetching PR data, running analyses, generating reports, and integrating with external systems. A minor gap is the lack of tools for managing or updating review comments or statuses, but agents can work around this with the existing tools.
Related MCP Connectors
AI code review for GitHub PRs with an MCP autofix loop for Claude Code and Cursor
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
AI code governance and code review for Claude Code, Copilot and Cursor. Checks rules and security.
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn AI-powered development toolkit for Cursor providing intelligent coding assistance through advanced reasoning, UI screenshot analysis, and code review tools.339MIT
- FlicenseNot gradedqualityDmaintenanceA code review tool for Cursor IDE that uses OpenAI's GPT models to provide intelligent code analysis and suggestions.3-
- AlicenseNot gradedqualityDmaintenanceA Cursor-compatible toolkit that provides intelligent coding assistance through custom AI tools for code architecture planning, screenshot analysis, code review, and file reading capabilities.13MIT
- AlicenseNot gradedqualityDmaintenanceA server that integrates with Cursor IDE to provide code review functionality for Azure repositories, enabling AI-powered pull request analysis and feedback.2ISC