home / mcp / gitlab mr mcp server
Interact seamlessly with GitLab repositories to manage merge requests and issues. Fetch details, add comments, and streamline your code review process with ease.
Configuration
View docs{
"mcpServers": {
"kevinlin-gitlab-mr-mcp": {
"command": "npx",
"args": [
"[email protected]"
],
"env": {
"MR_MCP_GITLAB_HOST": "your_gitlab_host",
"MR_MCP_GITLAB_TOKEN": "your_gitlab_token",
"MR_MCP_MIN_ACCESS_LEVEL": "10",
"MR_MCP_PROJECT_SEARCH_TERM": "my-project"
}
}
}
}You can run a dedicated MCP server that lets AI agents interact with GitLab projects, manage merge requests, review code, and post comments. This server exposes tools to list projects, fetch merge requests, view diffs, and add comments or update titles and descriptions, enabling seamless automation with your AI assistant.
Start by running the MCP server in your environment. You have two straightforward options depending on whether you want to run the server directly on your machine or invoke it via a package runner.
Option A: Run with npx (recommended for quick starts) and provide your GitLab host and token as environment variables.
Set your environment variables and start the server using npx. This launches the GitLab MR MCP server with the necessary credentials.
Option B: Run manually by starting the local server with Node.js using a local path to the index file. This is useful if you clone the project and want to run from source.
Once the server is running, connect your MCP client to it using the same environment variables and the appropriate command from the examples below. You can then call tools such as listing projects, retrieving merge request details, or adding comments directly from your AI assistant.
Typical workflows include: getting a list of accessible GitLab projects, selecting a project, listing open merge requests, inspecting a merge request’s details and comments, fetching diffs, and adding comments or line-specific notes to code. You can also fetch issue details and update a merge request’s title or description as part of your automation pipeline.
Fetches a list of GitLab projects accessible with your token.
Lists all open merge requests for a specified project.
Retrieves detailed information about a specific merge request.
Fetches comments on a merge request, including discussions and diff notes.
Adds a general comment to a merge request.
Adds a comment to a specific line in a file within a merge request diff.
Retrieves the diff for a merge request.
Fetches detailed information about a specific issue.
Updates the title of a merge request.
Updates the description of a merge request.