GitLab MCP Setup & Guide
io.mcp-cn.zereight/mcp-gitlab
GitLab的MCP服务器,支持GitLab的读取和写入
Copy the install config on this page first, then verify docs and permissions upstream.
Popularity
Overview
GitLab的MCP服务器,支持GitLab的读取和写入 GitLab is a MCP Server listed from MCP Hub China. Transports: stdio. This page includes an overview, setup tutorial, install commands, and use cases for Trae, Tongyi Lingma, Cursor, Claude Code, and VS Code.
Use cases
AgentHub Verified AvailabilityTested & Ready
Automated pipeline validated install commands, protocol & client compatibility
Copy by platform
Choose your platform
- Open or create .cursor/mcp.json in your project root
- Click Copy config and paste; merge only this mcpServers entry if others exist
- Replace <placeholders> in env with real secrets (see Environment variables below)
- Save, then Cmd+Shift+P → Reload Window
Pre-fill Environment Variables (Optional)
{
"mcpServers": {
"mcp-gitlab": {
"command": "npx",
"args": [
"-y",
"@zereight/mcp-gitlab"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "<GITLAB_PERSONAL_ACCESS_TOKEN>",
"GITLAB_API_URL": "<GITLAB_API_URL>",
"GITLAB_READ_ONLY_MODE": "<GITLAB_READ_ONLY_MODE>",
"USE_GITLAB_WIKI": "<USE_GITLAB_WIKI>",
"USE_MILESTONE": "<USE_MILESTONE>",
"USE_PIPELINE": "<USE_PIPELINE>"
}
}
}
}Setup tutorial
- Open the GitLab page and confirm this MCP Server (source: MCP Hub China).
- Copy the Cursor, Claude Code, or VS Code snippet.
- Merge it into mcpServers and replace env placeholders with real secrets.
- Reload the window, then call the MCP tools from your agent chat.
Install commands
Install commands and setup steps are in the HTML so search engines and no-JS browsers can read them without running client JavaScript.
Claude Code (local)
- Install Claude Code CLI
- Copy the command below, replace <placeholders> with real env values, then run in terminal
- See Environment variables below if listed
claude mcp add mcp-gitlab --env GITLAB_PERSONAL_ACCESS_TOKEN=<GITLAB_PERSONAL_ACCESS_TOKEN> --env GITLAB_API_URL=<GITLAB_API_URL> --env GITLAB_READ_ONLY_MODE=<GITLAB_READ_ONLY_MODE> --env USE_GITLAB_WIKI=<USE_GITLAB_WIKI> --env USE_MILESTONE=<USE_MILESTONE> --env USE_PIPELINE=<USE_PIPELINE> -- npx -y @zereight/mcp-gitlabCursor — .cursor/mcp.json (local)
- Open or create .cursor/mcp.json in your project root
- Click Copy config and paste; merge only this mcpServers entry if others exist
- Replace <placeholders> in env with real secrets (see Environment variables below)
- Save, then Cmd+Shift+P → Reload Window
{
"mcpServers": {
"mcp-gitlab": {
"command": "npx",
"args": [
"-y",
"@zereight/mcp-gitlab"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "<GITLAB_PERSONAL_ACCESS_TOKEN>",
"GITLAB_API_URL": "<GITLAB_API_URL>",
"GITLAB_READ_ONLY_MODE": "<GITLAB_READ_ONLY_MODE>",
"USE_GITLAB_WIKI": "<USE_GITLAB_WIKI>",
"USE_MILESTONE": "<USE_MILESTONE>",
"USE_PIPELINE": "<USE_PIPELINE>"
}
}
}
}VS Code — .vscode/mcp.json (local)
- Install GitHub Copilot in VS Code with MCP support
- Open or create .vscode/mcp.json in your project root
- Click Copy config and paste; merge only this mcpServers entry if others exist
- Replace <placeholders> in env with real secrets
- Save and Developer: Reload Window
{
"mcpServers": {
"mcp-gitlab": {
"command": "npx",
"args": [
"-y",
"@zereight/mcp-gitlab"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "<GITLAB_PERSONAL_ACCESS_TOKEN>",
"GITLAB_API_URL": "<GITLAB_API_URL>",
"GITLAB_READ_ONLY_MODE": "<GITLAB_READ_ONLY_MODE>",
"USE_GITLAB_WIKI": "<USE_GITLAB_WIKI>",
"USE_MILESTONE": "<USE_MILESTONE>",
"USE_PIPELINE": "<USE_PIPELINE>"
}
}
}
}Claude Desktop — claude_desktop_config.json (local)
- Open Claude Desktop claude_desktop_config.json (see remote guide for paths)
- Click Copy config and merge under mcpServers
- Replace <placeholders> in env with real secrets
- Fully quit and restart Claude Desktop
{
"mcpServers": {
"mcp-gitlab": {
"command": "npx",
"args": [
"-y",
"@zereight/mcp-gitlab"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "<GITLAB_PERSONAL_ACCESS_TOKEN>",
"GITLAB_API_URL": "<GITLAB_API_URL>",
"GITLAB_READ_ONLY_MODE": "<GITLAB_READ_ONLY_MODE>",
"USE_GITLAB_WIKI": "<USE_GITLAB_WIKI>",
"USE_MILESTONE": "<USE_MILESTONE>",
"USE_PIPELINE": "<USE_PIPELINE>"
}
}
}
}Trae — .trae/mcp.json (local)
- Trae → Settings → MCP, or edit .trae/mcp.json / global mcp.json
- Click Copy config and merge mcpServers
- Replace <placeholders> in env with real secrets
- Save and reload Trae
{
"mcpServers": {
"mcp-gitlab": {
"command": "npx",
"args": [
"-y",
"@zereight/mcp-gitlab"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "<GITLAB_PERSONAL_ACCESS_TOKEN>",
"GITLAB_API_URL": "<GITLAB_API_URL>",
"GITLAB_READ_ONLY_MODE": "<GITLAB_READ_ONLY_MODE>",
"USE_GITLAB_WIKI": "<USE_GITLAB_WIKI>",
"USE_MILESTONE": "<USE_MILESTONE>",
"USE_PIPELINE": "<USE_PIPELINE>"
}
}
}
}Cherry Studio — MCP settings (local)
- Cherry Studio → Settings → MCP Servers → Add (STDIO)
- Or import JSON: click Copy config and merge mcpServers
- Replace <placeholders> in env; ensure Node.js / uv (npx, uvx) are installed
- Enable the server and check tools load
{
"mcpServers": {
"mcp-gitlab": {
"command": "npx",
"args": [
"-y",
"@zereight/mcp-gitlab"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "<GITLAB_PERSONAL_ACCESS_TOKEN>",
"GITLAB_API_URL": "<GITLAB_API_URL>",
"GITLAB_READ_ONLY_MODE": "<GITLAB_READ_ONLY_MODE>",
"USE_GITLAB_WIKI": "<USE_GITLAB_WIKI>",
"USE_MILESTONE": "<USE_MILESTONE>",
"USE_PIPELINE": "<USE_PIPELINE>"
}
}
}
}Tongyi Lingma — MCP config (local)
- Lingma Settings → MCP → + → STDIO or config file
- Click Copy config and merge mcpServers
- Replace <placeholders> in env; need Node.js 18+ (npx) or uv (uvx)
- Confirm connected before using tools in agent chat
{
"mcpServers": {
"mcp-gitlab": {
"command": "npx",
"args": [
"-y",
"@zereight/mcp-gitlab"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "<GITLAB_PERSONAL_ACCESS_TOKEN>",
"GITLAB_API_URL": "<GITLAB_API_URL>",
"GITLAB_READ_ONLY_MODE": "<GITLAB_READ_ONLY_MODE>",
"USE_GITLAB_WIKI": "<USE_GITLAB_WIKI>",
"USE_MILESTONE": "<USE_MILESTONE>",
"USE_PIPELINE": "<USE_PIPELINE>"
}
}
}
}Windsurf — mcp_config.json (local)
- Edit ~/.codeium/windsurf/mcp_config.json
- Click Copy config and merge mcpServers (stdio same as Cursor)
- Replace <placeholders> in env, save, refresh Cascade
{
"mcpServers": {
"mcp-gitlab": {
"command": "npx",
"args": [
"-y",
"@zereight/mcp-gitlab"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "<GITLAB_PERSONAL_ACCESS_TOKEN>",
"GITLAB_API_URL": "<GITLAB_API_URL>",
"GITLAB_READ_ONLY_MODE": "<GITLAB_READ_ONLY_MODE>",
"USE_GITLAB_WIKI": "<USE_GITLAB_WIKI>",
"USE_MILESTONE": "<USE_MILESTONE>",
"USE_PIPELINE": "<USE_PIPELINE>"
}
}
}
}Cline — MCP Servers (local)
- Cline panel → Settings → MCP Servers
- Click Copy config and merge
- Replace <placeholders> in env, then save
{
"mcpServers": {
"mcp-gitlab": {
"command": "npx",
"args": [
"-y",
"@zereight/mcp-gitlab"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "<GITLAB_PERSONAL_ACCESS_TOKEN>",
"GITLAB_API_URL": "<GITLAB_API_URL>",
"GITLAB_READ_ONLY_MODE": "<GITLAB_READ_ONLY_MODE>",
"USE_GITLAB_WIKI": "<USE_GITLAB_WIKI>",
"USE_MILESTONE": "<USE_MILESTONE>",
"USE_PIPELINE": "<USE_PIPELINE>"
}
}
}
}WorkBuddy — .workbuddy/mcp.json (local)
- Edit ~/.workbuddy/mcp.json (user) or project .workbuddy/mcp.json
- Or Plugins → MCP Servers → Configure MCP and paste the JSON below
- Replace <placeholders> in env; on Windows prefer absolute paths for command/scripts
- Save, restart WorkBuddy, confirm connector status is green
{
"mcpServers": {
"mcp-gitlab": {
"command": "npx",
"args": [
"-y",
"@zereight/mcp-gitlab"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "<GITLAB_PERSONAL_ACCESS_TOKEN>",
"GITLAB_API_URL": "<GITLAB_API_URL>",
"GITLAB_READ_ONLY_MODE": "<GITLAB_READ_ONLY_MODE>",
"USE_GITLAB_WIKI": "<USE_GITLAB_WIKI>",
"USE_MILESTONE": "<USE_MILESTONE>",
"USE_PIPELINE": "<USE_PIPELINE>"
}
}
}
}Troubleshooting & Common ErrorsFAQ
Common connection errors and verified fixes for GitLab
Getting 'connection closed' or exit code 1 in Cursor / Claude Code for GitLab?
Usually caused by missing runtime paths or IDE environment inheritance. Fix steps: 1. Verify Node.js 18+ (npx) or Python 3.10+ (uvx) is installed; 2. Run 'which npx' or 'which uvx' in terminal, and replace 'command' with absolute path; 3. Reload or restart the client window after modifying config.
# Check binary path in terminal: which npx node -v
Getting 'spawn npx ENOENT' or 'command not found'?
The editor background process does not inherit your full terminal PATH. Solution: Globally install the package, or set the absolute binary path (e.g. C:\Program Files\nodejs\npx.cmd on Windows, or /usr/local/bin/npx on macOS).
Missing required environment variable or authentication failure?
GitLab requires environment variables (GITLAB_PERSONAL_ACCESS_TOKEN、GITLAB_API_URL、GITLAB_READ_ONLY_MODE、USE_GITLAB_WIKI、USE_MILESTONE、USE_PIPELINE). Ensure you have added valid keys under the 'env' object in your config file without trailing whitespace.
// .cursor/mcp.json 或 claude_desktop_config.json
{
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "your_actual_key_here"
}
}Tool Mock Playground
SandboxGitLab Tool Interface Simulation · Preview tool schema & outputs without local runtime
{
"target": "GitLab",
"action": "execute",
"options": {
"mode": "standard",
"timeoutMs": 5000
}
}Click 'Run Mock' above
to preview the raw response returned to the LLM
Decision Guide: Why & When to Use
Assess suitability before installing to save trial-and-error time
- PR review
- Changelog generation
- Cross-repo issue search
- Replacing human security audit
- Unauthorized repo access
GitLab + Scenario Prompt → Complete Agent Automation
MCP hands-on: install to visible results
Follow the full lab (expected UI/output + contrast checks). After installing this item, verify with the tutorial prompts.
Related resources
Fillo
v0.10.0
io.github.jacobfunch/usefillo
Fillo MCP server — provision, scaffold, publish, and query forms from your coding agent.
securityscorecard-mcp
v2.0.0
io.github.CallMarcus/securityscorecard-mcp
Community-built, comprehensive MCP server for the SecurityScorecard API (unofficial).
AgentsJunction
v0.1.1
io.github.JakubTrousil/agentsjunction
Discover MCP servers and A2A agents; verify, message, post, follow, react, and receive webhooks.
Yaver
v1.99.472
io.github.yaver-io/yaver
Phone-first OpenCode MCP for trusted devices: run, build, deploy, and manage endpoint-local tools.
Pointframe MCP Server
v6.7.47
io.github.dimitar-radenkov/pointframe-mcp
Windows screenshots, OCR, and redacted screen recording for AI agents. No desktop app needed.
zendesk-mcp-server
v3.2.0
io.github.fruggr/zendesk-mcp-server
Draft, translate and update Help Center articles and manage Zendesk tickets from your AI assistant.
Often paired with
GitLab Agent Self Improvement
v1.95.0
io.clawhub.xrowgmbh/xrowgmbh-self-improvement
A skill for personal growth and self-improvement.
GitLab Agent
v1.95.0
io.clawhub.xrowgmbh/xrowgmbh-gitlab-agent
Operate assigned GitLab work with owner-verified project access and guarded MR delivery.
GitLab Hackathon
v1.95.0
io.clawhub.xrowgmbh/xrowgmbh-gitlab-hackathon
Plan and execute fair GitLab hackathon participation, including Quarterly and Transcend Hackathons, by analyzing rules, selecting qualifying issues/MRs, tracking scoring levers, and keeping an exploit watchlist.
ci-tools-support Support
v4.210.0
io.clawhub.xrowgmbh/xrowgmbh-ci-tools-support
Triage and answer support requests for the xrow-public/ci-tools GitLab components catalog.
Keep exploring AgentHub
Most people compare similar tools or check scenario guides before installing—start here.
Listing badge: put AgentHub on your site
Copy either snippet into your project homepage, docs, or GitHub README. The badge is a hotlinked SVG — nothing to host — and it links back to this page so visitors can find the install steps.
<a href="https://myagenthub.cn/p/io.mcp-cn.zereight/mcp-gitlab" title="Listed on AgentHub: GitLab" target="_blank" rel="noopener">
<img src="https://myagenthub.cn/badge/io.mcp-cn.zereight/mcp-gitlab?lang=en" alt="Listed on AgentHub: GitLab" height="20" style="border:0"/>
</a>[](https://myagenthub.cn/p/io.mcp-cn.zereight/mcp-gitlab)Badges are generated on the fly from /badge/<package-id>, so name and listing changes propagate automatically. Keep the link target unchanged — it is what counts as the referral.
Unified Manifest
{
"id": "io.mcp-cn.zereight/mcp-gitlab",
"type": "mcp-server",
"version": "latest",
"displayName": "GitLab",
"description": "GitLab的MCP服务器,支持GitLab的读取和写入",
"author": {
"name": "zereight"
},
"iconUrl": "https://static-00.iconduck.com/assets.00/gitlab-icon-1024x942-f30d1qro.png",
"homepage": "https://mcp-cn.com/server/91",
"distribution": {
"packages": [
{
"registryType": "npm",
"identifier": "@zereight/mcp-gitlab",
"runtimeHint": "npx",
"transport": "stdio",
"environmentVariables": [
{
"name": "GITLAB_PERSONAL_ACCESS_TOKEN",
"description": "<YOUR_GITLAB_TOKEN>",
"isRequired": true,
"isSecret": true
},
{
"name": "GITLAB_API_URL",
"description": "<YOUR_GITLAB_API_URL>",
"isRequired": true,
"isSecret": false
},
{
"name": "GITLAB_READ_ONLY_MODE",
"description": "false",
"isRequired": true,
"isSecret": false
},
{
"name": "USE_GITLAB_WIKI",
"description": "false",
"isRequired": true,
"isSecret": false
},
{
"name": "USE_MILESTONE",
"description": "false",
"isRequired": true,
"isSecret": false
},
{
"name": "USE_PIPELINE",
"description": "false",
"isRequired": true,
"isSecret": false
}
]
}
],
"remotes": []
},
"dependencies": [],
"installTargets": [
"claude-code",
"claude-desktop",
"cursor",
"vscode",
"trae",
"cherry-studio",
"lingma",
"windsurf",
"cline",
"workbuddy"
],
"keywords": [
"use_count:11790",
"GitLab",
"版本控制",
"代码管理",
"MCP"
],
"provenance": {
"origin": "mcp-cn",
"originalId": "@zereight/mcp-gitlab",
"originalUrl": "https://mcp-cn.com/server/91",
"isOfficial": false,
"status": "active"
}
}