# GitLab MCP Server

Wires GitLab into your agent: projects, merge requests, issues, pipelines, wiki and releases, all callable from chat.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 2065
- Author: zereight
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/zereight/gitlab-mcp
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/gitlab-mcp-server

## What it does

The server exposes GitLab API operations as agent tools. You get 40 tools by default — 38 core plus `discover_tools` and `help`. Another 278 live in toolsets and can be pulled in per session with `discover_tools`. Leave the `api` toolset off unless you accept its bypass risk.

Install the `zereight-mcp-gitlab` binary first: `npm install -g @zereight/mcp-gitlab`, Homebrew, or a one-off `npx -y @zereight/mcp-gitlab@latest`. Then register it with your client — `claude mcp add` for Claude, `codex mcp add` for Codex, a JSON block for Cursor and Copilot. Auth is a token: `GITLAB_PERSONAL_ACCESS_TOKEN` is the simplest locally, `GITLAB_PERSONAL_ACCESS_TOKEN_FILE` reads it from disk, and OAuth is available too.

Project paths go in as `project_id=group%2Fproject`; nested groups need `%2F` between every segment, and merge requests use `merge_request_iid=123`. There is also a non-MCP route: a skill plus the CLI, where the terminal returns full payloads instead of compacted ones. Destructive tools want `--yes`.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `GITLAB_PERSONAL_ACCESS_TOKEN`, `GITLAB_PERSONAL_ACCESS_TOKEN_FILE`, `GITLAB_JOB_TOKEN`, `GITLAB_AUTH_COOKIE_PATH`, `GITLAB_USE_OAUTH`, `GITLAB_OAUTH_CLIENT_ID`, `GITLAB_OAUTH_TOKEN_SCRIPT`, `GITLAB_API_URL`, `GITLAB_ALLOWED_PROJECT_IDS`, `GITLAB_PERMISSION_MODE` — keys and tokens: ask the human for the values, never commit them or put them in shared files.
- Works with: GitLab

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env GITLAB_PERSONAL_ACCESS_TOKEN=<GITLAB_PERSONAL_ACCESS_TOKEN> --env GITLAB_PERSONAL_ACCESS_TOKEN_FILE=<GITLAB_PERSONAL_ACCESS_TOKEN_FILE> --env GITLAB_JOB_TOKEN=<GITLAB_JOB_TOKEN> --env GITLAB_AUTH_COOKIE_PATH=<GITLAB_AUTH_COOKIE_PATH> --env GITLAB_USE_OAUTH=<GITLAB_USE_OAUTH> --transport stdio gitlab-mcp-server -- npx -y @zereight/mcp-gitlab
```
Replace <…> with your own values. 16 more environment variables are in the server README

### Codex

**Platform CLI**
```bash
codex mcp add gitlab-mcp-server --env GITLAB_PERSONAL_ACCESS_TOKEN=<GITLAB_PERSONAL_ACCESS_TOKEN> --env GITLAB_PERSONAL_ACCESS_TOKEN_FILE=<GITLAB_PERSONAL_ACCESS_TOKEN_FILE> --env GITLAB_JOB_TOKEN=<GITLAB_JOB_TOKEN> --env GITLAB_AUTH_COOKIE_PATH=<GITLAB_AUTH_COOKIE_PATH> --env GITLAB_USE_OAUTH=<GITLAB_USE_OAUTH> -- npx -y @zereight/mcp-gitlab
```
Replace <…> with your own values. 16 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "gitlab-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@zereight/mcp-gitlab"
            ],
            "env": {
                "GITLAB_PERSONAL_ACCESS_TOKEN": "<GITLAB_PERSONAL_ACCESS_TOKEN>",
                "GITLAB_PERSONAL_ACCESS_TOKEN_FILE": "<GITLAB_PERSONAL_ACCESS_TOKEN_FILE>",
                "GITLAB_JOB_TOKEN": "<GITLAB_JOB_TOKEN>",
                "GITLAB_AUTH_COOKIE_PATH": "<GITLAB_AUTH_COOKIE_PATH>",
                "GITLAB_USE_OAUTH": "<GITLAB_USE_OAUTH>"
            }
        }
    }
}
```
Replace <…> with your own values. 16 more environment variables are in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "gitlab-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@zereight/mcp-gitlab"
            ],
            "env": {
                "GITLAB_PERSONAL_ACCESS_TOKEN": "<GITLAB_PERSONAL_ACCESS_TOKEN>",
                "GITLAB_PERSONAL_ACCESS_TOKEN_FILE": "<GITLAB_PERSONAL_ACCESS_TOKEN_FILE>",
                "GITLAB_JOB_TOKEN": "<GITLAB_JOB_TOKEN>",
                "GITLAB_AUTH_COOKIE_PATH": "<GITLAB_AUTH_COOKIE_PATH>",
                "GITLAB_USE_OAUTH": "<GITLAB_USE_OAUTH>"
            }
        }
    }
}
```
Replace <…> with your own values. 16 more environment variables are in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e GITLAB_PERSONAL_ACCESS_TOKEN=<GITLAB_PERSONAL_ACCESS_TOKEN> -e GITLAB_PERSONAL_ACCESS_TOKEN_FILE=<GITLAB_PERSONAL_ACCESS_TOKEN_FILE> -e GITLAB_JOB_TOKEN=<GITLAB_JOB_TOKEN> -e GITLAB_AUTH_COOKIE_PATH=<GITLAB_AUTH_COOKIE_PATH> -e GITLAB_USE_OAUTH=<GITLAB_USE_OAUTH> gitlab-mcp-server npx -y @zereight/mcp-gitlab
```
Replace <…> with your own values. 16 more environment variables are in the server README

## When to use it
- review changed files and diffs in a merge request
- pull the log of a failed pipeline job
- file an issue or edit the wiki from chat
- check a project's releases without the browser
- resolve a project by its nested group path

## Example prompts
- List the changed files in merge request !123 of project group%2Fproject
- Fetch the log of the last failed pipeline job
- Open an issue in group%2Fsubgroup%2Fproject describing the bug

## Similar
- [gitlab-workflow](https://affpapa.org/en/nevibecode/skills/gitlab-workflow.md) — skill · 1100 installs
- [gitlab](https://affpapa.org/en/nevibecode/plugins/gitlab.md) — plugin · ★ 44635
- [gitlab-cli-skills](https://affpapa.org/en/nevibecode/skills/gitlab-cli-skills.md) — skill · 1900 installs
- [cyrus-setup-gitlab](https://affpapa.org/en/nevibecode/skills/cyrus-setup-gitlab.md) — skill · 785 installs
- [gitlab-cicd-pipeline](https://affpapa.org/en/nevibecode/skills/gitlab-cicd-pipeline.md) — skill · 664 installs
- [gitlab-ci-patterns](https://affpapa.org/en/nevibecode/skills/gitlab-ci-patterns.md) — skill · 13112 installs

## Other versions with the same name
- [GitLab MCP Server · jmrplens](https://affpapa.org/en/nevibecode/mcp/jmrplens-gitlab-mcp-server.md) — ★ 45

From the same set: [zereight/gitlab-mcp](https://affpapa.org/en/nevibecode/by/zereight/gitlab-mcp.md) — 2 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
