mcp-code-review
A MCP server for code reviews
claude mcp add --transport stdio crazyrabbitltc-mcp-code-review-server node build/index.js \ --env LLM_PROVIDER="OPEN_AI" \ --env GEMINI_API_KEY="your_gemini_api_key_here" \ --env OPENAI_API_KEY="your_openai_api_key_here" \ --env ANTHROPIC_API_KEY="your_anthropic_api_key_here"
How to use
This MCP server provides a dedicated code review workflow. It exposes two MCP tools: analyze_repo, which flattens and summarizes a codebase using Repomix to give you a structural, textual overview; and code_review, which runs a thorough review of the code using a chosen LLM provider (OpenAI, Anthropic, or Gemini) and returns a structured JSON with issues, severities, and actionable recommendations. You can query these tools via MCP clients to obtain either a high-level repository outline or a detailed quality assessment with focus areas such as security, performance, and maintainability. The server handles chunking for large codebases to ensure the content fits within LLM context limits, and it supports provider-specific configurations via the .env file.
To use, first ensure your .env is configured with your preferred LLM provider and API keys. Then start the MCP server and interact with it through the MCP client by invoking analyze_repo for a flattened repository view or code_review for a comprehensive code quality assessment. You can customize the review granularity and focus areas through the provided parameters (e.g., detail level, specificFiles, fileTypes, focus).
How to install
Prerequisites:
- Node.js (16.x or newer) and npm installed on your system
- Internet access to install dependencies
Step-by-step installation:
-
Clone the repository git clone https://github.com/yourusername/code-review-server.git cd code-review-server
-
Install dependencies npm install
-
Build the server npm run build
-
Configure environment variables cp .env.example .env
Edit .env to set up your preferred LLM provider and API keys
Example:
LLM_PROVIDER=OPEN_AI
OPENAI_API_KEY=your_openai_api_key_here
-
Run the MCP server node build/index.js
Optional: If you want to test the CLI tool locally: node build/cli.js <repo_path> [options]
Commands and options are documented in the README under the Usage section.
Additional notes
Tips and common considerations:
- Ensure your API keys are kept secure and not committed to source control. Use environment variables and a .env file.
- The server supports multiple LLM providers; configure OPEN_AI, ANTHROPIC, or GEMINI in .env and adjust which provider you want to use.
- For large repositories, rely on analyze_repo to flatten the structure before running a detailed code_review to reduce prompt length and improve review performance.
- If you encounter rate limits or API errors, take advantage of the retry logic described in the LLM Integration section and consider adjusting detailLevel or focus areas to fit within token limits.
- The built-in CLI (node build/cli.js) is useful for testing specific files or selectors in a controlled local environment.
- Ensure you have appropriate permissions to access the codebase you are reviewing, especially in private repositories.
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.