Code Review MCP Server
コードレビューサーバー
Repomix と LLM を使用してコードレビューを実行するカスタム MCP サーバー。
特徴
Repomix を使用してコードベースをフラット化する
大規模言語モデルでコードを分析する
具体的な問題と推奨事項を含む構造化されたコードレビューを取得します
複数の LLM プロバイダー (OpenAI、Anthropic、Gemini) のサポート
大規模なコードベースのチャンク化を処理
Related MCP server: Code Review MCP Server
インストール
# Clone the repository
git clone https://github.com/yourusername/code-review-server.git
cd code-review-server
# Install dependencies
npm install
# Build the server
npm run build構成
.env.exampleテンプレートに基づいて、ルート ディレクトリに.envファイルを作成します。
cp .env.example .env.envファイルを編集して、優先する LLM プロバイダーと API キーを設定します。
# LLM Provider Configuration
LLM_PROVIDER=OPEN_AI
OPENAI_API_KEY=your_openai_api_key_here使用法
MCPサーバーとして
コード レビュー サーバーはモデル コンテキスト プロトコル (MCP) を実装しており、任意の MCP クライアントで使用できます。
# Start the server
node build/index.jsサーバーは 2 つの主要なツールを公開します。
analyze_repo: Repomix を使用してコードベースをフラット化するcode_review: LLMを使用してコードレビューを実行します
MCPツールを使用する場合
このサーバーは、異なるコード分析ニーズに対応する 2 つの異なるツールを提供します。
分析リポジトリ
次の場合にこのツールを使用します。
コードベースの構造と構成の概要を把握する
初期分析のためにリポジトリをテキスト表現にフラット化する
詳細な確認なしでディレクトリ構造とファイルの内容を理解する
より詳細なコードレビューの準備
コードベースを素早くスキャンして、さらに分析する必要がある関連ファイルを特定します。
例:
「レビューする前にこのリポジトリの構造を理解したい」
「このコードベースに含まれるファイルとディレクトリを表示してください」
「コードの構成を理解するために、コードを平面的に表示してください」
コードレビュー
次の場合にこのツールを使用します。
包括的なコード品質評価を実行する
特定のセキュリティ脆弱性、パフォーマンスのボトルネック、コード品質の問題を特定する
コードを改善するための実用的な推奨事項を入手する
問題の重大度評価を含む詳細なレビューを実施する
ベストプラクティスに照らしてコードベースを評価する
例:
「このコードベースのセキュリティ上の脆弱性を確認してください」
「これらの特定のJavaScriptファイルのパフォーマンスを分析します」
「このリポジトリの詳細なコード品質評価を教えてください」
「私のコードをレビューして、保守性を向上させる方法を教えてください」
パラメータを使用する場合:
specificFiles: リポジトリ全体ではなく、特定のファイルのみをレビューしたい場合fileTypes: 特定のファイル拡張子(例: .js、.ts)に焦点を当てたい場合detailLevel: 簡単な概要には「basic」、詳細な分析には「detailed」を使用しますfocusAreas: 特定の側面(セキュリティ、パフォーマンスなど)を優先したい場合
CLIツールの使用
テスト目的では、付属の CLI ツールを使用できます。
node build/cli.js <repo_path> [options]オプション:
--files <file1,file2>: レビューする特定のファイル--types <.js,.ts>: レビューに含めるファイルの種類--detail <basic|detailed>: 詳細レベル(デフォルト: details)--focus <areas>: 重点を置く領域 (セキュリティ、パフォーマンス、品質、保守性)
例:
node build/cli.js ./my-project --types .js,.ts --detail detailed --focus security,quality発達
# Run tests
npm test
# Watch mode for development
npm run watch
# Run the MCP inspector tool
npm run inspectorLLM統合
コード レビュー サーバーは、複数の LLM プロバイダー API と直接統合されます。
OpenAI (デフォルト:gpt-4o)
人間中心的(デフォルト:claude-3-opus-20240307)
Gemini (デフォルト: gemini-1.5-pro)
プロバイダー構成
.envファイルで、優先する LLM プロバイダーを構成します。
# Set which provider to use
LLM_PROVIDER=OPEN_AI # Options: OPEN_AI, ANTHROPIC, or GEMINI
# Provider API Keys (add your key for the chosen provider)
OPENAI_API_KEY=your-openai-api-key
ANTHROPIC_API_KEY=your-anthropic-api-key
GEMINI_API_KEY=your-gemini-api-keyモデル構成
オプションで、各プロバイダーに使用するモデルを指定できます。
# Optional: Override the default models
OPENAI_MODEL=gpt-4-turbo
ANTHROPIC_MODEL=claude-3-sonnet-20240229
GEMINI_MODEL=gemini-1.5-flash-previewLLM統合の仕組み
code_reviewツールはRepomixを使用してコードを処理してリポジトリ構造をフラット化します。コードは、LLMコンテキストの制限内に収まるように必要に応じてフォーマットされ、チャンク化されます。
詳細なプロンプトは、焦点領域と詳細レベルに基づいて生成されます。
プロンプトとコードは、選択したプロバイダーのLLM APIに直接送信されます。
LLM応答は構造化された形式に解析される
レビューは、問題点、強み、推奨事項を含むJSONオブジェクトとして返されます。
実装には、API エラーに対する耐性のための再試行ロジックと、最も関連性の高いコードがレビューに含まれるようにするための適切なフォーマットが含まれています。
コードレビューの出力形式
コードレビューは構造化された JSON 形式で返されます。
{
"summary": "Brief summary of the code and its purpose",
"issues": [
{
"type": "SECURITY|PERFORMANCE|QUALITY|MAINTAINABILITY",
"severity": "HIGH|MEDIUM|LOW",
"description": "Description of the issue",
"line_numbers": [12, 15],
"recommendation": "Recommended fix"
}
],
"strengths": ["List of code strengths"],
"recommendations": ["List of overall recommendations"]
}ライセンス
マサチューセッツ工科大学
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- Alicense-qualityDmaintenanceEnables comprehensive codebase analysis using Google's Gemini AI through CLI integration. Provides architectural reviews and targeted code analysis with code2prompt integration for efficient context extraction.122Apache 2.0
- AlicenseBqualityCmaintenanceConnects LLMs to GitHub and GitLab to analyze pull and merge requests for logic, security, and architectural alignment. It provides tools for fetching diffs, file contents, and project metadata, alongside guided prompts for professional code reviews.1019ISC
- Alicense-qualityCmaintenanceEnables AI-powered, zero-trust code review with multiple models, supporting single files, git diffs, and multiple files, with security, performance, and architecture checks across 10+ languages.13MIT
- Alicense-qualityDmaintenanceEnables AI-powered code review and improvement, including analysis, refactoring suggestions, and automatic test generation, with an optional agentic loop for iterative refinement.MIT
Related MCP Connectors
AI code review for GitHub PRs with an MCP autofix loop for Claude Code and Cursor
Hosted MCP server for structured code review passes on human- and AI-written code. Free tier.
Generate SBOMs, scan vulnerabilities, and analyze dependencies from local projects or Git repos.
Appeared in Searches
- Research assistant for AI and ML papers, code, and methodology
- A service for finding coding review resources and best practices
- Security testing, penetration testing, and code auditing services
- Software Development Lifecycle Guide and Resources
- General search for programming code or coding-related information
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/crazyrabbitLTC/mcp-code-review-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server