Back to MCP Servers
🧩

GitLab MCP Server

API key required

GitLab MCP server for projects, merge requests, issues, pipelines, wiki, releases, and more.

To add GitLab MCP Server to Claude, run the install command below or copy the ready-made config for Claude Code, Claude Desktop, Cursor and VS Code further down. Restart your client after adding it and its tools show up in your next conversation. It needs 21 environment variables, listed below.

DevTools

Install

npx -y @zereight/mcp-gitlab@2.3.19

Environment variables

GITLAB_PERSONAL_ACCESS_TOKENSet in your MCP config
GITLAB_PERSONAL_ACCESS_TOKEN_FILESet in your MCP config
GITLAB_JOB_TOKENSet in your MCP config
GITLAB_AUTH_COOKIE_PATHSet in your MCP config
GITLAB_USE_OAUTHSet in your MCP config
GITLAB_OAUTH_CLIENT_IDSet in your MCP config
GITLAB_OAUTH_TOKEN_SCRIPTSet in your MCP config
GITLAB_API_URLSet in your MCP config
GITLAB_ALLOWED_PROJECT_IDSSet in your MCP config
GITLAB_PERMISSION_MODESet in your MCP config
GITLAB_TOOLSETSSet in your MCP config
GITLAB_TOOLSSet in your MCP config
GITLAB_DENIED_TOOLS_REGEXSet in your MCP config
GITLAB_TOOL_POLICY_APPROVESet in your MCP config
GITLAB_TOOL_POLICY_HIDDENSet in your MCP config
NODE_TLS_REJECT_UNAUTHORIZEDSet in your MCP config
GITLAB_CA_CERT_PATHSet in your MCP config
GITLAB_MASKING_ENABLEDSet in your MCP config
GITLAB_MASKING_CONFIGSet in your MCP config
GITLAB_MASKING_POLICY_FILESet in your MCP config
GITLAB_MASKING_WORKSPACE_DIRSet in your MCP config

Install with your client

Terminal
claude mcp add gitlab --env GITLAB_PERSONAL_ACCESS_TOKEN=<YOUR_GITLAB_PERSONAL_ACCESS_TOKEN> --env GITLAB_PERSONAL_ACCESS_TOKEN_FILE=<YOUR_GITLAB_PERSONAL_ACCESS_TOKEN_FILE> --env GITLAB_JOB_TOKEN=<YOUR_GITLAB_JOB_TOKEN> --env GITLAB_AUTH_COOKIE_PATH=<YOUR_GITLAB_AUTH_COOKIE_PATH> --env GITLAB_USE_OAUTH=<YOUR_GITLAB_USE_OAUTH> --env GITLAB_OAUTH_CLIENT_ID=<YOUR_GITLAB_OAUTH_CLIENT_ID> --env GITLAB_OAUTH_TOKEN_SCRIPT=<YOUR_GITLAB_OAUTH_TOKEN_SCRIPT> --env GITLAB_API_URL=<YOUR_GITLAB_API_URL> --env GITLAB_ALLOWED_PROJECT_IDS=<YOUR_GITLAB_ALLOWED_PROJECT_IDS> --env GITLAB_PERMISSION_MODE=<YOUR_GITLAB_PERMISSION_MODE> --env GITLAB_TOOLSETS=<YOUR_GITLAB_TOOLSETS> --env GITLAB_TOOLS=<YOUR_GITLAB_TOOLS> --env GITLAB_DENIED_TOOLS_REGEX=<YOUR_GITLAB_DENIED_TOOLS_REGEX> --env GITLAB_TOOL_POLICY_APPROVE=<YOUR_GITLAB_TOOL_POLICY_APPROVE> --env GITLAB_TOOL_POLICY_HIDDEN=<YOUR_GITLAB_TOOL_POLICY_HIDDEN> --env NODE_TLS_REJECT_UNAUTHORIZED=<YOUR_NODE_TLS_REJECT_UNAUTHORIZED> --env GITLAB_CA_CERT_PATH=<YOUR_GITLAB_CA_CERT_PATH> --env GITLAB_MASKING_ENABLED=<YOUR_GITLAB_MASKING_ENABLED> --env GITLAB_MASKING_CONFIG=<YOUR_GITLAB_MASKING_CONFIG> --env GITLAB_MASKING_POLICY_FILE=<YOUR_GITLAB_MASKING_POLICY_FILE> --env GITLAB_MASKING_WORKSPACE_DIR=<YOUR_GITLAB_MASKING_WORKSPACE_DIR> -- npx -y @zereight/mcp-gitlab@2.3.19

Run this in a terminal to add the server to Claude Code.

What this does

GitLab MCP Server exposes a set of tools to Claude over the Model Context Protocol. After you add it to claude_desktop_config.json (snippet above) and restart Claude Desktop, those tools become callable inside any conversation.

Requirements

This server needs the following environment variables to be set before it can run:

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
GITLAB_TOOLSETS
GITLAB_TOOLS
GITLAB_DENIED_TOOLS_REGEX
GITLAB_TOOL_POLICY_APPROVE
GITLAB_TOOL_POLICY_HIDDEN
NODE_TLS_REJECT_UNAUTHORIZED
GITLAB_CA_CERT_PATH
GITLAB_MASKING_ENABLED
GITLAB_MASKING_CONFIG
GITLAB_MASKING_POLICY_FILE
GITLAB_MASKING_WORKSPACE_DIR

Set these via the env object in your MCP config (see claude_desktop_config.json snippet above).

Frequently asked questions

How do I install GitLab MCP Server?

Run the Claude Code command in the install section to add GitLab MCP Server to Claude Code, or copy the ready-made config for your client from the install section on this page. Restart your client afterwards and the tools appear in your next conversation.

Which clients work with GitLab MCP Server?

This page carries setup and config for Claude Code, Claude Desktop, Cursor and VS Code. Any other MCP client that accepts a standard server config can connect to GitLab MCP Server as well.

Does GitLab MCP Server need an API key?

Yes. Before it can run, set these 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, GITLAB_TOOLSETS, GITLAB_TOOLS, GITLAB_DENIED_TOOLS_REGEX, GITLAB_TOOL_POLICY_APPROVE, GITLAB_TOOL_POLICY_HIDDEN, NODE_TLS_REJECT_UNAUTHORIZED, GITLAB_CA_CERT_PATH, GITLAB_MASKING_ENABLED, GITLAB_MASKING_CONFIG, GITLAB_MASKING_POLICY_FILE, GITLAB_MASKING_WORKSPACE_DIR. They go in the env block of your MCP config.

Imported from the Official MCP Registry. The details above come from the registry entry; the maker can claim this listing to correct them, add docs, and see its traffic.

Is this your MCP server?

Claim this listing to see its traffic, fix details yourself, and skip the review queue on future updates.

Listed on clauderules.net

Add this badge to your README

Show visitors this server is listed in the ClaudeRules directory. The badge links straight to this listing.

Markdown
[![Listed on clauderules.net](https://clauderules.net/api/badge/io-github-zereight-gitlab-mcp)](https://clauderules.net/mcp/io-github-zereight-gitlab-mcp)
HTML
<a href="https://clauderules.net/mcp/io-github-zereight-gitlab-mcp" target="_blank" rel="noopener noreferrer"><img src="https://clauderules.net/api/badge/io-github-zereight-gitlab-mcp" alt="Listed on clauderules.net" /></a>