Skip to main content
Glama

GitLab MCP Server

A Model Context Protocol (MCP) server that enables you to interact with your GitLab account. Get diffs, analyze merge requests, review code, cherry-pick changes, and more. This is an extended version of the MCP GitLab Server from the Model Context Protocol project.

Features

This MCP server provides comprehensive tools for interacting with GitLab repositories, including:

Core Repository Features

  • Listing projects and retrieving details

  • Managing branches and repositories

  • Working with merge requests and diffs

  • Adding comments and internal notes to merge requests

  • Updating merge request attributes

  • Listing and working with issues

  • Getting and comparing repository file contents

Project Settings & Integrations

  • Managing project integrations and services

  • Configuring and controlling Slack integration

  • Setting up, updating, and testing webhooks

CI/CD Management

  • Working with pipeline trigger tokens

  • Managing CI/CD variables

  • Triggering and controlling pipelines

User & Group Administration

  • Listing and managing users

  • Working with groups and group memberships

  • Managing project members and access levels

Related MCP server: GitLab MCP Server

Installation

Prerequisites

  • Node.js (v16 or higher)

  • npm

  • A GitLab account with an API token

Setup

  1. Clone the repository:

git clone https://github.com/rifqi96/mcp-gitlab.git
cd mcp-gitlab
  1. Install dependencies:

npm install
  1. Build the server:

npm run build
  1. Install git hooks (optional, but recommended for contributors):

npm run install-hooks

This installs a pre-commit hook that automatically regenerates TOOLS.md when src/utils/tools-data.ts changes.

  1. Configure your GitLab API token:

You need to provide your GitLab API token in the MCP settings configuration file. The token is used to authenticate with the GitLab API.

For Cursor/Roo Cline, add the following to your MCP settings file (~/Library/Application Support/Cursor/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json):

{
  "mcpServers": {
    "gitlab": {
      "command": "node",
      "args": [
        "/path/to/mcp-gitlab/build/index.js"
      ],
      "env": {
        "GITLAB_API_TOKEN": "YOUR_GITLAB_API_TOKEN",
        "GITLAB_API_URL": "https://gitlab.com/api/v4"
      }
    }
  }
}

For Claude Desktop, add the following to your MCP settings file (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "gitlab": {
      "command": "node",
      "args": [
        "/path/to/mcp-gitlab/build/index.js"
      ],
      "env": {
        "GITLAB_API_TOKEN": "YOUR_GITLAB_API_TOKEN",
        "GITLAB_API_URL": "https://gitlab.com/api/v4"
      }
    }
  }
}

Replace YOUR_GITLAB_API_TOKEN with your actual GitLab API token. You can generate a token in your GitLab account under Settings > Access Tokens.

Available Tools

For a complete list of available tools and their parameters, see TOOLS.md.

Example Usage

Here are examples of how to use these tools with AI assistants that support MCP:

List your projects

Could you list my GitLab projects?

Get information about a specific merge request

Can you show me the details of merge request with ID 123 in the project 'mygroup/myproject'?

Add a comment to a merge request

Please add a comment to merge request 123 in project 'mygroup/myproject' saying "This looks good, but please add more tests."

Add an internal note to a merge request

Add an internal note to merge request 123 in project 'mygroup/myproject' that says "Needs security review before merging." Make sure it's only visible to team members.

Update a merge request title and description

Update the title of merge request 123 in project 'mygroup/myproject' to "Fix login page performance issues" and update the description to include "This PR addresses the slow loading times on the login page by optimizing database queries."

Compare branches

Compare the 'feature-branch' with 'main' in the project 'mygroup/myproject' and show me the differences.

Practical Workflows

Reviewing a Merge Request

1. Show me merge request 123 in project 'mygroup/myproject'
2. Show me the changes for this merge request
3. Add an internal note with my review comments
4. Update the merge request title to better reflect the changes

Project Exploration

1. List all my GitLab projects
2. Show me the details of project 'mygroup/myproject'
3. List all branches in this project
4. Show me the content of the README.md file in the main branch

Available Resources

gitlab://projects

List of GitLab projects accessible with your API token.

Integration with AI Assistants

The GitLab MCP Server integrates with AI assistants that support the Model Context Protocol (MCP).

Capabilities

When connected to an AI assistant, this server enables the assistant to:

  1. View and analyze code: The assistant can fetch file contents, view branch differences, and examine merge request changes for better code understanding.

  2. Provide code reviews: The assistant can analyze merge requests and provide feedback through comments or internal notes.

  3. Manage project workflows: The assistant can update merge request attributes, add comments, and help with repository management tasks.

  4. Explore project structure: The assistant can browse projects, branches, and files to understand the codebase structure.

  5. Configure CI/CD and integrations: The assistant can help set up webhooks, manage CI/CD variables, and configure project integrations.

Getting the Most from AI Assistant Integration

  • Be specific when asking about projects, merge requests, or files

  • Provide project IDs or paths when possible

  • Use the assistant for code review by asking it to analyze specific merge requests

  • Have the assistant help with repository configuration and management tasks

  • Use internal notes for team-only feedback on merge requests

License

MIT

Available Tools

41 tools
gitlab_add_group_memberC

Add a user to a group

Inputs: access_level (required), group_id (required), user_id (required).

gitlab_add_project_memberC

Add a user to a project

Inputs: access_level (required), project_id (required), user_id (required).

gitlab_add_webhookC

Add a new webhook to a project

Inputs: project_id (required), url (required), enable_ssl_verification, issues_events, +3 more.

gitlab_compare_branchesC

Compare branches, tags or commits

Inputs: from (required), project_id (required), to (required).

gitlab_create_cicd_variableC

Create a new CI/CD variable

Inputs: key (required), project_id (required), value (required), masked, +1 more.

gitlab_create_merge_request_noteC

Add a comment to a merge request

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

gitlab_create_merge_request_note_internalB

Add a comment to a merge request with option to make it an internal note

Inputs: body (required), merge_request_iid (required), project_id (required), internal.

gitlab_create_trigger_tokenC

Create a new pipeline trigger token

Inputs: description (required), project_id (required).

gitlab_delete_cicd_variableC

Delete a CI/CD variable

Inputs: key (required), project_id (required).

gitlab_delete_trigger_tokenC

Delete a pipeline trigger token

Inputs: project_id (required), trigger_id (required).

gitlab_delete_webhookC

Delete a webhook

Inputs: project_id (required), webhook_id (required).

gitlab_disable_slack_integrationC

Disable Slack integration for a project

Inputs: project_id (required).

gitlab_get_cicd_variableB

Get a specific CI/CD variable

Inputs: key (required), project_id (required).

gitlab_get_groupC

Get details of a specific group

Inputs: group_id (required).

gitlab_get_integrationC

Get integration details for a project

Inputs: integration (required), project_id (required).

gitlab_get_merge_requestB

Get details of a specific merge request

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

gitlab_get_merge_request_changesC

Get changes (diff) of a specific merge request

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

gitlab_get_projectC

Get details of a specific GitLab project

Inputs: project_id (required).

gitlab_get_repository_fileC

Get content of a file in a repository

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

gitlab_get_trigger_tokenC

Get details of a pipeline trigger token

Inputs: project_id (required), trigger_id (required).

gitlab_get_userC

Get details of a specific user

Inputs: user_id (required).

gitlab_get_webhookC

Get details of a specific webhook

Inputs: project_id (required), webhook_id (required).

gitlab_list_branchesC

List branches of a GitLab project

Inputs: project_id (required), search.

gitlab_list_cicd_variablesC

List CI/CD variables for a project

Inputs: project_id (required).

gitlab_list_group_membersC

List members of a group

Inputs: group_id (required).

gitlab_list_groupsC

List GitLab groups

Inputs: owned, search.

gitlab_list_integrationsB

List all available project integrations/services

Inputs: project_id (required).

gitlab_list_issuesC

List issues in a GitLab project

Inputs: project_id (required), labels, state.

gitlab_list_merge_requestsC

List merge requests in a GitLab project

Inputs: project_id (required), scope, state.

gitlab_list_project_membersC

List members of a project

Inputs: project_id (required).

gitlab_list_projectsB

List GitLab projects accessible to the user

Inputs: membership, owned, per_page, search.

gitlab_list_trigger_tokensC

List pipeline trigger tokens

Inputs: project_id (required).

gitlab_list_usersC

List GitLab users

Inputs: active, search.

gitlab_list_webhooksC

List webhooks for a project

Inputs: project_id (required).

gitlab_test_webhookC

Test a webhook

Inputs: project_id (required), webhook_id (required).

gitlab_trigger_pipelineC

Trigger a pipeline run

Inputs: project_id (required), ref (required), token (required), variables.

gitlab_update_cicd_variableC

Update a CI/CD variable

Inputs: key (required), project_id (required), value (required), masked, +1 more.

gitlab_update_merge_requestC

Update a merge request title and description

Inputs: merge_request_iid (required), project_id (required), description, title.

gitlab_update_slack_integrationC

Update Slack integration settings for a project

Inputs: project_id (required), webhook (required), channel, username.

gitlab_update_trigger_tokenC

Update a pipeline trigger token

Inputs: description (required), project_id (required), trigger_id (required).

gitlab_update_webhookC

Update an existing webhook

Inputs: project_id (required), url (required), webhook_id (required), enable_ssl_verification, +4 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 41 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting specific resources and actions, but there is some overlap: gitlab_create_merge_request_note and gitlab_create_merge_request_note_internal are nearly identical, differing only in an optional parameter, which could cause confusion. Otherwise, tools are well-differentiated across groups, projects, CI/CD, webhooks, and integrations.

    Naming Consistency5/5

    All tools follow a consistent gitlab_verb_noun pattern with snake_case throughout, such as gitlab_list_projects, gitlab_create_cicd_variable, and gitlab_update_webhook. This uniformity makes the tool set predictable and easy to navigate, with no deviations in style or structure.

    Tool Count3/5

    With 41 tools, the count is high for a GitLab server, bordering on heavy. While it covers many aspects of GitLab's API, it may overwhelm agents with its breadth. A more focused set of 15-25 tools might be more manageable, but it's not extreme like 50+ tools.

    Completeness5/5

    The tool set provides comprehensive coverage for GitLab operations, including CRUD for groups, projects, members, CI/CD variables, webhooks, trigger tokens, and integrations. It supports full lifecycles with create, get, update, delete, and list operations, leaving no obvious gaps for core workflows in the domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      An MCP server that enables communication with GitLab repositories, allowing interaction with GitLab's API to manage projects, issues, and repositories through natural language.
      45
      170,164 npm
      1
      MIT
    • -
      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.
      22 npm
      2
      -
    • 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