# mcp-gitlab

Connect an AI agent to GitLab projects, merge requests, pipelines, and issues. A read-only setting removes write tools from the server.

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

## What it does

mcp-gitlab connects an agent to the GitLab REST API. It can work with projects, merge requests, pipelines, CI/CD variables, approvals, and issues, and assist with code reviews. The server supports GitLab.com and self-hosted GitLab CE/EE instances.

Run it with `uvx mcp-gitlab`. You need `uv`, a GitLab instance address in `GITLAB_URL`, and a token in `GITLAB_TOKEN`; other token environment variables and sign-in through `mcp-gitlab auth login` are supported too. Set `MCP_READ_ONLY=true` to keep write tools and write-workflow prompts out of the agent’s available options. That setting prevents the agent from making changes through this server.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `GITLAB_TOKEN`, `GITLAB_URL`, `GITLAB_READ_ONLY`, `MCP_READ_ONLY`, `GITLAB_AUTH`, `GITLAB_OAUTH_CLIENT_ID`, `GITLAB_OAUTH_CLIENT_SECRET`, `GITLAB_OAUTH_BASE_URL`, `GITLAB_OAUTH_SCOPES`, `GITLAB_OAUTH_JWT_KEY` — 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 mcp-gitlab -e GITLAB_TOKEN=<GITLAB_TOKEN> -e GITLAB_URL=<GITLAB_URL> -e GITLAB_OAUTH_CLIENT_SECRET=<GITLAB_OAUTH_CLIENT_SECRET> -e GITLAB_OAUTH_JWT_KEY=<GITLAB_OAUTH_JWT_KEY> -e GITLAB_HTTP_BEARER_TOKEN=<GITLAB_HTTP_BEARER_TOKEN> -- uvx mcp-gitlab
```
Replace <…> with your own values. 6 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-gitlab <command>

### Codex

**Platform CLI**
```bash
codex mcp add mcp-gitlab --env GITLAB_TOKEN=<GITLAB_TOKEN> --env GITLAB_URL=<GITLAB_URL> --env GITLAB_READ_ONLY=<GITLAB_READ_ONLY> --env MCP_READ_ONLY=<MCP_READ_ONLY> --env GITLAB_AUTH=<GITLAB_AUTH> -- uvx mcp-gitlab
```
Replace <…> with your own values. 6 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-gitlab <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp-gitlab": {
            "command": "uvx",
            "args": [
                "mcp-gitlab"
            ],
            "env": {
                "GITLAB_TOKEN": "<GITLAB_TOKEN>",
                "GITLAB_URL": "<GITLAB_URL>",
                "GITLAB_READ_ONLY": "<GITLAB_READ_ONLY>",
                "MCP_READ_ONLY": "<MCP_READ_ONLY>",
                "GITLAB_AUTH": "<GITLAB_AUTH>"
            }
        }
    }
}
```
Replace <…> with your own values. 6 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-gitlab <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp-gitlab": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "mcp-gitlab"
            ],
            "env": {
                "GITLAB_TOKEN": "<GITLAB_TOKEN>",
                "GITLAB_URL": "<GITLAB_URL>",
                "GITLAB_READ_ONLY": "<GITLAB_READ_ONLY>",
                "MCP_READ_ONLY": "<MCP_READ_ONLY>",
                "GITLAB_AUTH": "<GITLAB_AUTH>"
            }
        }
    }
}
```
Replace <…> with your own values. 6 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-gitlab <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e GITLAB_TOKEN=<GITLAB_TOKEN> -e GITLAB_URL=<GITLAB_URL> -e GITLAB_READ_ONLY=<GITLAB_READ_ONLY> -e MCP_READ_ONLY=<MCP_READ_ONLY> -e GITLAB_AUTH=<GITLAB_AUTH> mcp-gitlab uvx mcp-gitlab
```
Replace <…> with your own values. 6 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-gitlab <command>

## When to use it
- browse GitLab projects
- inspect merge requests and approvals
- investigate a failed CI/CD pipeline
- manage issues and CI/CD variables
- review code with an AI agent

## Example prompts
- Find the GitLab project for this repository and show its open merge requests.
- Inspect the latest pipeline failure and summarize the related issues.
- Review this merge request and identify unresolved feedback.

## Similar
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [Oh My Posh Validator](https://affpapa.org/en/nevibecode/mcp/oh-my-posh-validator.md) — MCP server · ★ 23654
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18779
- [Coder](https://affpapa.org/en/nevibecode/mcp/coder.md) — MCP server · ★ 17191
- [mcp](https://affpapa.org/en/nevibecode/mcp/kubeshark-mcp.md) — MCP server · ★ 12110

---
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
