Skip to main content
Glama
https://github.com/owayo/gitlab-mcp-server

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

by owayo

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.

Related MCP server: mcp-gitlab-jira

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

Available Tools

3 tools
get_pipeline_failed_jobsB

GitLabパイプラインで失敗したジョブのコンソール出力を取得

Inputs: no named parameters.

get_review_changesC

GitLab MRで修正したファイルの差分を取得

Inputs: no named parameters.

get_review_commentsB

GitLab MRの未解決の指摘事項(コメント)を取得

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: get_pipeline_failed_jobs targets pipeline failures, get_review_changes targets MR file diffs, and get_review_comments targets MR unresolved comments. There is no overlap in functionality or ambiguity between these three tools.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with 'get_' prefix and snake_case formatting (get_pipeline_failed_jobs, get_review_changes, get_review_comments). The naming convention is perfectly uniform across all tools.

    Tool Count2/5

    With only 3 tools, this server feels severely under-scoped for a GitLab integration. While the tools are coherent, a typical GitLab MCP server would need many more operations (e.g., list projects, create MRs, trigger pipelines) to be useful. The count is too low for the apparent domain.

    Completeness2/5

    The tool surface is extremely incomplete for GitLab operations. It only provides three specific 'get' operations for pipelines and MRs, missing all CRUD/lifecycle coverage (no create, update, delete, or listing operations). Agents will encounter dead ends when trying to perform basic GitLab workflows.

    Related MCP Connectors

    Related MCP Servers

    • -
      license
      Not graded
      quality
      Not graded
      maintenance
      A Model Context Protocol server that enables AI assistants to interact with GitLab repositories, allowing tasks like managing merge requests, searching projects, and creating comments through RESTful API integration.
      77 npm
      2
      -
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server for GitLab and Jira integration. This server allows AI agents like gemini-cli to interact with your GitLab and Jira instances.
      32
      11
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      A Model Context Protocol server that enables AI assistants to interact with self-hosted GitLab instances through 30 specialized tools. It supports managing projects, merge requests, CI/CD pipelines, and repository operations via the GitLab REST API v4.
      30
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server for GitLab integration, enabling AI assistants to manage projects, merge requests, pipelines, issues, releases, and more.
      MIT