
mcp server code review
一个基于 MCP 协议的服务器实现,通过 stdio 连接 Cursor 和 OpenRouter API,提供代码审查和 AI 对话功能。
Repository Info
About This Server
一个基于 MCP 协议的服务器实现,通过 stdio 连接 Cursor 和 OpenRouter API,提供代码审查和 AI 对话功能。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
MCP 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
Quick Start
Clone the repository
git clone https://github.com/arahisman/mcp-server-code-reviewInstall dependencies
cd mcp-server-code-review
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.