Feedback

GitLab MCP Server (harshmaur/gitlab-mcp) Featured

@harshmaur Claim

Basic information

Runtime
JavaScript
Version
1.0.0
Category
License
MIT
Transports
stdio
Author
harshmaur
Submitted by
Community
Quality
25
Stars
1

About GitLab MCP Server

Integrate with GitLab for seamless repository management, file operations, CI/CD, issue tracking, and merge requests via TypeScript and API.

GitLab is a MCP server in the Developer Tools category listed in the AddMCP.net directory, published by harshmaur. It exposes 9 tools, including create_or_update_file, search_repositories, create_repository, get_file_contents and more. Supported transport: stdio. Runtime: JavaScript. License: MIT. The repository has 1 GitHub stars. Source code is hosted on github.com. Related topics: api, community, developer-tools, gitlab, productivity.

Setup

{
    "mcpServers": {
        "GitLab communication server": {
            "command": "npx",
            "args": [
                "-y",
                "@zereight/mcp-gitlab"
            ],
            "env": {
                "GITLAB_PERSONAL_ACCESS_TOKEN": "your_gitlab_token",
                "GITLAB_API_URL": "your_gitlab_api_url",
                "GITLAB_READ_ONLY_MODE": "false",
                "USE_GITLAB_WIKI": "false",
                "USE_MILESTONE": "false",
                "USE_PIPELINE": "false"
            }
        }
    }
}

GitLab MCP Server (harshmaur/gitlab-mcp) config

Add this server to your MCP-compatible client using the configuration below.

{
    "mcpServers": {
        "GitLab communication server": {
            "command": "npx",
            "args": [
                "-y",
                "@zereight/mcp-gitlab"
            ],
            "env": {
                "GITLAB_PERSONAL_ACCESS_TOKEN": "your_gitlab_token",
                "GITLAB_API_URL": "your_gitlab_api_url",
                "GITLAB_READ_ONLY_MODE": "false",
                "USE_GITLAB_WIKI": "false",
                "USE_MILESTONE": "false",
                "USE_PIPELINE": "false"
            }
        }
    }
}

GitLab MCP Server (harshmaur/gitlab-mcp) tools

  • create_or_update_file — Create or update a single file in a GitLab project
    branch:string*, commit_message:string*, content:string*, file_path:string*, previous_path:string, project_id:string*
  • search_repositories — Search for GitLab projects
    page:number, per_page:number, search:string*
  • create_repository — Create a new GitLab project
    description:string, initialize_with_readme:boolean, name:string*, visibility:string
  • get_file_contents — Get the contents of a file or directory from a GitLab project
    file_path:string*, project_id:string*, ref:string
  • push_files — Push multiple files to a GitLab project in a single commit
    branch:string*, commit_message:string*, files:array*, project_id:string*
  • create_issue — Create a new issue in a GitLab project
    assignee_ids:array, description:string, labels:array, milestone_id:number, project_id:string*, title:string*
  • create_merge_request — Create a new merge request in a GitLab project
    allow_collaboration:boolean, description:string, draft:boolean, project_id:string*, source_branch:string*, target_branch:string*, title:string*
  • fork_repository — Fork a GitLab project to your account or specified namespace
    namespace:string, project_id:string*
  • create_branch — Create a new branch in a GitLab project
    branch:string*, project_id:string*, ref:string

Overview

What is GitLab?

GitLab MCP Server is a gitlab mcp integration that lets AI assistants search projects, read files, push commits, and open issues, branches, forks and merge requests through the GitLab API. This listing is the archived reference version; GitLab now ships an official, maintained MCP server.

The listed package, @modelcontextprotocol/server-gitlab, was one of the reference servers published by the Model Context Protocol project. It has moved to the servers-archived repository, which states that the servers there are no longer maintained and come with no security guarantees, and the npm package is marked as no longer supported. For new setups, use the official GitLab MCP server, a remote endpoint built into GitLab itself at /api/v4/mcp. Both options are covered below.

How to use GitLab?

Official GitLab MCP server (recommended)

Prerequisites: access to the MCP server must be allowed for your top-level group on GitLab.com, or for the instance on GitLab Self-Managed and GitLab Dedicated. Authentication uses OAuth: on first connect the client registers itself (OAuth 2.0 Dynamic Client Registration), opens your browser, and you approve the request. The server also accepts a fine-grained personal access token with the MCP tool permission, but not legacy personal, project or group access tokens.

Replace <gitlab.example.com> with gitlab.com or your self-managed instance URL in the examples below.

Claude Code

claude mcp add -s user --transport http GitLab https://<gitlab.example.com>/api/v4/mcp

Start claude, type /mcp, select the GitLab server and approve the authorization in your browser.

Claude Desktop

Requires Node.js 20 or later. Add this to claude_desktop_config.json and restart Claude Desktop:

{
  "mcpServers": {
    "GitLab": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://<gitlab.example.com>/api/v4/mcp"]
    }
  }
}

Cursor

In Settings > Cursor Settings > Tools & MCP, add a new MCP server to mcp.json:

{
  "mcpServers": {
    "GitLab": {
      "type": "http",
      "url": "https://<gitlab.example.com>/api/v4/mcp"
    }
  }
}

VS Code

Open the Command Palette, run MCP: Add Server, choose HTTP, enter https://<gitlab.example.com>/api/v4/mcp with the ID GitLab, then approve the OAuth request.

Codex

codex mcp add GitLab --url "https://<gitlab.example.com>/api/v4/mcp"
codex mcp login GitLab

GitLab's docs also ask you to enable rmcp_client under [features] in ~/.codex/config.toml.

Archived reference server (the config on this page)

Create a GitLab personal access token with the api scope (or read_api for read-only access), then run the package with npx:

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

GITLAB_API_URL is optional and only needed for self-hosted instances. The README also documents a Docker image, mcp/gitlab.

Key features of GitLab

  • Official server is built into GitLab and available on Free, Premium and Ultimate for GitLab.com, Self-Managed and Dedicated; it became generally available in GitLab 19.5.
  • No local install for HTTP clients: connect to https://<instance>/api/v4/mcp and sign in with OAuth.
  • Tool groups (toolsets) such as core, merge_requests, work_items, repository and ci, selectable with the X-Gitlab-Enabled-Mcp-Server-Toolsets header.
  • Optional tool-name prefix through the X-Gitlab-Mcp-Server-Tool-Name-Prefix header, useful when you connect several GitLab instances.
  • Every tool call checks your own project and namespace permissions.
  • The archived server creates missing branches automatically when creating or updating files, and supports single-file and multi-file commits without force pushing.

GitLab tools

The archived reference server exposes the nine tools listed on this page:

  • Repository and files: search_repositories, create_repository, fork_repository, create_branch, get_file_contents.
  • Commits: create_or_update_file writes one file, and push_files pushes several files in a single commit.
  • Collaboration: create_issue and create_merge_request (with draft support).

The official GitLab MCP server has a much larger, maintained set, including get_merge_request_diffs, save_merge_request_review, list_pipelines, get_job, list_work_items, semantic_search and vulnerability tools on Ultimate. See GitLab's MCP server tools documentation for the current list.

Use cases of GitLab

  • Code review: "Summarize the diff in merge request !42 and list risky changes."
  • Issue triage: "Create an issue in my-group/api titled 'Login timeout' with the label bug."
  • Small fixes from chat: "Create a branch fix-readme, update README.md and open a draft merge request."
  • CI debugging (official server): "Why did the latest pipeline on main fail? Show the failing job log."
  • Codebase questions: "Read src/config.ts on the develop branch and explain the defaults."

Frequently asked questions

1 Is there an official GitLab MCP server?

Yes. GitLab ships its own MCP server at /api/v4/mcp on GitLab.com, Self-Managed and Dedicated. The @modelcontextprotocol/server-gitlab package listed here is an archived reference implementation, not GitLab's product.

2 Is the GitLab MCP server free?

GitLab's docs list the official server for the Free, Premium and Ultimate tiers. Some toolsets need paid features, for example vulnerability tools require Ultimate. The archived package is MIT-licensed open source.

3 Is @modelcontextprotocol/server-gitlab still maintained?

No. It now lives in the servers-archived repository, which says it receives no updates or security fixes, and npm marks the package as no longer supported.

4 Which token or API key do I need?

The official server uses OAuth through your browser, or a fine-grained personal access token with the MCP tool permission. The archived server needs a personal access token in GITLAB_PERSONAL_ACCESS_TOKEN.

5 Does the GitLab MCP server work with Claude Code, Cursor and VS Code?

Yes. GitLab documents setup for Claude Code, Claude Desktop, Cursor, GitHub Copilot in VS Code, Codex, Gemini CLI, Kiro, OpenCode, Zed and Amazon Q Developer.

6 Is it remote or local?

The official gitlab mcp server is remote over HTTP; clients without HTTP support use the mcp-remote proxy over stdio. The archived server runs locally over stdio through npx or Docker.

7 Does it work with self-hosted GitLab?

Yes. Point the official server URL at your instance, or set GITLAB_API_URL for the archived server.

8 Is it safe to give an AI agent GitLab access?

Tools act with your permissions, so the agent can only reach what you can. GitLab warns that you are responsible for guarding against prompt injection, so use the tools only on GitLab content you trust.

Videos

Tutorials, guides, and showcases related to GitLab MCP Server (harshmaur/gitlab-mcp). The player loads when you press play.

Videos belong to their creators. Relevance is approximate; check the channel and description before following setup steps.

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬