Better GitLab MCP Server
About
An improved GitLab MCP server with bug fixes and enhancements for accessing GitLab resources.
Details
- Author
- zereight
- Categories
- Developer Tools, Other, Infrastructure, Project Management
Jump to
Setup
Install Better GitLab MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/zereight/gitlab-mcp
Follow the installation instructions in the repository README, then restart your MCP client.
An improved GitLab MCP server with bug fixes and enhancements for accessing GitLab resources.
πDocumentation βSetup guides, environment variables, and the full tool reference live on the hosted docs site.
A comprehensive GitLab MCP server for AI clients. Manage projects, merge requests, issues, pipelines, wiki, releases, tags, milestones, and more through stdio, SSE, and Streamable HTTP.
Supports PAT, OAuth, read-only mode, dynamic API URLs, and remote authorization for VS Code, Claude, Cursor, Copilot, and other MCP clients.
- Broad GitLab coverage β projects, repository browsing, merge requests, issues, pipelines, wiki, releases, tags, labels, milestones, and more
- Flexible auth β Personal Access Token, local OAuth2 browser flow, MCP OAuth proxy, and per-request remote authorization
- Multiple transports β stdio for local clients, SSE for legacy clients, and Streamable HTTP for modern remote deployments
- Client-friendly setup β examples for Claude Code, Codex, Antigravity, OpenCode, Copilot, Cline, Roo Code, Cursor, Kilo Code, and Amp Code
- Self-hosted ready β works with custom GitLab instances, proxy settings, and dynamic API URL routing
Quick start: choose either Personal Access Token or OAuth2 setup below, install@zereight/mcp-gitlab, and usezereight-mcp-gitlabin your MCP client configuration.
- Claude Code Setup Guide
- VS Code Setup Guide
- GitHub Copilot Setup Guide
- Codex Setup Guide
- Cursor Setup Guide
- JSON-Based MCP Clients Setup Guide- for Factory AI Droid, OpenClaw, and OpenCode style clients
- OAuth2 Authentication Setup Guide
- Environment Variables Reference
- Stateless Mode β Multi-Pod HPA
- Custom Agents and Multiple PAT Setup
The server supports four authentication methods:
- Personal Access Token(GITLAB_PERSONAL_ACCESS_TOKEN) β simplest setup
- OAuth2 β Local Browser(GITLAB_USE_OAUTH) β recommended for better security
- OAuth2 β MCP Proxy(GITLAB_MCP_OAUTH) β for remote MCP clients such as Claude.ai
- Remote Authorization(REMOTE_AUTHORIZATION) β multi-user deployments where each caller provides their own token
- Claude Code: seeClaude Code Setup Guide
- VS Code: seeVS Code Setup Guide
- GitHub Copilot: seeGitHub Copilot Setup Guide
- Codex: seeCodex Setup Guide
- Cursor: seeCursor Setup Guide
- Factory AI Droid / OpenClaw / OpenCode style clients: seeJSON-Based MCP Clients Setup Guide
- OAuth browser flow details: seeOAuth2 Authentication Setup Guide
For the simplest local setup, start with a Personal Access Token. For browser-based local auth, use OAuth2. For remote or multi-user deployments, continue to the MCP OAuth and Remote Authorization sections later in this README.
brew tap zereight/gitlab-mcp https://github.com/zereight/gitlab-mcp brew install zereight/gitlab-mcp/zereight-mcp-gitlab
The examples usezereight-mcp-gitlab, a less collision-prone alias for the legacymcp-gitlabbinary. If your MCP client cannot find it, use the absolute path fromwhich zereight-mcp-gitlab.
No global install? Pinnpxto the previous stable release (the version these docs recommend), for examplenpx -y @zereight/mcp-gitlab@2.1.48. If you always want the newest release, usenpx -y @zereight/mcp-gitlab@latestinstead. The server prints a notice to stderr on startup when a newer version is available (disable withGITLAB_DISABLE_VERSION_CHECK=true).
Using CLI Arguments (for clients with env var issues)
Some MCP clients (like GitHub Copilot CLI) have issues with environment variables. Use CLI arguments instead:
{ "mcpServers": { "gitlab": { "command": "zereight-mcp-gitlab", "args": ["--token=YOUR_GITLAB_TOKEN", "--api-url=https://gitlab.com/api/v4"], "tools": ["*"] } } }
- --token- GitLab Personal Access Token (replacesGITLAB_PERSONAL_ACCESS_TOKEN)
- --api-url- GitLab API URL (replacesGITLAB_API_URL)
- --read-only=true- Enable read-only mode (replacesGITLAB_READ_ONLY_MODE, deprecated β prefer--permission-mode=readonly)
- --permission-mode- Permission level:readonly,modify(no delete tools), orfull(replacesGITLAB_PERMISSION_MODE, defaultfull)
- --use-wiki=true- Enable wiki API (replacesUSE_GITLAB_WIKI, legacy β preferGITLAB_TOOLSETS=wiki)
- --use-milestone=true- Enable milestone API (replacesUSE_MILESTONE, legacy β preferGITLAB_TOOLSETS=milestones)
- --use-pipeline=true- Enable pipeline API (replacesUSE_PIPELINE, legacy β preferGITLAB_TOOLSETS=pipelines)
- --disable-version-check=true- Disable the startup new-version notice (replacesGITLAB_DISABLE_VERSION_CHECK)
CLI arguments take precedence over environment variables.
Fine-grained tool filtering:useGITLAB_PERMISSION_MODE=modifyto allow create/update while blocking every delete tool (including delete mutations throughexecute_graphql), orGITLAB_PERMISSION_MODE=readonlyfor read-only access. You can also enable toolset groups withGITLAB_TOOLSETS=<group,β¦>, allow-list individual tools withGITLAB_TOOLS=<tool,β¦>(e.g. read-only groups plus a few specific write tools), and deny-list by pattern withGITLAB_DENIED_TOOLS_REGEX. The legacyUSE_GITLAB_WIKI/USE_MILESTONE/USE_PIPELINEflags are kept for backward compatibility only. SeeTools Referenceand[Environment Variables.
docker run -i --rm \ -e HOST=0.0.0.0 \ -e GITLAB_PERSONAL_ACCESS_TOKEN=your_gitlab_token \ -e GITLAB_API_URL="https://gitlab.com/api/v4" \ -e GITLAB_PERMISSION_MODE=readonly \ -e GITLAB_TOOLSETS=wiki,milestones,pipelines \ -e SSE=true \ -e SSE_AUTH_TOKEN=your_mcp_sse_token \ -p 3333:3002 \ zereight050/gitlab-mcp
{ "mcpServers": { "gitlab": { "type": "sse", "url": "http://localhost:3333/sse", "headers": { "Authorization": "Bearer your_mcp_sse_token" } } } }
docker run -i --rm \ -e HOST=0.0.0.0 \ -e REMOTE_AUTHORIZATION=true \ -e GITLAB_API_URL="https://gitlab.com/api/v4" \ -e GITLAB_PERMISSION_MODE=readonly \ -e GITLAB_TOOLSETS=wiki,milestones,pipelines \ -e STREAMABLE_HTTP=true \ -p 3333:3002 \ zereight050/gitlab-mcp
{ "mcpServers": { "gitlab": { "type": "streamable-http", "url": "http://localhost:3333/mcp", "headers": { "Authorization": "Bearer glpat-..." } } } }
Using MCP OAuth Proxy (GITLAB_MCP_OAUTH)
For server/remote deployments only.This mode requires the MCP server to be deployed with a publicly accessible HTTPS URL. For local/desktop use, seeGITLAB_USE_OAUTHabove.
β¦
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





