code-review-mcp
Local MCP server for Cursor that analyzes code, finds bugs, generates tests and documentation via OpenRouter.
README
code-review-mcp
Локальный MCP-сервер для Cursor: анализ кода, поиск багов, генерация тестов и документации через OpenRouter.
1. Prerequisites
- Python 3.10+
- Cursor IDE
- OpenRouter API key: https://openrouter.ai/keys
2. Installation
git clone <repo>
cd <ABSOLUTE_PATH_TO_PROJECT>
python -m venv .venv
.venv\Scripts\activate # Windows
pip install -r requirements.txt
Copy-Item .env.example .env
# вписать OPENROUTER_API_KEY в .env
Если вы используете не PowerShell, можно просто скопировать .env.example в .env любым удобным способом.
3. Cursor Integration
Подключить сервер можно двумя способами.
Способ A — через глобальный конфиг Cursor:
Файл конфигурации находится по пути %APPDATA%\Cursor\User\globalStorage\cursor.mcp\mcp.json.
Способ B — через .cursor/mcp.json в корне проекта (рекомендуемый):
{
"mcpServers": {
"code-review-mcp": {
"command": "<ABSOLUTE_PATH_TO_PROJECT>\\.venv\\Scripts\\python.exe",
"args": [
"<ABSOLUTE_PATH_TO_PROJECT>\\server.py"
],
"env": {
"OPENROUTER_API_KEY": "<YOUR_OPENROUTER_API_KEY>"
}
}
}
}
Используйте только абсолютные пути. В Windows обратные слеши в JSON нужно писать как \\.
4. Verification
- Откройте
Cursor Settings -> MCPи убедитесь, чтоcode-review-mcpвиден со статусомconnected. - В чате Cursor отправьте:
Use review_bugs tool on this code: def foo(): pass - Ожидаемый результат: структурированный Markdown-ответ в чате без падения сервера.
5. Available Tools
| Tool | Description | Key params |
|---|---|---|
review_bugs |
Find logical bugs | focus |
review_quality |
Code readability & style | focus |
review_security |
Security vulnerabilities | focus |
review_performance |
Performance bottlenecks | focus |
generate_tests |
Generate unit/integration tests | test_framework, test_style |
explain_code |
Explain code | audience (junior/middle/senior) |
refactor_code |
Suggest refactoring | goal |
full_review |
Combined 4-section review | — |
generate_docs |
Generate docstrings | doc_style |
Models
По умолчанию модель задаётся в config.py через DEFAULT_MODEL, FAST_MODEL и STRONG_MODEL.
Любой tool также принимает аргумент model, поэтому при вызове можно явно передать любую OpenRouter-совместимую модель, если нужен другой баланс цены, скорости и качества.
6. Troubleshooting
ValueError: OPENROUTER_API_KEY is required— проверьте.envили секциюenvвmcp.json.- Cursor не видит сервер — проверьте, что в конфиге указаны абсолютные пути и они ведут к существующим файлам.
- Ответ приходит слишком долго или упирается в таймаут — попробуйте более быструю или более доступную OpenRouter-модель через аргумент
modelу tool-вызова.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.