https://github.com/owayo/gitlab-mcp-server

by owayo
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Provides access to GitLab project data including pipeline job failures, merge request comments, and code changes to enable AI assistants to help debug failed jobs, address review comments, and perform code reviews.

GitLab-MCP-Server

This is a Model Context Protocol (MCP) server that provides integration with GitLab. It retrieves pipeline failure information and merge request findings from specific projects in GitLab and provides them to the AI assistant.

overview

This MCP server uses GitLab's API to provide the following information to the AI assistant:

  1. Console output of failed jobs in GitLab Pipeline
  2. Open issues (comments) for GitLab MR
  3. Changes in the GitLab MR (diff against the current state of your local repository)

Using MCP capabilities, the AI assistant can pull information directly from GitLab to provide more targeted assistance.

install

# uvのインストール $ curl -LsSf https://astral.sh/uv/install.sh | sh $ cd /path/to/this-mcp-server # ライブラリのインストール $ uv sync

Preparation

You need a GitLab access token. Please issue an access token in GitLab Settings → Access Token. When issuing the token, please check read_api .

function

1. Get pipeline failure information and fix it ( get_pipeline_failed_jobs )

Capture the console output of failed jobs in your GitLab pipelines, and use that information to make corrections with your AI assistant.

output :

  • The console output of the failed job, including the job name, status, and detailed logs

2. Get and correct the MR's comments ( get_review_comments )

Retrieves and responds to unresolved issues (comments) from GitLab MR. Resolved comments and comments not associated with a file are excluded.

output :

  • Open file-related issues in MR (including commenter, time, comment content, file location, etc.)

3. Get and review the changes in the MR ( get_review_changes )

Get the difference between the base commit (base_sha) of the GitLab MR and the current state of your local repository. You can get the difference between the latest local state (including uncommitted changes in progress) and the remote difference, not the remote difference. The review will be performed using the obtained difference.

output :

  • Changes from the base commit of the MR to the current local state (type of change and diff for each file)

Collaboration with AI assistants

An AI assistant (such as Claude) can call the following functions on this MCP server:

  • get_pipeline_failed_jobs() : Get pipeline failure information
  • get_review_comments() : Get MR's comments
  • get_review_changes() : Get the changes in the MR

These functions automatically retrieve information about the MR related to the current branch.

Claude for Desktop Settings

Add the following to claude_desktop_config.json :

{ "mcpServers": { "gitlab-mcp": { "command": "uv", "args": [ "--directory", "/path/to/this-mcp-server", "run", "main.py" ], "env": { "GITLAB_URL": "your_gitlab_url", "GITLAB_PROJECT_NAME": "gitlab_project_name", "GITLAB_API_KEY": "your_gitlab_api_key", "GIT_REPO_PATH": "/path/to/git/repo" } } } }

Setting with Cursor

Add the following to .cursor/mcp.json in your project root:

{ "mcpServers": { "gitlab-mcp": { "command": "env", "args": [ "GITLAB_URL=your_gitlab_url", "GITLAB_PROJECT_NAME=gitlab_project_name", "GITLAB_API_KEY=your_gitlab_api_key", "GIT_REPO_PATH=/path/to/git/repo", "uv", "--directory", "/path/to/this-mcp-server", "run", "main.py" ] } } }

Note: In the above example configuration, replace the following values appropriately:

  • your_gitlab_api_key : Your GitLab API access token
  • /path/to/git/repo : The absolute path to the local Git repository
  • /path/to/this-mcp-server : Absolute path to the directory of this MCP server
-
security - not tested
A
license - permissive license
-
quality - not tested

This is a Model Context Protocol (MCP) server that provides integration with GitLab. It retrieves pipeline failure information and merge request findings from specific projects in GitLab and provides them to the AI assistant.

  1. 概要
    1. インストール
      1. 準備
        1. 機能
          1. 1. パイプラインの失敗情報を取得して修正 (get_pipeline_failed_jobs)
          2. 2. MRの指摘事項を取得して修正 (get_review_comments)
          3. 3. MRの変更内容を取得してレビュー (get_review_changes)
        2. AIアシスタントとの連携
          1. Claude for Desktopでの設定
            1. Cursorでの設定
              ID: kf6yifqdxg