GitLab MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "GITLAB_PERSONAL_ACCESS_TOKEN=${GITLAB_PERSONAL_ACCESS_TOKEN}" gitlab-mcp-server-7e45 -- npx @therealchristhomas/gitlab-mcp-server
Required:GITLAB_PERSONAL_ACCESS_TOKEN
README.md

MCP Server for the GitLab API, enabling project management and file operations.

GitLab MCP Server

MCP Server for the GitLab API, enabling project management, file operations, and more. Forked from https://github.com/modelcontextprotocol

Installation

NPX (Recommended)

npx @therealchristhomas/gitlab-mcp-server

Global Installation

npm install -g @therealchristhomas/gitlab-mcp-server
gitlab-mcp

Features

  • Automatic Branch Creation: When creating/updating files or pushing changes, branches are automatically created if they don't exist
  • Comprehensive Error Handling: Clear error messages for common issues
  • Git History Preservation: Operations maintain proper Git history without force pushing
  • Batch Operations: Support for both single-file and multi-file operations
  • Project Workflow Management: Label and milestone management for better project organization
  • Repository Management: Search, create, and fork GitLab projects
  • File Operations: Create, update, and retrieve file contents
  • Branch Management: Create branches and manage repository structure
  • Issue Management: Create, list, update, search, and comment on issues
  • Merge Request Management: List, update, merge, and comment on merge requests
  • Label Management: Create, update, and delete project labels
  • Project Milestones: Create, update, and delete project-level milestones
  • Group Milestones: Create, update, and delete group-level milestones that span multiple projects

Group Milestones vs Project Milestones

This server supports both project milestones and group milestones:

Project Milestones

  • Scoped to a single project
  • Use tools: list_milestones, create_milestone, update_milestone, delete_milestone
  • Example: Track features for my-webapp project

Group Milestones

  • Span multiple projects within a group
  • Use tools: list_group_milestones, create_group_milestone, update_group_milestone, delete_group_milestone
  • Support advanced filtering with include_ancestors, include_descendants
  • Example: Track a release across my-webapp, my-api, and my-admin

Group Milestone Examples

List Group Milestones

{
  "group_id": "my-organization",
  "state": "active",
  "include_descendants": true
}

Create Group Milestone

{
  "group_id": "my-organization",
  "title": "Q1 2025 Release",
  "description": "Major feature release including new tools and performance improvements",
  "due_date": "2025-03-31",
  "start_date": "2025-01-01"
}

Advanced Group Milestone Search

{
  "group_id": "my-organization/core",
  "search": "release",
  "include_ancestors": true,
  "updated_after": "2024-01-01T00:00:00Z"
}

Based on the GitLab Group Milestones API, group milestones are ideal for coordinating releases and features across multiple projects in your organization.

Practical Workflow: Finding Groups and Creating Milestones

Here's a typical workflow for working with group milestones:

1. Search for Groups

First, find the group you want to work with:

{
  "search": "my-organization",
  "owned": true
}

2. List Existing Group Milestones

Check what milestones already exist:

{
  "group_id": "my-organizatio

Tools (5)

file_operationsCreate, update, and retrieve file contents in GitLab repositories.
repository_managementSearch, create, and fork GitLab projects.
issue_managementCreate, list, update, search, and comment on issues.
merge_request_managementList, update, merge, and comment on merge requests.
milestone_managementCreate, update, and delete project-level and group-level milestones.

Environment Variables

GITLAB_PERSONAL_ACCESS_TOKENrequiredPersonal Access Token for GitLab API authentication

Configuration

claude_desktop_config.json
{"mcpServers": {"gitlab": {"command": "npx", "args": ["-y", "@therealchristhomas/gitlab-mcp-server"], "env": {"GITLAB_PERSONAL_ACCESS_TOKEN": "your_token_here"}}}}

Try it

List all open issues in my 'core-platform' project.
Create a new group milestone for the Q1 2025 release in my organization.
Find all merge requests that need review in the 'web-app' repository.
Create a new branch and update the README.md file in the main repository.

Frequently Asked Questions

What are the key features of GitLab MCP Server?

Automatic branch creation for file operations. Support for both project-level and group-level milestones. Comprehensive issue and merge request management. Batch operations for multi-file updates. Git history preservation without force pushing.

What can I use GitLab MCP Server for?

Coordinating release milestones across multiple projects in a GitLab group. Automating the creation of issues and tracking progress via Claude. Managing repository file structures and documentation updates directly from the chat interface. Streamlining merge request reviews by listing and commenting on pending items.

How do I install GitLab MCP Server?

Install GitLab MCP Server by running: npx @therealchristhomas/gitlab-mcp-server

What MCP clients work with GitLab MCP Server?

GitLab MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep GitLab MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare