About MCP Server - Code Review
MCP Server - Code Review connects Cursor to OpenRouter for text responses and project-aware code reviews. It uses repomix for codebase analysis and detects the project's programming language.
Key features
- 01OpenRouter text responses
- 02Project-context code reviews
- 03repomix codebase analysis
- 04Automatic language detection
- 05stdio MCP server
Use cases
- 01Ask a model a text prompt
- 02Review code with project context
- 03Analyze projects across supported languages
MCP support
It provides MCP clients with `ask` and `code_review` tools, connecting to OpenRouter through stdio.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP Server - Code Review
A server implementation for the Model Context Protocol (MCP) that connects Cursor to OpenRouter API via stdio, enabling code review and AI chat functionalities.
Features
- Connects to OpenRouter API to access various large language models
- Provides two main functionalities:
- Simple text prompt responses (
asktool) - Automated code review with project context analysis (
code_reviewtool)
- Simple text prompt responses (
- Integrates with repomix for codebase packaging and analysis
- Supports multi-language project detection
- Runs as a stdio server compatible with the MCP protocol
Installation
# Install globally
npm install -g mcp-server-code-review
# Or install locally in your project
npm install mcp-server-code-review
Requirements
- Node.js v16 or higher
- OpenRouter API key - obtain one at OpenRouter
Usage
Command Line
mcp-server-code-review --api-key YOUR_OPENROUTER_API_KEY [--default-model MODEL_ID]
Options
--api-key,-k(required): Your OpenRouter API key--default-model,-m(optional): Default model to use (defaults togoogle/gemini-2.0-flash-thinking-exp:free)
Example
mcp-server-code-review --api-key sk-or-v1-xxxxxxxxxxxx --default-model anthropic/claude-3-haiku:free
MCP Tools
This server implements two main MCP tools:
1. Ask Tool
Sends a simple text prompt to OpenRouter API and returns the response.
"mcp-openrouter-stdio": {
"name": "mcp-openrouter-stdio",
"command": "npx",
"args": [
"mcp-openrouter-stdio",
"--api-key",
"sk-or-v1-your_key",
"--default-model",
"google/gemini-2.0-flash-thinking-exp:free"
],
"transport": "stdio"
},
2. Code Review Tool
Performs a code review using OpenRouter API with project context analysis.
{
name: "code_review",
arguments: {
completed_tasks: ["Task 1", "Task 2"],
work_report: "Details of the work performed",
project_path: "/absolute/path/to/project",
planned_tasks: ["Future task 1", "Future task 2"],
language: "js", // Primary language of the project
model: "optional-model-id" // Uses default if not specified
}
}
Supported Languages
The server can automatically detect and analyze projects in various programming languages:
- JavaScript/TypeScript (js)
- Python (python)
- C# (csharp)
- PHP (php)
- Java (java)
- Ruby (ruby)
- Go (go)
- Rust (rust)
- C++ (cpp)
- Swift (swift)
Development
# Clone the repository
git clone https://github.com/arahisman/mcp-server-code-review.git
cd mcp-server-code-review
# Install dependencies
npm install
# Build the project
npm run build
# Watch mode for development
npm run watch
Testing
The repository includes several test scripts:
# Basic server test
node test-mcp-server.js
# Test the ask tool
node test-ask.js
# Simple functionality test
node simple-test.js
License
MIT
Author
Adam Rahisman
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.