GitLab MCP Server

$npx @therealchristhomas/gitlab-mcp-server
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)

list_milestonesList project-level milestones for a specific project.
create_milestoneCreate a new project-level milestone.
list_group_milestonesList group-level milestones that span multiple projects.
create_group_milestoneCreate a new group-level milestone for coordinating across projects.
search_groupsSearch for GitLab groups to find group IDs.

Environment Variables

GITLAB_PERSONAL_ACCESS_TOKENrequiredPersonal access token for GitLab API authentication
GITLAB_API_URLBase URL for the GitLab API (defaults to https://gitlab.com/api/v4)

Configuration

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

Try it

Search for a GitLab group named 'my-organization' and list its active milestones.
Create a new group milestone called 'Q1 2025 Release' for the group 'core-team'.
List all issues and merge requests associated with the project 'web-app'.
Create a new branch and update the README.md file in the 'backend-api' repository.
Find all project-level milestones for project ID 12345.

Frequently Asked Questions

What are the key features of GitLab MCP Server?

Automatic Branch Creation: Branches are automatically created when pushing changes if they don't exist.. Group Milestone Management: Create and track milestones that span multiple projects within an organization.. Comprehensive Repository Operations: Support for searching, creating, forking, and managing file contents.. Issue and MR Tracking: Full lifecycle management for issues and merge requests including comments.. Git History Preservation: Operations maintain proper Git history without requiring force pushes..

What can I use GitLab MCP Server for?

Coordinating large-scale releases across multiple repositories using Group Milestones.. Automating documentation updates across several GitLab projects simultaneously.. Managing project labels and milestones programmatically to maintain organizational standards.. Streamlining the creation of issues and merge requests directly from an AI chat interface.. Searching and exploring large GitLab organizations to find specific groups or projects..

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.

Use GitLab MCP Server with Conare

Manage MCP servers visually, upload persistent context, and never start from zero with Claude Code & Codex.

Try Free