MCP Connector

Integrate with GitLab for Code Management

MCP server for GitLab - file operations, merge requests, issues, repository search, and branch/fork management.

Works with gitlab

90
Spark score
out of 100
Updated 7 months ago
Version 1.0.0
Models
universal

Add to Favorites

Why it matters

Streamline your development lifecycle by integrating directly with GitLab. Manage projects, code, and merge requests programmatically to automate common tasks.

Outcomes

What it gets done

01

Create and update files within GitLab projects.

02

Automate the creation of merge requests and branches.

03

Search for repositories and create new projects.

04

Manage issues, including assignment and labeling.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-gitlab | bash

Capabilities

Tools your agent gets

create_or_update_file

Create or update a single file in a project.

push_files

Push multiple files in a single commit.

search_repositories

Search for GitLab projects.

create_repository

Create a new GitLab project.

get_file_contents

Get contents of a file or directory.

create_issue

Create a new issue with title, description, assignees, and labels.

create_merge_request

Create a new merge request between branches.

fork_repository

Fork a project to your namespace.

create_branch

Create a new branch from a source ref.

Overview

GitLab MCP

An MCP server for GitLab - file operations, issue and merge-request management, repository search, and branch/fork management, working against GitLab.com or self-hosted instances. Use it when an AI assistant needs to operate on GitLab projects directly, not for GitHub integration.

What it does

This MCP server provides comprehensive integration with GitLab's API, enabling project management, file operations, and merge requests directly from an AI assistant. Features include automatic branch creation (branches are created automatically if they don't exist), comprehensive error handling with clear messages for common issues, Git history preservation across operations, and batch operations supporting both single-file and multi-file changes in one commit.

When to use - and when NOT to

Use it when an AI assistant needs to read or write GitLab project files, manage issues and merge requests, or search, fork, and branch GitLab repositories. It works against both GitLab.com and self-hosted GitLab instances by pointing GITLAB_API_URL at the instance's own API endpoint. It is not a GitHub integration - it is scoped specifically to the GitLab API. This server is one of the official Model Context Protocol reference implementations, now maintained in the modelcontextprotocol/servers-archived repository, which is archived and no longer receiving updates.

Capabilities

Nine tools are exposed: create_or_update_file (create or update a single file in a project), push_files (push multiple files in a single commit), search_repositories (search for GitLab projects), create_repository (create a new GitLab project), get_file_contents (get contents of a file or directory), create_issue (create an issue with title, description, assignees, and labels), create_merge_request (create a merge request between branches), fork_repository (fork a project to your namespace), and create_branch (create a new branch from a source ref). A usage example shows asking the assistant to create a merge request in a named project from a feature branch to main with a description of the changes.

How to install

npm install -g @modelcontextprotocol/server-gitlab

Then register it in your Claude Code settings:

{
  "mcpServers": {
    "gitlab": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-gitlab"],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "your_token_here",
        "GITLAB_API_URL": "https://gitlab.com/api/v4"
      }
    }
  }
}

Authentication requires a GitLab Personal Access Token scoped to api (full API access), read_api (read-only access), or read_repository/write_repository (repository operations), depending on which tools are needed.

Who it's for

Developers whose AI assistant needs to manage GitLab projects, files, issues, and merge requests directly.

Source README

The GitLab MCP server provides comprehensive integration with GitLab's API, enabling project management, file operations, merge requests, and more.

Installation

npm install -g @modelcontextprotocol/server-gitlab

Configuration

Add to your Claude Code settings:

{
  "mcpServers": {
    "gitlab": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-gitlab"],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "your_token_here",
        "GITLAB_API_URL": "https://gitlab.com/api/v4"
      }
    }
  }
}

Self-Hosted GitLab

For self-hosted instances, change GITLAB_API_URL to your instance's API endpoint.

Available Tools

create_or_update_file

Create or update a single file in a project.

push_files

Push multiple files in a single commit.

search_repositories

Search for GitLab projects.

create_repository

Create a new GitLab project.

get_file_contents

Get contents of a file or directory.

create_issue

Create a new issue with title, description, assignees, and labels.

create_merge_request

Create a new merge request between branches.

fork_repository

Fork a project to your namespace.

create_branch

Create a new branch from a source ref.

Features

  • Automatic Branch Creation: Branches are created automatically if they don't exist
  • Comprehensive Error Handling: Clear error messages for common issues
  • Git History Preservation: Operations maintain proper Git history
  • Batch Operations: Support for both single-file and multi-file operations

Authentication

Create a GitLab Personal Access Token with the following scopes:

  • api - Full API access
  • read_api - Read-only access
  • read_repository and write_repository - Repository operations

Usage Example

Claude, create a new merge request in my-project from
feature-branch to main with a description of the changes.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.