Skip to main content
Glama

MCP GitLab CrunchTools

A secure MCP (Model Context Protocol) server for GitLab projects, merge requests, issues, pipelines, and search. Works with any GitLab instance (gitlab.com, self-hosted, or enterprise).

Overview

This MCP server is designed to be:

  • Secure by default - documented threat model (see SECURITY.md), Pydantic input validation, and the API token held as a SecretStr to prevent accidental logging

  • No third-party services - Runs locally via stdio, your API token never leaves your machine

  • Multi-instance - Works with gitlab.com, self-hosted GitLab, or enterprise instances via configurable URL

  • Cross-platform - Works on Linux, macOS, and Windows

  • Automatically updated - GitHub Actions monitor for CVEs and update dependencies

  • Containerized - Available at quay.io/crunchtools/mcp-gitlab built on Hummingbird Python base image

Related MCP server: gitlab-mcp-server

Naming Convention

Component

Name

GitHub repo

crunchtools/mcp-gitlab

Container

quay.io/crunchtools/mcp-gitlab

Python package (PyPI)

mcp-gitlab-crunchtools

CLI command

mcp-gitlab-crunchtools

Module import

mcp_gitlab_crunchtools

Why Hummingbird?

The container image is built on the Hummingbird Python base image from Project Hummingbird, which provides:

  • Minimal CVE exposure - Built with a minimal package set, dramatically reducing the attack surface

  • Regular updates - Security patches are applied promptly

  • Optimized for Python - Pre-configured Python environment with uv package manager

  • Production-ready - Proper signal handling and non-root user defaults

Features

Project Management (5 tools)

  • list_projects - List projects with filtering and search

  • get_project - Get project details by ID or path

  • list_project_branches - List repository branches

  • get_project_branch - Get a single branch

  • list_project_commits - List commits with date/path filtering

Group Management (3 tools)

  • list_groups - List groups with filtering

  • get_group - Get group details by ID or path

  • list_group_projects - List projects in a group (with subgroup support)

Merge Requests (7 tools)

  • list_merge_requests - List MRs by state, labels, milestone

  • get_merge_request - Get MR details

  • create_merge_request - Create a new MR

  • update_merge_request - Update MR title, description, state, assignees

  • list_mr_notes - List comments on an MR

  • create_mr_note - Add a comment to an MR

  • get_mr_changes - Get the diff for an MR

Issues (6 tools)

  • list_issues - List issues by state, labels, milestone, assignee

  • get_issue - Get issue details

  • create_issue - Create a new issue

  • update_issue - Update issue title, description, state, labels

  • list_issue_notes - List comments on an issue

  • create_issue_note - Add a comment to an issue

Pipelines (4 tools)

  • list_pipelines - List CI/CD pipelines with status filtering

  • get_pipeline - Get pipeline details

  • list_pipeline_jobs - List jobs in a pipeline

  • get_job_log - Get job log output

Search (2 tools)

  • search_global - Search across all accessible GitLab resources

  • search_project - Search within a specific project

Installation

uvx mcp-gitlab-crunchtools

With pip

pip install mcp-gitlab-crunchtools

With Container

podman run -e GITLAB_TOKEN=your_token \
    quay.io/crunchtools/mcp-gitlab

Configuration

Environment Variables

Variable

Required

Default

Description

GITLAB_TOKEN

Yes

—

Personal Access Token

GITLAB_URL

No

https://gitlab.com

GitLab instance URL

SSL_CERT_FILE

No

—

Custom CA bundle path, for self-hosted GitLab with an internal CA

GITLAB_SSL_VERIFY

No

true

Set false to disable TLS verification (not recommended)

Creating a GitLab Personal Access Token

  1. Navigate to Access Tokens

  2. Create a Custom Token

    • Name: mcp-gitlab-crunchtools

    • Expiration: Set an appropriate date (90 days recommended)

    • Scopes: Select scopes based on your needs

  3. Scope Selection

    Scope

    Access Level

    Capabilities

    read_api

    Read-only

    List/view projects, issues, MRs, pipelines

    api

    Full access

    All features including create/update

  4. Copy and Store Token

    • Copy the token immediately (starts with glpat-)

    • Store securely in a password manager

Add to Claude Code

claude mcp add mcp-gitlab-crunchtools \
    --env GITLAB_TOKEN=your_token_here \
    -- uvx mcp-gitlab-crunchtools

For self-hosted GitLab:

claude mcp add mcp-gitlab-crunchtools \
    --env GITLAB_TOKEN=your_token_here \
    --env GITLAB_URL=https://gitlab.example.com \
    -- uvx mcp-gitlab-crunchtools

For the container version:

claude mcp add mcp-gitlab-crunchtools \
    --env GITLAB_TOKEN=your_token_here \
    -- podman run -i --rm -e GITLAB_TOKEN quay.io/crunchtools/mcp-gitlab

Usage Examples

List Your Projects

User: List my GitLab projects
Assistant: [calls list_projects with membership=true]

View Merge Requests

User: Show open merge requests for my-org/backend
Assistant: [calls list_merge_requests with project_id="my-org/backend"]

Create an Issue

User: Create an issue in my-org/backend titled "Fix login timeout"
Assistant: [calls create_issue with title="Fix login timeout"]

Check Pipeline Status

User: Show failed pipelines for my-org/api
Assistant: [calls list_pipelines with status="failed"]

Search Code

User: Search for "authentication" in my-org/backend
Assistant: [calls search_project with scope="blobs"]

Security

This server was designed with security as a primary concern. See SECURITY.md for:

  • Threat model and attack vectors

  • Defense in depth architecture

  • Token handling best practices

  • Input validation rules

  • Audit logging

Key Security Features

  1. Token Protection

    • Stored as SecretStr (never accidentally logged)

    • Environment variable only (never in files or args)

    • Sanitized from all error messages

  2. Input Validation

    • Pydantic models for all inputs

    • Allowlist character validation for project/group IDs

    • Path traversal prevention

  3. API Hardening

    • HTTPS enforcement (except localhost)

    • TLS certificate validation

    • Request timeouts (30s)

    • Response size limits (10MB)

  4. Automated CVE Scanning

    • GitHub Actions scan dependencies weekly

    • Container security scanning with Trivy

    • CodeQL analysis for Python

Development

Setup

git clone https://github.com/crunchtools/mcp-gitlab.git
cd mcp-gitlab
uv sync

Run Tests

uv run pytest

Lint and Type Check

uv run ruff check src tests
uv run mypy src

Build Container

podman build -t mcp-gitlab .

License

AGPL-3.0-or-later

Contributing

Contributions welcome! Please read SECURITY.md before submitting security-related changes.

Available Tools

63 tools
cancel_job_toolCancel Job ToolC

Cancel a running CI/CD job.

Inputs: job_id (required), project_id (required). Returns: object

cancel_pipeline_toolCancel Pipeline ToolC

Cancel a running CI/CD pipeline.

Inputs: project_id (required), pipeline_id (required). Returns: object

compare_branches_toolCompare Branches ToolB
Read-only

Compare two branches, tags, or commits.

Inputs: to_ref (required), from_ref (required), project_id (required), straight. Returns: object

create_branch_toolCreate Branch ToolC

Create a new branch in a GitLab repository.

Inputs: ref (required), branch (required), project_id (required). Returns: object

create_file_toolCreate File ToolC

Create a new file in a GitLab repository.

Inputs: branch (required), content (required), file_path (required), project_id (required), +2 more. Returns: object

create_issue_note_toolCreate Issue Note ToolB

Create a note (comment) on an issue.

Inputs: body (required), issue_iid (required), project_id (required). Returns: object

create_issue_toolCreate Issue ToolC

Create a new issue in a GitLab project.

Inputs: title (required), project_id (required), labels, description, +3 more. Returns: object

create_label_toolCreate Label ToolC

Create a new label in a GitLab project.

Inputs: name (required), color (required), project_id (required), priority, +1 more. Returns: object

create_merge_request_toolCreate Merge Request ToolC

Create a new merge request.

Inputs: title (required), project_id (required), source_branch (required), target_branch (required), +6 more. Returns: object

create_milestone_toolCreate Milestone ToolC

Create a new milestone in a GitLab project.

Inputs: title (required), project_id (required), due_date, start_date, +1 more. Returns: object

create_mr_discussion_toolCreate Mr Discussion ToolC

Create a new discussion on a merge request.

Inputs: body (required), project_id (required), merge_request_iid (required). Returns: object

create_mr_note_toolCreate Mr Note ToolC

Create a note (comment) on a merge request.

Inputs: body (required), project_id (required), merge_request_iid (required). Returns: object

create_pipeline_toolCreate Pipeline ToolC

Create (trigger) a new CI/CD pipeline.

Inputs: project_id (required), ref. Returns: object

create_project_toolCreate Project ToolC

Create a new GitLab project.

Inputs: name (required), visibility, description, namespace_id, +1 more. Returns: object

create_release_toolCreate Release ToolC

Create a new release for a GitLab project.

Inputs: tag_name (required), project_id (required), ref, name, +2 more. Returns: object

create_snippet_toolCreate Snippet ToolB

Create a new snippet in a GitLab project.

Inputs: title (required), content (required), file_name (required), project_id (required), +2 more. Returns: object

create_wiki_page_toolCreate Wiki Page ToolC

Create a new wiki page in a GitLab project.

Inputs: title (required), content (required), project_id (required), format. Returns: object

delete_branch_toolDelete Branch ToolC

Delete a branch from a GitLab repository.

Inputs: branch (required), project_id (required). Returns: object

delete_job_toolDelete Job ToolB

Delete a CI/CD job's artifacts and trace log.

Inputs: job_id (required), project_id (required). Returns: object

delete_label_toolDelete Label ToolB

Delete a label from a GitLab project.

Inputs: label_id (required), project_id (required). Returns: object

delete_pipeline_toolDelete Pipeline ToolB

Delete a CI/CD pipeline and all its jobs permanently.

Inputs: project_id (required), pipeline_id (required). Returns: object

delete_project_toolDelete Project ToolC

Delete a GitLab project permanently.

Inputs: project_id (required). Returns: object

get_current_user_toolGet Current User ToolA
Read-only

Get the currently authenticated GitLab user.

Inputs: no named parameters. Returns: object

get_file_toolGet File ToolA
Read-only

Get a file from a GitLab repository.

Returns file metadata and content (base64 encoded).

Inputs: file_path (required), project_id (required), ref. Returns: object

get_group_toolGet Group ToolB
Read-only

Get GitLab group details by ID or path.

Inputs: group_id (required), with_projects. Returns: object

get_issue_toolGet Issue ToolC
Read-only

Get a single issue by its IID.

Inputs: issue_iid (required), project_id (required). Returns: object

get_job_log_toolGet Job Log ToolB
Read-only

Get the log (trace) output of a CI/CD job.

Inputs: job_id (required), project_id (required). Returns: object

get_merge_request_toolGet Merge Request ToolB
Read-only

Get a single merge request by its IID.

Inputs: project_id (required), merge_request_iid (required). Returns: object

get_mr_changes_toolGet Mr Changes ToolC
Read-only

Get the changes (diff) for a merge request.

Inputs: project_id (required), merge_request_iid (required). Returns: object

get_pipeline_toolGet Pipeline ToolB
Read-only

Get a single CI/CD pipeline by ID.

Inputs: project_id (required), pipeline_id (required). Returns: object

get_project_branch_toolGet Project Branch ToolB
Read-only

Get a single repository branch.

Inputs: branch (required), project_id (required). Returns: object

get_project_toolGet Project ToolB
Read-only

Get GitLab project details by ID or path.

Inputs: project_id (required). Returns: object

get_release_toolGet Release ToolA
Read-only

Get a single release by tag name.

Inputs: tag_name (required), project_id (required). Returns: object

get_user_toolGet User ToolB
Read-only

Get a specific GitLab user by ID.

Inputs: user_id (required). Returns: object

get_wiki_page_toolGet Wiki Page ToolC
Read-only

Get a single wiki page by slug.

Inputs: slug (required), project_id (required). Returns: object

list_group_projects_toolList Group Projects ToolC
Read-only

List projects within a GitLab group.

Inputs: group_id (required), page, sort, search, +4 more. Returns: object

list_groups_toolList Groups ToolB
Read-only

List GitLab groups accessible by the API token.

Inputs: page, sort, owned, search, +3 more. Returns: object

list_issue_notes_toolList Issue Notes ToolB
Read-only

List notes (comments) on an issue.

Inputs: issue_iid (required), project_id (required), page, sort, +2 more. Returns: object

list_issues_toolList Issues ToolC
Read-only

List issues for a GitLab project.

Inputs: project_id (required), page, sort, state, +6 more. Returns: object

list_labels_toolList Labels ToolC
Read-only

List labels for a GitLab project.

Inputs: project_id (required), page, search, per_page. Returns: object

list_merge_requests_toolList Merge Requests ToolC
Read-only

List merge requests for a GitLab project.

Inputs: project_id (required), page, sort, state, +5 more. Returns: object

list_milestones_toolList Milestones ToolB
Read-only

List milestones for a GitLab project.

Inputs: project_id (required), page, state, search, +1 more. Returns: object

list_mr_discussions_toolList Mr Discussions ToolB
Read-only

List discussions (threaded comments) on a merge request.

Discussions include inline code review comments with file position data.

Inputs: project_id (required), merge_request_iid (required), page, per_page. Returns: object

list_mr_notes_toolList Mr Notes ToolC
Read-only

List notes (comments) on a merge request.

Inputs: project_id (required), merge_request_iid (required), page, sort, +2 more. Returns: object

list_pipeline_jobs_toolList Pipeline Jobs ToolC
Read-only

List jobs for a CI/CD pipeline.

Inputs: project_id (required), pipeline_id (required), page, scope, +1 more. Returns: object

list_pipelines_toolList Pipelines ToolC
Read-only

List CI/CD pipelines for a GitLab project.

Inputs: project_id (required), ref, page, sort, +3 more. Returns: object

list_project_branches_toolList Project Branches ToolC
Read-only

List repository branches for a GitLab project.

Inputs: project_id (required), page, search, per_page. Returns: object

list_project_commits_toolList Project Commits ToolB
Read-only

List repository commits for a GitLab project.

Inputs: project_id (required), page, path, since, +3 more. Returns: object

list_projects_toolList Projects ToolB
Read-only

List GitLab projects accessible by the API token.

Inputs: page, sort, owned, search, +4 more. Returns: object

list_releases_toolList Releases ToolB
Read-only

List releases for a GitLab project.

Inputs: project_id (required), page, sort, order_by, +1 more. Returns: object

list_repository_tree_toolList Repository Tree ToolC
Read-only

List repository tree (files and directories).

Inputs: project_id (required), ref, page, path, +2 more. Returns: object

list_snippets_toolList Snippets ToolB
Read-only

List snippets for a GitLab project.

Inputs: project_id (required), page, per_page. Returns: object

list_users_toolList Users ToolC
Read-only

List GitLab users.

Inputs: page, active, search, per_page, +1 more. Returns: object

list_wiki_pages_toolList Wiki Pages ToolC
Read-only

List wiki pages for a GitLab project.

Inputs: project_id (required), page, per_page, with_content. Returns: object

retry_job_toolRetry Job ToolC

Retry a specific failed CI/CD job.

Inputs: job_id (required), project_id (required). Returns: object

retry_pipeline_toolRetry Pipeline ToolA

Retry all failed jobs in a CI/CD pipeline.

Inputs: project_id (required), pipeline_id (required). Returns: object

search_global_toolSearch Global ToolC
Read-only

Search across all GitLab resources accessible by the token.

Inputs: search (required), page, scope, per_page. Returns: object

search_project_toolSearch Project ToolC
Read-only

Search within a specific GitLab project.

Inputs: search (required), project_id (required), page, scope, +1 more. Returns: object

update_file_toolUpdate File ToolC

Update an existing file in a GitLab repository.

Inputs: branch (required), content (required), file_path (required), project_id (required), +2 more. Returns: object

update_issue_toolUpdate Issue ToolC

Update an existing issue.

Inputs: issue_iid (required), project_id (required), title, labels, +5 more. Returns: object

update_label_toolUpdate Label ToolC

Update an existing label in a GitLab project.

Inputs: label_id (required), project_id (required), color, new_name, +2 more. Returns: object

update_merge_request_toolUpdate Merge Request ToolC

Update an existing merge request.

Inputs: project_id (required), merge_request_iid (required), title, labels, +7 more. Returns: object

update_milestone_toolUpdate Milestone ToolC

Update an existing milestone.

Inputs: project_id (required), milestone_id (required), title, due_date, +3 more. Returns: object

Tool Schema Changelog

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

    TDQS

    C2.9/5.0

    Scored across 63 tools

    Disambiguation4/5

    Most tools target a distinct resource and action, and descriptions clearly distinguish closely related operations such as pipeline vs. job retry/cancel/delete. Minor overlap exists between notes and discussions on merge requests, and between current-user and user-listing tools, but an agent can generally select correctly.

    Naming Consistency4/5

    Names consistently use snake_case with a verb_noun_tool pattern, making the surface predictable. There are small inconsistencies such as `list_mr_notes_tool` using `mr` while other tools spell out `merge_request`, and occasional noun-first forms like `search_global_tool`.

    Tool Count2/5

    Sixty-three tools is very heavy for a single MCP server and risks overwhelming an agent's selection process. While GitLab is broad, the set could be better grouped or scoped into narrower servers or workflows.

    Completeness4/5

    Coverage is extensive across projects, repositories, issues, merge requests, pipelines, labels, wiki, snippets, releases, and search. Notable gaps remain, especially merging a merge request, deleting files, and full lifecycle operations for wiki pages, snippets, releases, and milestones.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server for interacting with GitLab API, supporting both self-hosted instances and gitlab.com. Provides tools for managing issues, merge requests, code review, pipelines, milestones, releases, search, and file access.
      729 npm
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables interacting with GitLab repositories, merge requests, and code through natural language using MCP. Supports authentication with personal access tokens or OAuth2, and provides tools for listing projects, reading repository code, and analyzing merge request lifetimes.
      10
      3
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Exposes the GitLab REST API to MCP clients for managing projects, issues, merge requests, repositories, and CI/CD pipelines. It is multi-tenant, allowing each user to authenticate with their own token and instance URL.
      -