home / mcp / gitlab review mcp server
Provides code review actions for GitHub and GitLab, including PR/MR data, diffs, comments, and code quality analysis.
Configuration
View docs{
"mcpServers": {
"lininn-gitlab-review-mcp": {
"command": "npx",
"args": [
"-y",
"gitlab-review-mcp",
"--api-base-url=https://api.github.com",
"--api-token=YOUR_GITHUB_TOKEN"
],
"env": {
"TIMEOUT": "30000",
"API_TOKEN": "YOUR_GITHUB_TOKEN",
"MAX_RETRIES": "3",
"API_BASE_URL": "https://api.github.com"
}
}
}
}You manage code review workflows by running a Node.js MCP server that exposes actions like fetching PR/ MR details, getting code diffs, adding review comments, and analyzing code quality. It supports both GitHub and GitLab APIs and is configurable to fit your CI/CD or developer tooling.
To use this MCP server in your workflow, run it as a local service or connect to a remote MCP endpoint from your MCP client. You can perform common code review operations such as retrieving pull/merge request details, fetching file diffs, adding inline comments, and analyzing code quality. When you call the available actions, you provide repository information, identifiers for the review item (pull request or merge request), and any necessary context like file paths or target languages. The server handles both GitHub and GitLab providers and returns structured results you can display in your tooling or automation.
Prerequisites: Node.js and npm should be installed on your system. You also need access tokens for GitHub or GitLab if you will connect to private repositories.
Install the MCP server package globally (when published) or run from source during development.
Install the package globally (example):
npm install -g gitlab-review-mcpConfigure access to your code host and the MCP server by providing API base URLs and tokens. You can supply settings through environment variables or CLI arguments.
Environment variables you may configure include API_BASE_URL, API_TOKEN, TIMEOUT, and MAX_RETRIES.
Examples of how to start and configure the MCP server with a GitHub base URL and token are shown in the next section.
Use short-lived tokens when possible and restrict API scopes to only what you need for code review actions. Store tokens securely and rotate them periodically.
If you encounter authentication errors (401/403), verify that your API_TOKEN is correct and that the token has the required scopes. For timeouts or retries issues, check your TIMEOUT and MAX_RETRIES settings and ensure the target API base URL is reachable.
The MCP server is designed to be consumed by MCP clients such as desktop configurators or automation tools. It supports both GitHub and GitLab APIs and exposes a set of actions for common code review tasks.
This server enables a range of code review operations including fetching PR/MR details, retrieving code diffs, adding review comments, and analyzing code quality across supported languages.
Fetch details of a pull request or merge request for a given repository and pull/merge request number.
Retrieve the code diff for a pull request, merge request, or a specific commit.
Add a review comment to a pull request, optionally associating it with a file and line.
Analyze provided code content and return quality metrics and suggestions.
Get repository information from the configured provider.
Analyze multiple files for code quality issues in a single call.
List files changed in a pull request or merge request.
Return the list of languages supported for code analysis.
Get available analysis rules for a specific language.
Get current server configuration and health status.
Create a new GitLab merge request with enhanced validation and error handling.
Determine the current Git branch and repository information.
Obtain the current GitLab project information from remotes.