Claude Code Review MCP
claude-code-review-mcp
Сервер MCP (Model Context Protocol), который обеспечивает функциональность обзора кода с использованием моделей OpenAI, Google и Anthropic. Он служит инструментом «второго мнения» для обзора кода, который можно использовать с любым клиентом MCP, включая Claude Code, Claude Desktop, Cursor и Windsurf.
Функции
Поддержка нескольких поставщиков : использует модели OpenAI, Google Gemini и Anthropic Claude для проверки кода
Два типа обзора : выберите структурированный обзор (с категоризированной обратной связью) или обзор в свободной форме.
Контекстно-зависимый : включение структуры проекта, связанных файлов, сообщений о коммитах и зависимостей для более релевантных обзоров
Интеллектуальная обработка кода : автоматически определяет языки программирования, обрабатывает большие файлы и соответствующим образом форматирует вывод.
Надежная обработка ошибок : включает логику повторных попыток при сбоях API и постепенное восстановление после ошибок.
Совместимость с MCP : работает с любым клиентом MCP (Claude Code, Claude Desktop, Cursor, Windsurf)
Простая настройка : простая настройка с помощью переменных среды
Related MCP server: mcp-agent-review
Установка
Глобальная установка
npm install -g claude-code-review-mcpИспользование с npx (без установки)
# Set environment variables separately
export OPENAI_API_KEY=<key>
npx -y claude-code-review-mcp
# Or use inline environment setting
OPENAI_API_KEY=<key> npx -y claude-code-review-mcp
# Or with Google API key
GOOGLE_API_KEY=<key> npx -y claude-code-review-mcp
# Or with Anthropic API key
ANTHROPIC_API_KEY=<key> npx -y claude-code-review-mcp
# Or use multiple API keys for more model options
OPENAI_API_KEY=<key> GOOGLE_API_KEY=<key> ANTHROPIC_API_KEY=<key> npx -y claude-code-review-mcpКонфигурация
Серверу требуется как минимум один из следующих ключей API:
OPENAI_API_KEY: ваш ключ API OpenAI.GOOGLE_API_KEY: Ваш ключ API Google GeminiANTHROPIC_API_KEY: Ваш ключ API Anthropic
Дополнительная конфигурация:
PORT: Порт сервера (по умолчанию: динамический — будет выбран доступный порт)HOST: Хост сервера (по умолчанию: 127.0.0.1)LOG_LEVEL: Уровень журнала (0=DEBUG, 1=INFO, 2=WARN, 3=ERROR; по умолчанию: 1)
Доступные модели
Модели OpenAI (требуется OPENAI_API_KEY)
gpt-4.1- OpenAI GPT-4.1o4-mini- OpenAI O4 Minio3-mini- OpenAI O3 Mini
Модели Google (требуется GOOGLE_API_KEY)
gemini-2.5-pro-preview-05-06- Google Gemini 2.5 Progemini-2.5-flash-preview-04-17- Google Gemini 2.5 Flash
Антропные модели (требуется ANTHROPIC_API_KEY)
claude-3-opus-20240229- Антропный Клод 3 Опусclaude-3-sonnet-20240229- Антропный Клод 3 Сонетclaude-3-haiku-20240307- Антропный Клод 3 Хайку
Доступные инструменты
Сервер MCP предоставляет три инструмента:
1. обзорКодСтруктурированный
Предоставляет подробный структурированный обзор кода со следующими разделами:
Общее резюме
Качество кода (сильные и слабые стороны)
Ошибки (с указанием серьезности и предлагаемыми исправлениями)
Предложения по улучшению
Проблемы безопасности (если таковые имеются)
2. обзорCodeFreeform
Предоставляет повествовательный обзор кода в свободном текстовом формате, подходящий для общих впечатлений и разговорной обратной связи.
3. списокМоделей
Перечисляет все доступные модели на основе предоставленных ключей API, включая идентификаторы моделей и понятные человеку имена.
Интеграция с Клодом Кодом
Чтобы добавить этот MCP-сервер в Claude Code:
# Use environment variables properly (recommended approach)
claude mcp add code-review -s user -e OPENAI_API_KEY=<key> -e GOOGLE_API_KEY=<key> -e ANTHROPIC_API_KEY=<key> -- npx -y claude-code-review-mcp
# Alternative: Export the variables before adding the MCP
export OPENAI_API_KEY=<key>
export GOOGLE_API_KEY=<key>
export ANTHROPIC_API_KEY=<key>
claude mcp add code-review -s user -- npx -y claude-code-review-mcpВы также можете создать пользовательскую слэш-команду, создав файл по адресу .claude/commands/review-with.md :
I'll review your code using alternative LLM models. Model to use: $ARGUMENTSClaude Code поддерживает пользовательские команды слеша, которые вы можете создать для легкого взаимодействия с сервером MCP. Создайте эти команды в каталоге .claude/commands/ в вашем проекте, чтобы включить мощные рабочие процессы проверки кода.
Базовая настройка
Сначала создайте каталог команд, если его нет:
mkdir -p .claude/commandsКоманда листинга моделей
Создайте команду для вывода списка доступных моделей:
# Create the list-review-models.md file
cat > .claude/commands/list-review-models.md << 'EOF'
I'll check which alternative code review models are available through our MCP server.
First, I'll use the MCP server to list all available models for code review.
After that, I'll present the models in a clear table format with:
- Model ID (what you'll use when requesting a review)
- Provider (OpenAI or Google)
- Description (size and capabilities)
- Speed (relative performance)
This will help you choose the right model for your code review needs.
EOFБазовая команда обзора кода
Создайте простую команду обзора, которая принимает имя модели:
# Create the review-with.md file
cat > .claude/commands/review-with.md << 'EOF'
I'll review the code I've just worked on using an alternative LLM model to provide a second opinion.
First, I'll identify the code changes or file you want reviewed. If you don't specify a file, I'll look at recent changes.
Then, I'll send this code to be reviewed by the specified model through our MCP server.
Available models (run /project:list-review-models to see all options):
- OpenAI models (if configured): "gpt-4.1", "o4-mini", "o3-mini"
- Google models (if configured): "gemini-2.5-pro-preview-05-06", "gemini-2.5-flash-preview-04-17"
Model to use (leave blank for default): $ARGUMENTS
EOFКоманда структурированного обзора
Создайте команду специально для структурированных обзоров:
# Create the structured-review.md file
cat > .claude/commands/structured-review.md << 'EOF'
I'll perform a structured code review using an alternative LLM model.
This review will be organized into clear sections:
1. Overall summary
2. Code quality assessment (strengths and weaknesses)
3. Potential bugs with severity ratings (Low/Medium/High)
4. Specific improvement suggestions
5. Security considerations (if applicable)
If you don't specify a model, I'll use the default available model.
Model to use (optional): $ARGUMENTS
EOFКоманда обзора свободной формы
Создайте команду для обзоров в повествовательном стиле:
# Create the freeform-review.md file
cat > .claude/commands/freeform-review.md << 'EOF'
I'll provide a conversational, narrative-style code review using an alternative LLM model.
This will be a more holistic assessment of your code with flowing paragraphs rather than structured categories. This style works well for:
- General impressions
- High-level feedback
- More nuanced commentary on code style and approach
If you don't specify a model, I'll use the default available model.
Model to use (optional): $ARGUMENTS
EOFПросмотреть определенную команду файла
Создайте команду для просмотра определенного файла:
# Create the review-file.md file
cat > .claude/commands/review-file.md << 'EOF'
I'll review a specific file using an alternative LLM model.
Please provide the file path to review and optionally the model to use.
Format: [file_path] [model_name]
For example:
- "src/utils.js gemini-2.5-pro-preview-05-06" - Reviews utils.js with Gemini Pro
- "lib/auth.ts" - Reviews auth.ts with the default model
Input: $ARGUMENTS
EOFКоманды обзора, ориентированные на конкретные цели
Создайте команды для специализированных обзоров:
# Create security review command
cat > .claude/commands/security-review.md << 'EOF'
I'll perform a security-focused code review using an alternative LLM model.
This review will specifically examine:
- Potential security vulnerabilities
- Input validation issues
- Authentication/authorization flaws
- Data protection concerns
- Injection vulnerabilities
- Secure coding best practices
If you don't specify a model, I'll use a model recommended for security analysis.
Model to use (optional): $ARGUMENTS
EOF# Create performance review command
cat > .claude/commands/performance-review.md << 'EOF'
I'll perform a performance-focused code review using an alternative LLM model.
This review will specifically examine:
- Algorithm efficiency
- Memory usage
- Unnecessary computations
- Loop optimizations
- Data structure choices
- Caching opportunities
- Async/parallel processing considerations
If you don't specify a model, I'll use a model that's good at performance analysis.
Model to use (optional): $ARGUMENTS
EOFКоманда комплексного обзора проекта
Создайте команду для просмотра кода с полным контекстом проекта:
# Create the project-review.md file
cat > .claude/commands/project-review.md << 'EOF'
I'll perform a comprehensive code review with full project context using an alternative LLM model.
This review will:
1. Analyze the code structure and organization
2. Consider related files and dependencies
3. Evaluate consistency with project patterns
4. Assess integration with existing components
5. Check alignment with project architecture
I'll gather project context, including directory structure and related files, to ensure a thorough, context-aware review.
Format: [file_to_review] [model_name]
Example: "src/components/Button.jsx gemini-2.5-pro-preview-05-06"
Input: $ARGUMENTS
EOFДо и после команды обзора
Создайте команду для сравнения изменений кода:
# Create the diff-review.md file
cat > .claude/commands/diff-review.md << 'EOF'
I'll review the changes you've made to a file using an alternative LLM model.
This will:
1. Identify what was changed between versions
2. Evaluate if the changes address the intended purpose
3. Check for any new issues introduced
4. Suggest potential improvements to the changes
I'll need to know which file to examine. If you've been working on a file with Claude Code, I'll automatically find the changes.
Model to use (optional): $ARGUMENTS
EOFИспользование пользовательских слэш-команд
После создания этих команд вы можете использовать их в Claude Code, введя /project: и затем имя команды. Например:
/project:list-review-models
/project:review-with gemini-2.5-pro-preview-05-06
/project:structured-review o4-mini
/project:security-review
/project:review-file src/utils.js gemini-2.5-flash-preview-04-17Советы по пользовательским командам
Обнаружение команд : введите
/project:в Claude Code, чтобы увидеть список доступных команд.Модели по умолчанию : если модель не указана, команда будет использовать модель по умолчанию (обычно o4-mini, если она доступна).
Множественные обзоры : вы можете получить несколько точек зрения, проведя обзоры с использованием разных моделей.
Контекст проекта : для наиболее релевантных обзоров используйте команды, включающие контекст проекта.
Специализированный фокус : используйте команды, специфичные для фокуса, если у вас есть особые опасения по поводу безопасности, производительности и т. д.
Пример рабочего процесса
Типичный рабочий процесс может выглядеть так:
Работа над кодом с Клодом Кодом
Запустите
/project:list-review-modelsчтобы увидеть доступные варианты.Запустите
/project:structured-review gemini-2.5-pro-preview-05-06чтобы получить структурированный обзор из модели Google.Сравните с предложениями Клода
Вносите улучшения, основываясь на обеих точках зрения.
Запустите
/project:diff-review, чтобы просмотреть изменения.
Эти пользовательские команды обеспечивают плавную интеграцию между Claude Code и сервером claude-code-review-mcp, предоставляя ценные «вторые мнения» для вашего кода.
Пример использования
Запуск MCP-сервера
# Start with OpenAI API key (using exports, recommended)
export OPENAI_API_KEY=<key>
npx -y claude-code-review-mcp
# Or with inline environment variables
OPENAI_API_KEY=<key> npx -y claude-code-review-mcp
# Start with Google Gemini API key
export GOOGLE_API_KEY=<key>
npx -y claude-code-review-mcp
# Start with Anthropic Claude API key
export ANTHROPIC_API_KEY=<key>
npx -y claude-code-review-mcp
# Use multiple API keys for more model options
export OPENAI_API_KEY=<key>
export GOOGLE_API_KEY=<key>
export ANTHROPIC_API_KEY=<key>
npx -y claude-code-review-mcp
# Use custom port and host
export OPENAI_API_KEY=<key>
export PORT=8080
export HOST=0.0.0.0
npx -y claude-code-review-mcpИспользование с клиентами MCP
После запуска сервера вы можете подключиться к нему с любого клиента MCP, например Claude Code, Claude Desktop, Cursor или Windsurf, используя URL сервера. Сервер отобразит фактический URL и порт в своих журналах запуска (используя динамически назначаемый порт для избежания конфликтов).
Схема ввода
Все инструменты обзора принимают следующие входные данные:
{
code: string; // Required: The code to review
filename?: string; // Optional: The filename with extension
language?: string; // Optional: Programming language
model: string; // Required: Model ID to use for review
projectContext?: { // Optional: Additional context
projectStructure?: string; // Directory structure
relatedFiles?: Array<{ // Related code files
name: string; // Filename with path
language?: string; // File language
content: string; // File content
}>;
commitMessage?: string; // Purpose of changes
dependencies?: Record<string, string>; // Project dependencies
}
}Схема вывода
Структурированный обзорный вывод
{
review?: { // Present on success
summary: string; // Overall assessment
quality: {
strengths: string[]; // Good aspects
weaknesses: string[]; // Areas for improvement
};
bugs: Array<{
description: string; // Issue description
severity: "Low" | "Medium" | "High"; // Impact level
suggestion: string; // How to fix
}>;
improvements: string[]; // Enhancement suggestions
securityIssues?: string[]; // Security concerns if any
};
modelUsed: string; // Human-readable model name
error?: string; // Present on error
availableModels?: Record<string, string>; // Present on error or listModels
}Вывод обзора в свободной форме
{
reviewText?: string; // Present on success
modelUsed: string; // Human-readable model name
error?: string; // Present on error
availableModels?: Record<string, string>; // Present on error or listModels
}Список моделей вывода
{
availableModels: Record<string, string>; // Model ID to name mapping
modelUsed: string; // Always "None" for this tool
}Интеграция клиента MCP
Клод Код
Добавьте сервер MCP:
claude mcp add code-review -s user npx -y claude-code-review-mcpИспользование в коде Клода:
/code-review:reviewCodeStructured --model o4-miniКлод Десктоп
В настройках Claude Desktop настройте MCP следующим образом:
"claude-code-review-mcp": {
"command": "npx",
"args": ["-y", "claude-code-review-mcp"],
"env": {
"OPENAI_API_KEY": "your-openai-key",
"GOOGLE_API_KEY": "your-google-key",
"ANTHROPIC_API_KEY": "your-anthropic-key"
}
}Сервер использует расширенную очистку выходных данных JSON для полной совместимости со всеми клиентами MCP, включая Claude Desktop.
Курсор и виндсерфинг
Следуйте конкретным рекомендациям по настройке MCP для вашего клиента, используя те же команды и переменные среды.
Поиск неисправностей
Проблемы с ключами API
«Модель X недоступна» : убедитесь, что вы указали соответствующий ключ API для модели.
Ключи API не предоставлены : необходимо предоставить хотя бы один из ключей OPENAI_API_KEY, GOOGLE_API_KEY или ANTHROPIC_API_KEY.
Предлагаемая модель : сервер предложит альтернативные модели, если запрошенная вами модель недоступна.
Ограничение скорости и ошибки API
Если вы столкнулись с ограничениями скорости или ошибками API, сообщение об ошибке укажет на проблему.
Если у одного поставщика возникли проблемы, рассмотрите возможность использования другой модели.
Соображения безопасности
API-ключи никогда не регистрируются и не раскрываются.
Содержимое кода минимально протоколируется для обеспечения конфиденциальности.
Зависимости сведены к минимуму, чтобы уменьшить поверхность безопасности.
Обработка запросов включает проверку и очистку входных данных.
Сообщения об ошибках предназначены для предотвращения утечки конфиденциальной информации.
Совместимость
Требуется Node.js 18.0.0 или более поздняя версия
Работает на Linux, macOS и Windows (через WSL при необходимости)
Совместимость со всеми клиентами MCP (Claude Code, Claude Desktop, Cursor, Windsurf)
Изящная обработка больших файлов кода и контекстов проектов
Механизм автоматического повтора для временных сбоев API
Разработка
# Install dependencies
npm install
# Start in development mode
npm run dev
# Build for production
npm run build
# Start in production mode
npm run startЛицензия
Массачусетский технологический институт
Участники
Праней Бехл (@praneybehl)
Available Tools
1 toolperform_code_reviewA
Performs a code review using a specified LLM on git changes. Requires being run from the root of a git repository.
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | The git target to review (e.g., 'staged', 'HEAD', or 'branch_diff'). | |
| taskDescription | Yes | Description of the task/feature/bugfix that led to these code changes. | |
| llmProvider | Yes | The LLM provider to use (google, openai, anthropic). | |
| modelName | Yes | The specific model name from the provider (e.g., 'gemini-2.5-pro-preview-05-06', 'o4-mini', 'claude-3-7-sonnet-20250219'). | |
| reviewFocus | No | Specific areas or aspects to focus the review on (e.g., 'security vulnerabilities', 'performance optimizations', 'adherence to SOLID principles'). | |
| projectContext | No | General context about the project, its architecture, or coding standards. | |
| diffBase | No | For 'branch_diff' target, the base branch or commit SHA to compare against (e.g., 'main', 'develop', 'specific-commit-sha'). Required if target is 'branch_diff'. | |
| maxTokens | No | Maximum number of tokens to use for the LLM response. Defaults to 32000 if not specified. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. While it mentions the git repository requirement, it doesn't describe what the tool actually does behaviorally - whether it makes API calls to LLMs, what format the review output takes, whether it modifies files, or any rate limits/authentication needs. For a complex 8-parameter tool with no annotations, this is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with just two sentences that both earn their place. The first sentence states the core purpose, and the second provides essential operational context. There's zero waste or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a complex tool with 8 parameters performing code review via LLMs, the description is insufficiently complete. With no annotations, no output schema, and no behavioral details, it leaves critical gaps about what the tool actually produces, how it behaves, and what the user should expect. The description should explain the review output format and operational behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description provides no parameter-specific information beyond the git context hint. However, with 100% schema description coverage where all 8 parameters have clear descriptions in the schema itself, the baseline score of 3 is appropriate. The description doesn't add value beyond what's already documented in the structured schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with specific verbs ('performs a code review') and resources ('using a specified LLM on git changes'). It distinguishes the tool's scope by specifying it works on git changes and requires being run from a git repository root, making it highly specific even without sibling tools for comparison.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context about when to use the tool ('requires being run from the root of a git repository'), which is essential operational guidance. However, it doesn't mention when NOT to use it or suggest alternatives, which would be needed for a perfect score since there are no sibling tools to differentiate from.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
- First observed
perform_code_review
TDQS
With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined and distinct by default.
A single tool inherently has perfect naming consistency, as there are no other tools to compare it against. The name 'perform_code_review' follows a clear verb_noun pattern.
A single tool for a code review server feels thin and incomplete for the domain. While it covers the core action, typical code review workflows might include additional operations like listing reviews, commenting, or approving changes.
The server is severely incomplete for code review functionality. It only performs reviews but lacks tools for managing reviews (e.g., get, update, delete), interacting with review comments, or handling review states, which are essential for a full code review workflow.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
The OpenRouter MCP server plugs OpenRouter into the AI tools you already use. Once connected, your assistant can pull live OpenRouter data (models, prices, your credits, rankings, and docs) and send quick test messages, all without leaving your editor.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides AI-powered code review and architecture analysis, simulating the perspective of an experienced staff engineer. It integrates with IDEs to review diffs, design decisions, and tradeoffs through natural language.1MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that provides agentic code review powered by OpenAI-compatible models, designed for use with Claude Code.1MIT
- AlicenseAqualityCmaintenanceAn MCP server that enables code review by having two LLMs (Claude and GPT-4o) independently evaluate code and then synthesize their findings into a unified report.3MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for reviewing code changes using LLMs, supporting Copilot, Ollama, and OpenAI-compatible endpoints.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/praneybehl/code-review-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server