loading…
Search for a command to run...
loading…
Connects LLMs to GitHub and GitLab to analyze pull and merge requests for logic, security, and architectural alignment. It provides tools for fetching diffs, fi
Connects 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.
An MCP server designed to act as a Read-Only Intelligence Provider for code reviews. It connects LLMs (like Claude Desktop or Gemini) to your Git hosting platforms (GitLab & GitHub) to analyze Merge/Pull Requests, understand project context, and provide expert feedback.
You can use this MCP server in two ways:
Install the package globally via npm:
npm install -g mcp-server-code-review
Clone the repository and build it locally:
git clone <your-repo-url> mcp-server-code-review
cd mcp-server-code-review
npm install
npm run build
The server requires environment variables for authentication. You should add these to your MCP Client configuration (e.g., Claude Desktop).
| Variable | Description | Required For |
|---|---|---|
GITLAB_TOKEN |
Your GitLab Personal Access Token. | GitLab |
GITLAB_URL |
GitLab instance URL (default: https://gitlab.com). |
GitLab (Self-Managed) |
GITHUB_TOKEN |
Your GitHub Personal Access Token. | GitHub |
CODE_REVIEW_GUIDELINES_FILE |
Path to a file containing custom code review guidelines. | Optional (Custom Rules) |
CODE_REVIEW_GUIDELINES |
Inline custom code review guidelines text. | Optional (Custom Rules) |
Note: At least one of
GITLAB_TOKENorGITHUB_TOKENmust be provided. IfCODE_REVIEW_GUIDELINES_FILEis set, it takes precedence overCODE_REVIEW_GUIDELINES.
{
"mcpServers": {
"code-review": {
"command": "mcp-server-code-review",
"env": {
"GITLAB_TOKEN": "your_token_here",
"GITHUB_TOKEN": "your_token_here"
}
}
}
}
Replace /absolute/path/to/... with the actual full path to the project directory.
{
"mcpServers": {
"code-review": {
"command": "node",
"args": ["/absolute/path/to/mcp-server-code-review/dist/index.js"],
"env": {
"GITLAB_TOKEN": "your_token_here",
"GITHUB_TOKEN": "your_token_here"
}
}
}
}
{
"mcpServers": {
"code-review": {
"command": "mcp-server-code-review",
"env": {
"GITLAB_TOKEN": "your_token_here",
"GITLAB_URL": "https://gitlab.yourcompany.com"
}
}
}
}
You can provide custom guidelines either as a file path or inline text:
{
"mcpServers": {
"code-review": {
"command": "mcp-server-code-review",
"env": {
"GITHUB_TOKEN": "your_token_here",
"GITLAB_TOKEN": "your_token_here",
"GITLAB_URL": "https://gitlab.yourcompany.com",
"CODE_REVIEW_GUIDELINES_FILE": "/path/to/your/guidelines.md"
}
}
}
}
Or use inline guidelines:
{
"mcpServers": {
"code-review": {
"command": "mcp-server-code-review",
"env": {
"GITHUB_TOKEN": "your_token_here",
"CODE_REVIEW_GUIDELINES": "Focus on performance and security. Ensure all functions have proper error handling."
}
}
}
}
Add the following to your claude_desktop_config.json file.
Path locations:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonAdd the following to your settings.json file for global configuration, or .claude/settings.local.json in your project directory for project-specific configuration.
Path locations (global):
~/.claude/settings.json%USERPROFILE%\.claude\settings.json~/.claude/settings.jsonAdd the following to your settings.json file.
Path locations:
~/.gemini/settings.json%USERPROFILE%\.gemini\settings.json~/.gemini/settings.jsonAdd the following to your mcp.json file.
Path locations:
~/.chatgpt/mcp.json%USERPROFILE%\.chatgpt\mcp.json~/.chatgpt/mcp.json| Tool | Description |
|---|---|
github_list_prs |
List pull requests with optional status filter |
github_get_pr_details |
Get detailed information about a pull request |
github_get_pr_diff |
Retrieve code changes/diff for a pull request |
github_read_file |
Read file content at a specific ref |
github_get_project_metadata |
Fetch README and manifest files (package.json, etc.) |
| Tool | Description |
|---|---|
gitlab_list_mrs |
List merge requests with optional status filter |
gitlab_get_mr_details |
Get detailed information about a merge request |
gitlab_get_mr_diff |
Retrieve code changes/diff for a merge request |
gitlab_read_file |
Read file content at a specific ref |
gitlab_get_project_metadata |
Fetch README and manifest files (package.json, etc.) |
| Prompt | Description |
|---|---|
review_merge_request |
Guided GitLab MR review with Principal Engineer perspective |
review_pull_request |
Guided GitHub PR review with Principal Engineer perspective |
These prompts instruct the LLM to:
npm test # Run all tests
npm run test:coverage # Run tests with coverage report
npm run format # Format code with Prettier
npm run format:check # Check code formatting
The MCP Inspector allows you to test the server and tool calls interactively in your browser without needing the Claude Desktop app.
Build the project:
npm run build
Run the Inspector: (Replace tokens with your actual values)
GITLAB_TOKEN=your_token npx @modelcontextprotocol/inspector node dist/index.js
Open: http://localhost:6274 (or the port shown in terminal).
ISC
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"code-review-mcp-server": {
"command": "npx",
"args": []
}
}
}