MCP CodeReview
MCP CodeReview It is based on Model Context Protocol (MCP) The cursor/VS code plugin. It streamlines the AI code review process through a standardized MCP interface and renders review comments directly in the diff view of the IDE in the form of native comments.
Core conceptUpgrade Code Review from "casual chat" to "structured workflow".
✨ Core Features
- Protocol driven (MCP Native)Define review logic through MCP Server, decouple from IDE, and support hot plugging of different LLM backends.
- Native experience (In Diff Rendering)Say goodbye to the text stuffing in the Chat window. Review comments are directly mounted to the code line using VS Code
CommentControllerAPI implements native interaction.
- Workflow orchestrationSupport multiple review modes and targeted problem-solving:
- 🛡️ Security AuditFocus on vulnerability scanning and permission verification.
- 🚀 PerformanceFocus on algorithm complexity and resource leakage.
- 💎 IdiomaticFocus on code style, type safety, and readability.
- structured outputForce LLM to output strict JSON format to ensure zero illusion in UI rendering.
🏗️ Architecture Overview
Adopting a Client Server hybrid architecture:
graph TD
A[Cursor / VS Code] -->|MCP Protocol| B(MCP Server)
B -->|Prompt Engineering| C[LLM Provider]
C -->|Structured JSON| B
B -->|Review Data| A
A -->|VS Code API| D[Diff View Decorations]- Extension (Client)Responsible for obtaining Diff context and processing UI rendering(
vscode.comments).
- MCP ServerResponsible for Prompt management, context assembly, and Zod schema validation.
🛠️ tech stack
- Runtime: Node.js v20 LTS
- Language: TypeScript v5.4 (Strict Mode)
- Schema ValidationZod (used to ensure LLM output conforms to UI rendering structure)
- Linter: Biome
- Package Manager: pnpm (Monorepo support)
🚀 Quick Start
Pre requirements
- Node.js >= 20
- Cursor or VS code
Installation and operation
- Building MCP Server
pnpm install
pnpm run build --filter=@mcp-codereview/server- Configure cursor MCP
At the cursor MCP Add local server in the settings:
{
"mcpServers": {
"code-review": {
"command": "node",
"args": ["/path/to/packages/server/dist/index.js"]
}
}
}- Debugging plugins
press F5 Start VS Code Extension Host.
⚙️ Configuration
in .vscode/settings.json Define default process in:
{
"mcpCodeReview.defaultWorkflow": "idiomatic",
"mcpCodeReview.severityLevel": "warning"
}📝 Contribution Guide
This project strictly follows Conventional Commits and Semantic VersioningPlease run before submitting the code pnpm biome check.
