Skip to main content
Glama
praneybehl

Claude Code Review MCP

by praneybehl

Claude-Code-Review-MCP

Ein MCP-Server (Model Context Protocol), der Codeüberprüfungsfunktionen mit OpenAI-, Google- und anthropischen Modellen bereitstellt. Er dient als Tool für die „Zweitmeinung“ zur Codeüberprüfung und kann mit jedem MCP-Client verwendet werden, einschließlich Claude Code, Claude Desktop, Cursor und Windsurf.

Merkmale

  • Multi-Provider-Support : Nutzt OpenAI, Googles Gemini und Anthropics Claude-Modelle für Code-Überprüfungen

  • Zwei Bewertungsarten : Wählen Sie zwischen einer strukturierten Bewertung (mit kategorisiertem Feedback) oder einer frei formulierten narrativen Bewertung

  • Kontextbewusst : Fügen Sie Projektstruktur, zugehörige Dateien, Commit-Nachrichten und Abhängigkeiten für relevantere Überprüfungen ein

  • Intelligente Codeverarbeitung : Erkennt automatisch Programmiersprachen, verarbeitet große Dateien und formatiert die Ausgabe entsprechend

  • Robuste Fehlerbehandlung : Enthält Wiederholungslogik für API-Fehler und eine reibungslose Fehlerbehebung

  • MCP-kompatibel : Funktioniert mit jedem MCP-Client (Claude Code, Claude Desktop, Cursor, Windsurf)

  • Einfache Einrichtung : Einfache Konfiguration über Umgebungsvariablen

Related MCP server: mcp-agent-review

Installation

Globale Installation

npm install -g claude-code-review-mcp

Nutzung mit npx (keine Installation)

# 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

Konfiguration

Der Server benötigt mindestens einen der folgenden API-Schlüssel:

  • OPENAI_API_KEY : Ihr OpenAI-API-Schlüssel

  • GOOGLE_API_KEY : Ihr Google Gemini API-Schlüssel

  • ANTHROPIC_API_KEY : Ihr Anthropischer API-Schlüssel

Optionale Konfiguration:

  • PORT : Server-Port (Standard: dynamisch – ein verfügbarer Port wird ausgewählt)

  • HOST : Server-Host (Standard: 127.0.0.1)

  • LOG_LEVEL : Protokollebene (0=DEBUG, 1=INFO, 2=WARN, 3=FEHLER; Standard: 1)

Verfügbare Modelle

OpenAI-Modelle (erfordert OPENAI_API_KEY)

  • gpt-4.1 – OpenAI GPT-4.1

  • o4-mini - OpenAI O4 Mini

  • o3-mini - OpenAI O3 Mini

Google Models (erfordert GOOGLE_API_KEY)

  • gemini-2.5-pro-preview-05-06 - Google Gemini 2.5 Pro

  • gemini-2.5-flash-preview-04-17 - Google Gemini 2.5 Flash

Anthropische Modelle (erfordert ANTHROPIC_API_KEY)

  • claude-3-opus-20240229 - Anthropischer Claude 3 Opus

  • claude-3-sonnet-20240229 - Anthropisches Claude 3 Sonett

  • claude-3-haiku-20240307 - Anthropisches Claude 3 Haiku

Verfügbare Tools

Der MCP-Server bietet drei Tools:

1. überprüfenCodeStrukturiert

Bietet eine detaillierte, strukturierte Codeüberprüfung mit den folgenden Abschnitten:

  • Gesamtzusammenfassung

  • Codequalität (Stärken und Schwächen)

  • Fehler (mit Schweregrad und vorgeschlagenen Korrekturen)

  • Verbesserungsvorschläge

  • Sicherheitsprobleme (falls vorhanden)

2. reviewCodeFreeform

Bietet eine narrative Codeüberprüfung im Freitextformat, geeignet für allgemeine Eindrücke und Gesprächsfeedback.

3. listModels

Listet alle verfügbaren Modelle basierend auf den bereitgestellten API-Schlüsseln auf, einschließlich Modell-IDs und für Menschen lesbarer Namen.

Integration mit Claude Code

So fügen Sie diesen MCP-Server zu Claude Code hinzu:

# 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

Sie können auch einen benutzerdefinierten Schrägstrichbefehl erstellen, indem Sie eine Datei unter .claude/commands/review-with.md erstellen:

I'll review your code using alternative LLM models. Model to use: $ARGUMENTS

Claude Code unterstützt benutzerdefinierte Slash-Befehle, die Sie für die einfache Interaktion mit dem MCP-Server erstellen können. Erstellen Sie diese Befehle im Verzeichnis .claude/commands/ Ihres Projekts, um leistungsstarke Codeüberprüfungs-Workflows zu ermöglichen.

Grundlegende Einrichtung

Erstellen Sie zunächst das Befehlsverzeichnis, falls es noch nicht vorhanden ist:

mkdir -p .claude/commands

Befehl „Modellauflistung“

Erstellen Sie einen Befehl zum Auflisten verfügbarer Modelle:

# 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

Grundlegender Codeüberprüfungsbefehl

Erstellen Sie einen einfachen Überprüfungsbefehl, der einen Modellnamen akzeptiert:

# 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

Befehl zur strukturierten Überprüfung

Erstellen Sie einen Befehl speziell für strukturierte Überprüfungen:

# 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

Befehl „Freiformüberprüfung“

Erstellen Sie einen Befehl für Rezensionen im narrativen Stil:

# 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

Befehl „Spezifische Datei überprüfen“

Erstellen Sie einen Befehl zum Überprüfen einer bestimmten Datei:

# 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

Fokusspezifische Überprüfungsbefehle

Erstellen Sie Befehle für spezielle Überprüfungen:

# 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

Umfassender Projektüberprüfungsbefehl

Erstellen Sie einen Befehl zum Überprüfen von Code mit vollständigem Projektkontext:

# 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

Befehl „Vorher- und Nachher-Überprüfung“

Erstellen Sie einen Befehl zum Vergleichen von Codeänderungen:

# 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

Verwenden benutzerdefinierter Schrägstrichbefehle

Sobald Sie diese Befehle erstellt haben, können Sie sie in Claude Code verwenden, indem Sie /project: gefolgt vom Befehlsnamen eingeben. Beispiel:

/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

Tipps für benutzerdefinierte Befehle

  • Befehlserkennung : Geben Sie /project: in Claude Code ein, um eine Liste der verfügbaren Befehle anzuzeigen

  • Standardmodelle : Wenn Sie kein Modell angeben, verwendet der Befehl das Standardmodell (normalerweise o4-mini, falls verfügbar).

  • Mehrere Bewertungen : Sie können mehrere Perspektiven erhalten, indem Sie Bewertungen mit verschiedenen Modellen durchführen

  • Projektkontext : Für die relevantesten Überprüfungen verwenden Sie Befehle, die den Projektkontext enthalten

  • Spezialisierter Fokus : Verwenden Sie die fokusspezifischen Befehle, wenn Sie besondere Bedenken hinsichtlich Sicherheit, Leistung usw. haben.

Beispiel-Workflow

Ein typischer Arbeitsablauf könnte folgendermaßen aussehen:

  1. Arbeiten Sie mit Claude Code an Code

  2. Führen Sie /project:list-review-models aus, um die verfügbaren Optionen anzuzeigen

  3. Führen Sie /project:structured-review gemini-2.5-pro-preview-05-06 aus, um eine strukturierte Überprüfung vom Google-Modell zu erhalten

  4. Vergleichen Sie mit Claudes Vorschlägen

  5. Nehmen Sie Verbesserungen auf der Grundlage beider Perspektiven vor

  6. Führen Sie /project:diff-review aus, um die Änderungen zu überprüfen

Diese benutzerdefinierten Befehle ermöglichen eine reibungslose Integration zwischen Claude Code und dem Claude-Code-Review-MCP-Server und bieten wertvolle „Zweitmeinungen“ für Ihren Code.

Beispielverwendung

Starten des MCP-Servers

# 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

Verwendung mit MCP-Clients

Sobald der Server läuft, können Sie sich von jedem MCP-Client wie Claude Code, Claude Desktop, Cursor oder Windsurf über die Server-URL mit ihm verbinden. Der Server zeigt die aktuelle URL und den Port in seinen Startprotokollen an (um Konflikte zu vermeiden, wird ein dynamisch zugewiesener Port verwendet).

Eingabeschema

Alle Überprüfungstools akzeptieren die folgenden Eingaben:

{
  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
  }
}

Ausgabeschema

Strukturierte Überprüfungsausgabe

{
  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
}

Freiform-Überprüfungsausgabe

{
  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
}

Ausgabe der Listenmodelle

{
  availableModels: Record<string, string>;  // Model ID to name mapping
  modelUsed: string;  // Always "None" for this tool
}

MCP-Client-Integration

Claude Code

  1. Fügen Sie den MCP-Server hinzu:

claude mcp add code-review -s user npx -y claude-code-review-mcp
  1. Verwendung im Claude-Code:

/code-review:reviewCodeStructured --model o4-mini

Claude Desktop

Konfigurieren Sie das MCP in den Claude Desktop-Einstellungen wie folgt:

"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"
  }
}

Der Server verwendet eine erweiterte JSON-Ausgabebereinigung für die vollständige Kompatibilität mit allen MCP-Clients, einschließlich Claude Desktop.

Cursor und Windsurf

Befolgen Sie die spezifischen MCP-Konfigurationsrichtlinien für Ihren Client und verwenden Sie dieselben Befehle und Umgebungsvariablen.

Fehlerbehebung

Probleme mit API-Schlüsseln

  • „Modell X ist nicht verfügbar“ : Stellen Sie sicher, dass Sie den entsprechenden API-Schlüssel für das Modell angegeben haben.

  • Keine API-Schlüssel angegeben : Sie müssen mindestens einen der folgenden Schlüssel angeben: OPENAI_API_KEY, GOOGLE_API_KEY oder ANTHROPIC_API_KEY.

  • Modellvorschlag : Der Server schlägt alternative Modelle vor, wenn Ihr gewünschtes Modell nicht verfügbar ist.

Ratenbegrenzung und API-Fehler

  • Wenn Sie auf Ratenbegrenzungen oder API-Fehler stoßen, weist die Fehlermeldung auf das Problem hin.

  • Erwägen Sie die Verwendung eines anderen Modells, wenn bei einem Anbieter Probleme auftreten.

Sicherheitsüberlegungen

  • API-Schlüssel werden niemals protokolliert oder offengelegt

  • Codeinhalte werden aus Datenschutzgründen nur minimal protokolliert

  • Abhängigkeiten werden minimal gehalten, um die Sicherheitsfläche zu reduzieren

  • Die Anfragebearbeitung umfasst die Validierung und Bereinigung der Eingaben

  • Fehlermeldungen sollen verhindern, dass vertrauliche Informationen verloren gehen

Kompatibilität

  • Erfordert Node.js 18.0.0 oder höher

  • Funktioniert unter Linux, macOS und Windows (bei Bedarf über WSL)

  • Kompatibel mit allen MCP-Clients (Claude Code, Claude Desktop, Cursor, Windsurf)

  • Sanfte Handhabung großer Codedateien und Projektkontexte

  • Automatischer Wiederholungsmechanismus für vorübergehende API-Fehler

Entwicklung

# Install dependencies
npm install

# Start in development mode
npm run dev

# Build for production
npm run build

# Start in production mode
npm run start

Lizenz

MIT

Mitwirkende

  • Praney Behl (@praneybehl)

Available Tools

1 tool
perform_code_reviewA

Performs a code review using a specified LLM on git changes. Requires being run from the root of a git repository.

ParametersJSON Schema
NameRequiredDescriptionDefault
targetYesThe git target to review (e.g., 'staged', 'HEAD', or 'branch_diff').
taskDescriptionYesDescription of the task/feature/bugfix that led to these code changes.
llmProviderYesThe LLM provider to use (google, openai, anthropic).
modelNameYesThe specific model name from the provider (e.g., 'gemini-2.5-pro-preview-05-06', 'o4-mini', 'claude-3-7-sonnet-20250219').
reviewFocusNoSpecific areas or aspects to focus the review on (e.g., 'security vulnerabilities', 'performance optimizations', 'adherence to SOLID principles').
projectContextNoGeneral context about the project, its architecture, or coding standards.
diffBaseNoFor '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'.
maxTokensNoMaximum number of tokens to use for the LLM response. Defaults to 32000 if not specified.

TDQS

A3.6/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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. 1 tool update
    • First observedperform_code_review

TDQS

A3.6/5.0
Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count2/5

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.

Completeness2/5

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

ActivityInactive
ResponsivenessUnresponsive

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

Related MCP Servers

Latest Blog Posts

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