Gitlab MCP Server

A Model Context Protocol (MCP) server implementation

Local serverstdioPython

What is the Gitlab MCP server?

A Model Context Protocol (MCP) server implementation. That is what the gitlab mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

A Model Context Protocol (MCP) server for GitLab code review and project management. Provides comprehensive tools for interacting with GitLab projects, merge requests, issues, and code reviews through Claude AI.

  • GitLab Integration — - Complete GitLab API integration using python-gitlab
  • Code Review Tools — - List projects, MRs, view diffs, and add comments
  • Merge Request Management — - Create, update, and review merge requests
  • Suggestion Support — - View and apply code change suggestions
  • Issue Tracking — - Fetch and manage GitLab issues
  • Line Comments — - Add precise code review comments to specific lines

The tools it exposes

The server publishes 14 tools. What each one is for:

  • search_projects — Search for GitLab projects by keyword with pagination support
  • list_merge_requests — List merge requests for a specific project with pagination support. - Parameters: - project_id (required) - GitLab project ID - state (optional)
  • get_merge_request — Fetch detailed merge request information. - Parameters: - project_id (required) - GitLab project ID - mr_iid (required) - Merge request IID
  • get_merge_request_diffs — Get code changes (diffs) for a merge request with pagination support. - Parameters: - project_id (required) - GitLab project ID - mr_iid
  • add_merge_request_comment — Add a general comment to a merge request. - Parameters: - project_id (required) - GitLab project ID - mr_iid (required) - Merge request IID -
  • add_merge_request_line_comment — Add a line-specific comment to merge request code. - Parameters: - project_id (required) - GitLab project ID - mr_iid (required) - Merge request
  • get_merge_request_comments — Get all comments and discussions from a merge request, including suggestions, with pagination support. - Parameters: - project_id (required) -
  • get_merge_request_commits — Get all commits in a merge request with pagination support. - Parameters: - project_id (required) - GitLab project ID - mr_iid (required) - Merge
  • update_merge_request_comment — Update an existing merge request comment. - Parameters: - project_id (required) - GitLab project ID - mr_iid (required) - Merge request IID -
  • reply_to_merge_request_comment — Reply to an existing discussion thread. - Parameters: - project_id (required) - GitLab project ID - mr_iid (required) - Merge request IID -
  • update_merge_request — Update merge request title and/or description. - Parameters: - project_id (required) - GitLab project ID - mr_iid (required) - Merge request IID
  • apply_suggestion — Apply a single code change suggestion. - Parameters: - suggestion_id (required) - Suggestion ID to apply - Returns: Confirmation with commit

What it needs from you

Configuration is passed through the environment: GITLAB_URL, GITLAB_PRIVATE_TOKEN, GITLAB_REVIEW_MCP_SHOW_LOGS. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Getting it running

The server ships on PyPI as gitlab-review-mcp, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

How it compares

Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Gitlab's toolset — search_projects, list_merge_requests, get_merge_request and 11 more — is a fair guide to whether it matches your workflow.

This entry was verified against Gitlab's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Gitlab.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
search_projectsSearch for GitLab projects by keyword with pagination support.
list_merge_requestsList merge requests for a specific project with pagination support. - **Parameters**: - project_id (required) - GitLab project ID - state (optional) - Filter by state: opened, closed, merged, all - author_id (optional) -
get_merge_requestFetch detailed merge request information. - **Parameters**: - project_id (required) - GitLab project ID - mr_iid (required) - Merge request IID (e.g., !123) - **Returns**: MR details including title, description, state,
get_merge_request_diffsGet code changes (diffs) for a merge request with pagination support. - **Parameters**: - project_id (required) - GitLab project ID - mr_iid (required) - Merge request IID - page (optional) - Page number for pagination (
add_merge_request_commentAdd a general comment to a merge request. - **Parameters**: - project_id (required) - GitLab project ID - mr_iid (required) - Merge request IID - comment (required) - Comment text - **Returns**: Confirmation with comment
add_merge_request_line_commentAdd a line-specific comment to merge request code. - **Parameters**: - project_id (required) - GitLab project ID - mr_iid (required) - Merge request IID - file_path (required) - File path in repository - line_number (req
get_merge_request_commentsGet all comments and discussions from a merge request, including suggestions, with pagination support. - **Parameters**: - project_id (required) - GitLab project ID - mr_iid (required) - Merge request IID - page (optiona
get_merge_request_commitsGet all commits in a merge request with pagination support. - **Parameters**: - project_id (required) - GitLab project ID - mr_iid (required) - Merge request IID - page (optional) - Page number for pagination (default: 1
update_merge_request_commentUpdate an existing merge request comment. - **Parameters**: - project_id (required) - GitLab project ID - mr_iid (required) - Merge request IID - note_id (required) - Note ID to update - comment (required) - Updated comm
reply_to_merge_request_commentReply to an existing discussion thread. - **Parameters**: - project_id (required) - GitLab project ID - mr_iid (required) - Merge request IID - discussion_id (required) - Discussion ID to reply to - comment (required) -
update_merge_requestUpdate merge request title and/or description. - **Parameters**: - project_id (required) - GitLab project ID - mr_iid (required) - Merge request IID - title (optional) - New title - description (optional) - New descripti
apply_suggestionApply a single code change suggestion. - **Parameters**: - suggestion_id (required) - Suggestion ID to apply - **Returns**: Confirmation with commit ID
apply_suggestionsApply multiple code change suggestions in batch. - **Parameters**: - suggestion_ids (required) - List of suggestion IDs to apply - **Returns**: Confirmation with commit ID and applied suggestion IDs
get_issueFetch detailed issue information. - **Parameters**: - project_id (required) - GitLab project ID - issue_iid (required) - Issue IID (e.g., #123) - **Returns**: Issue details including title, description, state, assignees,

How to install the Gitlab MCP server

{
  "mcpServers": {
    "gitlab-review-mcp": {
      "command": "uvx",
      "args": ["--no-progress", "gitlab-review-mcp"],
      "env": {
        "GITLAB_URL": "https://gitlab.com",
        "GITLAB_PRIVATE_TOKEN": "your-token-here",
        "GITLAB_REVIEW_MCP_SHOW_LOGS": "false"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
GITLAB_URLEndpoint or connection string the server talks to.Yes
GITLAB_PRIVATE_TOKENCredential the server authenticates with.Yes
GITLAB_REVIEW_MCP_SHOW_LOGSConfiguration value read at startup.Optional

Example prompts to try

  • Use Gitlab to search projects.
  • Use Gitlab to list merge requests.
  • Use Gitlab to get merge request.

Frequently asked questions

It connects Gitlab to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (search_projects, list_merge_requests, get_merge_request, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Gitlab directly.