GitLab MCP Server — Claude Code MCP server: what it does
Wires GitLab into your agent: projects, merge requests, issues, pipelines, wiki and releases, all callable from chat.
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-gitlabWhat GitLab MCP Server 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.
What it helps with
- 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 for the agent
- 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
How to install GitLab MCP Server
Platform CLI
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-gitlabReplace <…> with your own values. 16 more environment variables are in the server README
Platform CLI
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-gitlabReplace <…> with your own values. 16 more environment variables are in the server README
Config file
{
"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
Config file
{
"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
Platform CLI
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-gitlabReplace <…> with your own values. 16 more environment variables are in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about GitLab MCP Server
How do I install GitLab MCP Server in Claude?
Install the binary first: npm install -g @zereight/mcp-gitlab. Then register the server with `claude mcp add gitlab-mcp -e GITLAB_PERSONAL_ACCESS_TOKEN=<GITLAB_PERSONAL_ACCESS_TOKEN> -e GITLAB_JOB_TOKEN=<GITLAB_JOB_TOKEN> -- npx -y @zereight/mcp-gitlab`.
What does GitLab MCP Server do?
It hands your agent GitLab tools covering projects, merge requests, issues, pipelines, wiki and releases. The agent calls them in chat, so you stop pasting URLs and diffs by hand.
Can I use GitLab without MCP?
Yes. There is a skill, gitlab-mcp-skill, plus the zereight-mcp-gitlab CLI. The terminal path returns full payloads and is never compacted.