Get the FREE Ultimate OpenClaw Setup Guide →

gitlab-mr

Interact seamlessly with GitLab repositories to manage merge requests and issues. Fetch details, add comments, and streamline your code review process with ease.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio kopfrechner-gitlab-mr-mcp node /path/to/gitlab-mr-mcp/index.js \
  --env MR_MCP_GITLAB_HOST="your_gitlab_host" \
  --env MR_MCP_GITLAB_TOKEN="your_gitlab_token"

How to use

This MCP server provides tools to interact with GitLab repositories via the Model Context Protocol. It exposes capabilities to list projects, fetch merge request details and comments, obtain diffs, and modify merge requests by adding or updating comments, as well as adjust titles and descriptions. The available tools mirror common GitLab interactions: get_projects to discover accessible projects, list_open_merge_requests to see MRs in a project, get_merge_request_details and get_merge_request_comments for MR context, get_merge_request_diff to inspect changes, add_merge_request_comment and add_merge_request_diff_comment to contribute feedback on MRs, get_issue_details for issues, and set_merge_request_title/set_merge_request_description to update MR metadata. To use these tools, configure your MCP client with the server entry, then call the corresponding tool names with the required parameters (e.g., project_id, merge_request_id, or issue_id) as documented by the MCP protocol. Ensure your environment variables provide proper authentication to GitLab and that the host is reachable.

How to install

Prerequisites:

  • Node.js (and npm) installed on your machine
  • Git installed (for cloning the repository)
  • Access token for GitLab with API/read_api scopes

Manual installation steps:

  1. Clone the repository:
git clone https://github.com/kopfrechner/gitlab-mr-mcp.git
cd gitlab-mr-mcp
  1. Install dependencies:
npm install
  1. Run the MCP server directly (example):
node index.js
  1. Alternatively, configure via MCP client configuration (example):
{
  "mcpServers": {
    "gitlab-mr-mcp": {
      "command": "node",
      "args": ["/path/to/gitlab-mr-mcp/index.js"],
      "env": {
        "MR_MCP_GITLAB_TOKEN": "your_gitlab_token",
        "MR_MCP_GITLAB_HOST": "your_gitlab_host"
      }
    }
  }
}
  1. If using Smithery for automated setup, you can install via:
npx -y @smithery/cli@latest install @kopfrechner/gitlab-mr-mcp --client claude --config '{"gitlabMrMcpToken":"YOUR_GITLAB_TOKEN", "gitlabMrMcpHost": "YOUR_GITLAB_HOST"}'
  1. Ensure the environment variables MR_MCP_GITLAB_TOKEN and MR_MCP_GITLAB_HOST (and any optional filters) are correctly set before starting the server.

Additional notes

Notes and tips:

  • Ensure your GitLab token includes api and read_api scopes to access project data and MR details.
  • If you encounter 403 Forbidden errors, verify token scopes, project access, and that the target projects exist and are accessible by the token user.
  • Optional environment variables (as shown in the README) allow filtering by minimum access level or search terms to limit which projects are exposed to the get_projects tool.
  • When deploying, keep the token secure and avoid embedding it in client-facing configurations. Use environment variable injection or secret management where possible.
  • The npm package for this MCP server is usually referenced as @kopfrechner/gitlab-mr-mcp; adjust the npm_package field accordingly if your deployment uses a different naming convention.

Related MCP Servers

Sponsor this space

Reach thousands of developers