MCP Hub
Back to servers

gitlab-mcp

MCP server for interacting with GitLab API, supporting both self-hosted instances and gitlab.com. Provides tools for managing issues, merge requests, code review, pipelines, milestones, releases, search, and file access.

glama
Updated
Apr 20, 2026

gitlab-mcp

MCP server for GitLab API. Works with self-hosted GitLab instances and gitlab.com.

Provides tools for issues, merge requests, code review, pipelines, milestones, releases, search, and file access.

Prerequisites

  • Node.js >= 18
  • npm
  • GitLab Personal Access Token with api scope

Installation

git clone <repo-url> gitlab-mcp
cd gitlab-mcp
npm install
npm run build

Configuration

Create config.json in the project root:

{
  "token": "glpat-your-token-here",
  "apiUrl": "https://your-gitlab-instance.com/api/v4"
}

For gitlab.com, use "apiUrl": "https://gitlab.com/api/v4" or omit the field entirely.

Alternatively, set environment variables instead of using config.json:

export GITLAB_PERSONAL_ACCESS_TOKEN="glpat-your-token-here"
export GITLAB_API_URL="https://your-gitlab-instance.com/api/v4"

Creating a GitLab token

  1. Go to GitLab > Settings > Access Tokens
  2. Create a token with api scope
  3. Copy the token into config.json

Adding to Claude Code

Add the server to your Claude Code MCP settings (~/.claude/settings.json or project-level .claude/settings.local.json):

{
  "mcpServers": {
    "gitlab": {
      "command": "node",
      "args": ["/absolute/path/to/gitlab-mcp/index.js"]
    }
  }
}

Restart Claude Code or run /mcp to connect.

Available tools

Issues

ToolDescription
gitlab_get_issueGet a single issue by project and IID
gitlab_list_group_issuesList issues in a group with filters (state, labels, assignee, search, milestone)
gitlab_list_milestone_issuesList issues in a milestone
gitlab_create_issueCreate a new issue
gitlab_update_issueUpdate issue (state, title, description, labels, assignee, milestone)
gitlab_add_commentAdd a comment to an issue

Merge Requests

ToolDescription
gitlab_list_merge_requestsList MRs with filters (state, author, reviewer, assignee, date, target branch). Project is optional — omit for cross-project search.
gitlab_get_merge_requestGet a single MR by project and IID
gitlab_get_mr_changesGet the diff / changed files of an MR
gitlab_list_mr_notesList comments/notes on an MR
gitlab_add_mr_noteAdd a general comment to an MR
gitlab_create_mr_discussionCreate an inline diff comment on a specific file and line

Projects, Milestones, Releases

ToolDescription
gitlab_list_projectsList projects in a group
gitlab_list_milestonesList milestones in a group
gitlab_list_releasesList releases for a project

Search & Files

ToolDescription
gitlab_searchSearch within a project (code, issues, MRs, commits, notes)
gitlab_get_fileGet file contents from a repository
gitlab_list_pipelinesList CI/CD pipelines with filters (status, ref)

Generic escape hatch

ToolDescription
gitlab_api_requestCall any GitLab REST API endpoint directly. Use when no dedicated tool exists. Takes method (GET/POST/PUT/PATCH/DELETE), path (e.g. /projects/93/merge_requests/2387/notes/74875), and optional body.

Example — edit an existing MR note:

gitlab_api_request({
  method: "PUT",
  path: "/projects/93/merge_requests/2387/notes/74875",
  body: { body: "Updated comment text" }
})

Example usage in Claude Code

> Review MR !2397 in octopus/reunion/client

Claude will use gitlab_get_merge_request, gitlab_get_mr_changes,
and gitlab_create_mr_discussion to review and leave inline comments.

Development

# Edit index.ts, then rebuild
npm run build

# Reconnect in Claude Code
/mcp

Reviews

No reviews yet

Sign in to write a review