Skip to main content
Glama
owayo

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

by owayo

GitLab-MCP-服务器

提供与 GitLab 集成的模型上下文协议 (MCP) 服务器。它从特定的 GitLab 项目中检索管道故障信息和合并请求结果,并将它们提供给 AI 助手。

概述

该MCP服务器使用GitLab的API向AI助手提供以下信息:

  1. GitLab Pipeline 中失败作业的控制台输出

  2. GitLab MR 的未解决问题(评论)

  3. GitLab MR 中的更改(与本地存储库的当前状态不同)

利用MCP功能,AI助手可以直接从GitLab提取信息,以提供更有针对性的帮助。

Related MCP server: mcp-gitlab-jira

安装

# uvのインストール
$ curl -LsSf https://astral.sh/uv/install.sh | sh

$ cd /path/to/this-mcp-server
# ライブラリのインストール
$ uv sync

准备

您将需要您的 GitLab 访问令牌。要颁发访问令牌,请转到 GitLab 设置 → 访问令牌。发布时,请检查read_api 。

功能

1. 获取管道故障信息并修复( get_pipeline_failed_jobs )

获取 GitLab 管道中失败作业的控制台输出。 AI助手会根据获取的信息做出修正。

输出:

  • 失败作业的控制台输出,包括作业名称、状态和详细日志

2. 获取并更正 MR 的评论( get_review_comments )

检索并回复 GitLab MR 中的未解决的问题(评论)。已解决的评论和与文件无关的评论将被排除。

输出:

  • 在MR中打开文件相关问题(包括评论者、时间、评论内容、文件位置等)

3. 获取并审查 MR 中的变更( get_review_changes )

获取从 GitLab MR 的基本提交(base_sha)到本地存储库的当前状态的差异。您可以获取与最新本地版本(包括您正在进行的任何未提交的更改)的差异,而不是获取远程差异。将根据所获得的差异进行审查。

输出:

  • 从 MR 的基本提交到当前本地状态的更改(每个文件的更改类型和差异)

与人工智能助手合作

AI助手(例如Claude)可以在该MCP服务器上调用以下函数:

  • get_pipeline_failed_jobs() :获取管道失败信息

  • get_review_comments() :获取 MR 的评论

  • get_review_changes() :获取 MR 中的更改

这些函数自动检索与当前分支相关的 MR 的信息。

Claude 用于桌面设置

将以下内容添加到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"
            }
        }
    }
}

使用光标设置

将以下内容添加到项目根目录中的.cursor/mcp.json中:

{
    "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"
            ]
        }
    }
}

注意:在上面的示例配置中,适当替换以下值:

  • your_gitlab_api_key :您的 GitLab API 访问令牌

  • /path/to/git/repo :本地 Git 存储库的绝对路径

  • /path/to/this-mcp-server :此 MCP 服务器目录的绝对路径

Available Tools

3 tools
get_pipeline_failed_jobsB

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

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions retrieving console output for failed jobs, implying a read-only operation, but doesn't disclose behavioral traits like authentication requirements, rate limits, error handling, or what happens if no failed jobs exist. The description is minimal and lacks critical operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence in Japanese that directly states the tool's function without unnecessary words. It's front-loaded and efficiently conveys the core purpose, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the return value includes (e.g., job details, error messages, format) or address potential complexities like pagination or filtering. For a tool that likely interacts with GitLab APIs, more context is needed for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add param details, but this is acceptable given the schema's completeness. Baseline is 4 for zero parameters, as the description doesn't need to compensate for gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'GitLabパイプラインで失敗したジョブのコンソール出力を取得' (Get console output for failed jobs in a GitLab pipeline). It specifies the verb ('取得' - get/retrieve) and resource ('失敗したジョブのコンソール出力' - console output of failed jobs), though it doesn't explicitly distinguish from sibling tools like 'get_review_changes' or 'get_review_comments'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a pipeline ID or authentication), context for invocation, or exclusions. Without annotations or sibling tool context, usage is implied but not explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_review_changesC

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

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It only states what the tool does (gets file differences) but doesn't describe any behavioral traits: no information about authentication requirements, rate limits, pagination, error conditions, or what format the differences are returned in. For a tool with zero annotation coverage, this is a significant gap in behavioral transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Japanese that directly states the tool's purpose. There's no wasted verbiage or unnecessary elaboration. However, it could be slightly improved by being front-loaded with more complete information about the tool's behavior and usage context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no annotations and no output schema, the description is incomplete. It doesn't explain what format the differences are returned in (unified diff? JSON? raw git diff?), what authentication is required, or any error conditions. For a tool that presumably interacts with GitLab's API, this leaves significant gaps in understanding how to properly use it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the parameter situation (none). The description doesn't need to compensate for any parameter gaps. The baseline for 0 parameters with full schema coverage is 4, as there's no parameter semantics burden on the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'gets differences of modified files in GitLab MR' which provides a basic purpose (verb+resource). However, it doesn't distinguish this from sibling tools like 'get_review_comments' - both appear to retrieve MR-related information but with different data types. The purpose is clear but lacks sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention when this should be used instead of 'get_review_comments' or 'get_pipeline_failed_jobs', nor does it provide any context about prerequisites, timing, or constraints. The agent receives no usage guidance beyond the basic purpose.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_review_commentsB

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

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the tool retrieves unresolved comments, but doesn't disclose behavioral traits such as authentication requirements, rate limits, pagination, error handling, or what 'unresolved' specifically means. This leaves significant gaps for an agent to understand how to use it effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It's front-loaded and appropriately sized for a simple tool with no parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters and no output schema, the description is minimally complete. It specifies what the tool does but lacks details on behavior, output format, or usage context. For a tool with no annotations and no output schema, more information would be helpful, but it's adequate for basic understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here. A baseline score of 4 is given since the schema fully covers the parameters (none), and the description doesn't need to compensate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'GitLab MRの未解決の指摘事項(コメント)を取得' translates to 'Get unresolved comments (review comments) for GitLab Merge Requests.' It specifies the verb ('get'), resource ('review comments'), and scope ('unresolved'), but doesn't explicitly differentiate from sibling tools like 'get_review_changes'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools, prerequisites, or specific contexts where this tool is preferred over others. Usage is implied by the purpose but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 3 tool updates
    • First observedget_pipeline_failed_jobs
    • First observedget_review_changes
    • First observedget_review_comments

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.

Maintenance

ActivityInactive
ResponsivenessNo issues

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.
    14 npm
    2
    -
  • A
    license
    B
    quality
    C
    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
    9 npm
    11
    MIT
  • A
    license
    B
    quality
    D
    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