GitLab MCP Server

平台与服务

by structured-world

GitLab MCP server with 44 tools for projects, MRs, pipelines, and more

什么是 GitLab MCP Server

GitLab MCP server with 44 tools for projects, MRs, pipelines, and more

README

Advanced GitLab MCP server

npm version npm downloads License Release Coverage Coverage Report

Advanced GitLab MCP server — 44 tools across 18 entity types with CQRS architecture, OAuth 2.1, and multiple transport modes.

Install in Claude Desktop Install in VS Code Install in VS Code Insiders

Quick Start

json
{
  "mcpServers": {
    "gitlab": {
      "command": "npx",
      "args": ["-y", "@structured-world/gitlab-mcp"],
      "env": {
        "GITLAB_TOKEN": "your_gitlab_token",
        "GITLAB_API_URL": "https://gitlab.com"
      }
    }
  }
}

Requirements: Node.js >= 24

Highlights

  • 44 tools across 18 entity types — projects, merge requests, pipelines, work items, wiki, and more
  • CQRS architecturebrowse_* for queries, manage_* for commands
  • Connection resilience — Bounded startup, auto-reconnect with exponential backoff, disconnected mode when GitLab is unreachable
  • Multi-instance support — Connect to multiple GitLab instances with per-instance OAuth and rate limiting
  • Multiple transports — stdio, SSE, StreamableHTTP
  • OAuth 2.1 — Per-user authentication via Claude Custom Connector
  • Read-only mode — Safe operation for production environments
  • Auto-discovery — Detects GitLab config from git remotes
  • Fine-grained control — Enable/disable tool groups, filter actions, customize descriptions
  • Docker supportghcr.io/structured-world/gitlab-mcp:latest

Documentation

Full documentation is available at gitlab-mcp.sw.foundation

SectionDescription
Installationnpm, Docker, VS Code, Codex
ConfigurationEnvironment variables, feature flags
Multi-InstanceConnect to multiple GitLab instances
Tool ReferenceAll 44 tools with parameters
OAuth SetupTeam authentication with Claude
TLS/HTTPSProduction deployment with SSL
CustomizationTool descriptions, action filtering
CLI ToolsBrowse and export tool documentation

Auto-generated Tool Reference

For the complete tool reference with parameters:

bash
# View locally
yarn list-tools --detail

# Generate documentation
yarn list-tools --export --toc > docs/tools/api-reference.md

See the Full API Reference for the auto-generated tool documentation.

Docker

bash
# HTTP mode
docker run -e PORT=3002 -e GITLAB_TOKEN=your_token -p 3333:3002 \
  ghcr.io/structured-world/gitlab-mcp:latest

# stdio mode
docker run -i --rm -e GITLAB_TOKEN=your_token \
  ghcr.io/structured-world/gitlab-mcp:latest

Connection Resilience

The server handles GitLab connectivity issues gracefully:

  • Bounded startup — Server starts within GITLAB_INIT_TIMEOUT_MS (default 5s) regardless of GitLab availability
  • Disconnected mode — When GitLab is unreachable (disconnected/failed state), only the manage_context tool is exposed, with local actions such as whoami, switch_profile, and set_scope for diagnostics. During active reconnect (connecting state), the full tool list remains available so MCP clients don't lose their tool catalog during brief outages. MCP clients are notified of tool availability changes via tools/list_changed
  • Auto-reconnect — Exponential backoff reconnection (5s → 60s) with ±10% jitter
  • Error classification — Transient errors (network, 5xx, timeouts) trigger auto-reconnect. Auth/config errors at startup transition to failed state (no auto-reconnect). Runtime auth errors from tool calls are forwarded to HealthMonitor.reportError() via classifyError(); the remaining gap is token-revocation/403 detection (#370)
  • Instance health monitor — Each monitored instance URL has its own XState state machine. Untracked OAuth URLs currently pass through as reachable.
VariableDefaultDescription
GITLAB_INIT_TIMEOUT_MS5000Max time to wait for GitLab during startup
GITLAB_RECONNECT_BASE_DELAY_MS5000Initial reconnect delay (doubles each attempt)
GITLAB_RECONNECT_MAX_DELAY_MS60000Maximum reconnect delay
GITLAB_HEALTH_CHECK_INTERVAL_MS60000Health check interval when connected
GITLAB_FAILURE_THRESHOLD3Consecutive transient failures before disconnecting
GITLAB_TOOL_TIMEOUT_MS120000Max time for tool/bootstrap execution before timeout
GITLAB_RESPONSE_WRITE_TIMEOUT_MS10000Max time to flush a non-SSE response before destroying zombie connection (0 to disable; SSE uses heartbeat)

Feature Flags

FlagDefaultTools Enabled
USE_LABELStrueLabel management
USE_MRStrueMerge requests
USE_FILEStrueFile operations
USE_VARIABLEStrueCI/CD variables
USE_WORKITEMStrueIssues, epics, tasks
USE_WEBHOOKStrueWebhook management
USE_SNIPPETStrueCode snippets
USE_INTEGRATIONStrue50+ integrations
USE_GITLAB_WIKItrueWiki pages
USE_MILESTONEtrueMilestones
USE_PIPELINEtruePipelines & CI/CD
USE_RELEASEStrueRelease management
USE_REFStrueBranch & tag management
USE_MEMBERStrueTeam members
USE_SEARCHtrueCross-project search
USE_ITERATIONStrueIteration planning (sprints)

Contributing

See CONTRIBUTING.md for development setup, testing, and PR guidelines.

Support the Project

<div align="center">

USDT TRC-20 Donation QR Code

USDT (TRC-20): TFDsezHa1cBkoeZT5q2T49Wp66K8t2DmdA

</div>

License

Apache License 2.0 — see LICENSE for details.

Based on zereight/gitlab-mcp (MIT). See LICENSE.MIT.

常见问题

GitLab MCP Server 是什么?

GitLab MCP server with 44 tools for projects, MRs, pipelines, and more

相关 Skills

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描114.1k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描114.1k

MCP服务构建器

by alirezarezvani

Universal
热门

从 OpenAPI 一键生成 Python/TypeScript MCP server 脚手架,并校验 tool schema、命名规范与版本兼容性,适合把现有 REST API 快速发布成可生产演进的 MCP 服务。

帮你快速搭建 MCP 服务与后端 API,脚手架完善、扩展顺手,尤其适合想高效验证服务能力的开发者。

平台与服务
未扫描10.2k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
83.4k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.4k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
35.4k

评论