GitLab MCP server

Official hosted integration providing secure access to GitLab projects, issues, merge requests, and CI/CD pipelines through OAuth 2.0
Back to servers
Setup instructions
Provider
GitLab
Release date
Oct 02, 2011
Language
Go
Stats
24.2K stars

GitLab is a comprehensive platform for managing Git repositories with fine-grained access controls, code reviews through merge requests, continuous integration/deployment pipelines, issue tracking, and wikis. Used by over 100,000 organizations, GitLab offers a complete solution for code collaboration whether self-hosted or cloud-based.

Requirements

To run GitLab, your system must meet the following requirements:

  • Operating System: Ubuntu, Debian, CentOS, RHEL, or OpenSUSE
  • Ruby (MRI) 3.2.5
  • Git 2.33+
  • Redis 6.0+
  • PostgreSQL 16.5+

For detailed system requirements and information about supported operating systems, visit the comprehensive requirements documentation at GitLab Requirements.

Installation Options

Omnibus Package Installation (Recommended)

The easiest and most reliable way to install GitLab is using the Omnibus packages:

  1. Select your operating system
  2. Download the appropriate package (Debian or RPM)
  3. Install it using your system's package manager
# For Debian/Ubuntu systems
sudo apt update
sudo apt install gitlab-ee

# For RHEL/CentOS systems
sudo yum install gitlab-ee

This method is faster and less error-prone than compiling from source.

Other Installation Methods

For alternative installation methods or specific environments, visit GitLab Installation Options.

Configuration

After installation, you'll need to configure GitLab:

  1. Edit the GitLab configuration file:
sudo vim /etc/gitlab/gitlab.rb
  1. At minimum, set the external URL:
external_url 'https://gitlab.example.com'
  1. Apply the configuration changes:
sudo gitlab-ctl reconfigure

Basic Settings

Some important configuration options include:

  • SMTP email settings
  • LDAP authentication
  • Backup settings
  • Storage paths

Example SMTP configuration:

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.server.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "smtp_user"
gitlab_rails['smtp_password'] = "smtp_password"
gitlab_rails['smtp_domain'] = "example.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true

Upgrading

To update your GitLab installation:

  1. For Omnibus installations:
# Debian/Ubuntu
sudo apt update
sudo apt install gitlab-ee

# RHEL/CentOS
sudo yum install gitlab-ee
  1. After package update, run:
sudo gitlab-ctl reconfigure

For detailed upgrade instructions and considerations, visit GitLab Upgrade Guide.

GitLab Editions

GitLab offers three editions:

  • Community Edition (CE): Free and open-source under the MIT license
  • Enterprise Edition (EE): Includes additional features for larger organizations
  • JiHu Edition (JH): Tailored for the Chinese market

For feature comparisons between editions, see GitLab Pricing.

Getting Help

If you encounter issues with your GitLab installation or need assistance:

For enterprise customers, you can access official support by becoming a subscriber.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "gitlab" '{"command":"npx","args":["-y","gitlab"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "gitlab": {
            "command": "npx",
            "args": [
                "-y",
                "gitlab"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "gitlab": {
            "command": "npx",
            "args": [
                "-y",
                "gitlab"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later