npm @structured-world/gitlab-mcpstdioApache-2.0updated 7d ago
Advanced GitLab MCP server — 58 CQRS tools exposing 230 GitLab operations across 26 entity types. The tool catalog and parameters are filtered to each instance's GitLab version, tier, and token scopes, so the agent sees only what the connected instance actually supports.
Advanced GitLab MCP server 能做什么?
Advanced GitLab MCP server
Advanced GitLab MCP server — 58 CQRS tools exposing 230 GitLab operations across 26 entity types. The tool catalog and parameters are filtered to each instance's GitLab version, tier, and token scopes, so the agent sees only what the connected instance actually supports.
Packages
This is a monorepo with two npm packages:
@structured-world/gitlab-mcp— the MCP server. In-memory and file OAuth-session storage, no database dependency. This is all most users need.@structured-world/gitlab-mcp-db— optional PostgreSQL/Prisma OAuth-session backend for running multiple replicas behind a load balancer. Enable it withOAUTH_STORAGE_TYPE=postgresql; see the PostgreSQL deployment guide for the full setup.
Quick Start
{
"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
- 58 tools across 26 entity types — projects, merge requests, pipelines, work items, wiki, and more
- CQRS architecture —
browse_*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 GitLab.com, self-managed, and self-hosted 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 support —
ghcr.io/structured-world/gitlab-mcp:latest
Tool model
GitLab exposes hundreds of API operations. Giving each its own MCP tool floods an agent's context; a thin API wrapper pushes that complexity back onto the agent. This server takes a third path: 58 CQRS tools, each holding several typed actions, expose 230 operations across 26 entity types.
browse_*tools are read-only queries;manage_*tools are writes.- Sub-resources fold into actions rather than new tools —
browse_pipelinescovers pipelines, jobs, and logs in a single tool. - The tool list, actions, and parameters are resolved at schema-generation time against GitLab version, tier, token scopes, admin-mode, feature flags, and profiles.
Examples:
browse_pipelines— list, get, jobs, job, logs, triggersmanage_pipeline— create, retry, cancelbrowse_environments— list, get, list_deploymentsmanage_environment— create, update, stop, delete, update_deployment_statusbrowse_deploy_keys/manage_deploy_key— list, get / add, enable, update, delete
Documentation
Full documentation is available at gitlab-mcp.sw.foundation
| Section | Description |
|---|---|
| Installation | npm, Docker, VS Code, Codex |
| Configuration | Environment variables, feature flags |
| Multi-Instance | Connect to multiple GitLab instances |
| Tool Reference | All 58 tools with parameters |
| OAuth Setup | Team authentication with Claude |
| TLS/HTTPS | Production deployment with SSL |
| Customization | Tool descriptions, action filtering |
| CLI Tools | Browse and export tool documentation |
Auto-generated Tool Reference
For the complete tool reference with parameters:
# 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
# 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/failedstate), only themanage_contexttool is exposed, with local actions such aswhoami,switch_profile, andset_scopefor diagnostics. During active reconnect (connectingstate), 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 viatools/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
failedstate (no auto-reconnect). Mid-session token revocation is detected via an authenticatedHEAD /api/v4/usercheck that runs alongside each periodic health check (static token mode only; skipped in OAuth mode). A 401 or 403 on this check transitions the instance tofailedstate immediately. - Instance health monitor — Each monitored instance URL has its own XState state machine. Untracked OAuth URLs currently pass through as reachable.
| Variable | Default | Description |
|---|---|---|
GITLAB_INIT_TIMEOUT_MS |
5000 |
Max time to wait for GitLab during startup |
GITLAB_RECONNECT_BASE_DELAY_MS |
5000 |
Initial reconnect delay (doubles each attempt) |
GITLAB_RECONNECT_MAX_DELAY_MS |
60000 |
Maximum reconnect delay |
GITLAB_HEALTH_CHECK_INTERVAL_MS |
60000 |
Health check interval when connected |
GITLAB_FAILURE_THRESHOLD |
3 |
Consecutive transient failures before disconnecting |
GITLAB_TOOL_TIMEOUT_MS |
120000 |
Max time for tool/bootstrap execution before timeout |
GITLAB_RESPONSE_WRITE_TIMEOUT_MS |
10000 |
Max time to flush a non-SSE response before destroying zombie connection (0 to disable; SSE uses heartbeat) |
GITLAB_INSTANCE_CACHE_MAX |
100 |
Max number of per-URL instance states kept in memory (OAuth multi-tenant; LRU eviction when exceeded) |
GITLAB_INSTANCE_TTL_MS |
3600000 |
TTL for idle per-URL instance states in ms; evicted on next insert (OAuth multi-tenant) |
Feature Flags
| Flag | Default | Tools Enabled |
|---|---|---|
USE_LABELS |
true |
Label management |
USE_MRS |
true |
Merge requests |
USE_FILES |
true |
File operations |
USE_VARIABLES |
true |
CI/CD variables |
USE_WORKITEMS |
true |
Issues, epics, tasks |
USE_WEBHOOKS |
true |
Webhook management |
USE_SNIPPETS |
true |
Code snippets |
USE_INTEGRATIONS |
true |
50+ integrations |
USE_GITLAB_WIKI |
true |
Wiki pages |
USE_MILESTONE |
true |
Milestones |
USE_PIPELINE |
true |
Pipelines & CI/CD |
USE_RELEASES |
true |
Release management |
USE_REFS |
true |
Branch & tag management |
USE_MEMBERS |
true |
Team members |
USE_SEARCH |
true |
Cross-project search |
USE_ITERATIONS |
true |
Iteration planning (sprints) |
USE_CI_TOKENS |
true |
CI access credentials: job token scope and deploy keys |
USE_ENVIRONMENTS |
true |
Environments and deployments |
USE_RUNNERS |
true |
CI runner management |
USE_REGISTRY |
true |
Container registry repositories and tags |
USE_ACCESS_TOKENS |
true |
Project/group/personal access token management |
USE_AUDIT_EVENTS |
true |
Audit events (Premium+) |
USE_VULNERABILITIES |
true |
Vulnerability management (Ultimate) |
Contributing
See CONTRIBUTING.md for development setup, testing, and PR guidelines.
Support the Project
USDT (TRC-20): TFDsezHa1cBkoeZT5q2T49Wp66K8t2DmdA
License
Apache License 2.0 — see LICENSE for details.
Based on zereight/gitlab-mcp (MIT). See LICENSE.MIT.
安装
把 Advanced GitLab MCP server 添加到你的客户端。选择你正在使用的那个。
claude mcp add gitlab-mcp -- npx -y @structured-world/gitlab-mcpcodex mcp add gitlab-mcp -- npx -y @structured-world/gitlab-mcpamp mcp add gitlab-mcp -- npx -y @structured-world/gitlab-mcp{
"mcpServers": {
"gitlab-mcp": {
"command": "npx",
"args": [
"-y",
"@structured-world/gitlab-mcp"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"gitlab-mcp": {
"command": "npx",
"args": [
"-y",
"@structured-world/gitlab-mcp"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"gitlab-mcp","command":"npx","args":["-y","@structured-world/gitlab-mcp"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"gitlab-mcp": {
"command": "npx",
"args": [
"-y",
"@structured-world/gitlab-mcp"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"gitlab-mcp": {
"command": "npx",
"args": [
"-y",
"@structured-world/gitlab-mcp"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"gitlab-mcp": {
"command": "npx",
"args": [
"-y",
"@structured-world/gitlab-mcp"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"gitlab-mcp": {
"type": "local",
"command": "npx",
"args": [
"-y",
"@structured-world/gitlab-mcp"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"gitlab-mcp": {
"command": {
"path": "npx",
"args": [
"-y",
"@structured-world/gitlab-mcp"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y @structured-world/gitlab-mcpRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
5 个工具
Advanced GitLab MCP server 向已连接的智能体提供 5 个工具。
- browse_pipelines
- list, get, jobs, job, logs, triggers
- manage_pipeline
- create, retry, cancel
- browse_environments
- list, get, list_deployments
- manage_environment
- create, update, stop, delete, update_deployment_status
- browse_deploy_keys
- / `manage_deploy_key` — list, get / add, enable, update, delete
评分
84 / 100
优秀
- 文档25/25
- 维护25/25
- 可信度16/20
- 能力6/15
- 安装体验12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 0 days ago
- Has a release history
- Repository is not archived
- Licensed Apache-2.0
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 5 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
版本历史
| 版本 | 发布于 |
|---|---|
| 9.1.3最新 | 2026年8月31日 |
| 9.1.2 | 2026年8月8日 |
| 9.1.1 | 2026年6月22日 |
| 9.1.0 | 2026年6月7日 |
| 9.0.1 | 2026年6月7日 |
| 8.0.0 | 2026年6月5日 |
| 7.7.0 | 2026年6月4日 |
| 7.6.0 | 2026年6月3日 |
| 7.5.0 | 2026年6月2日 |
| 7.2.0 | 2026年4月11日 |
| 7.1.0 | 2026年4月7日 |
| 7.0.2 | 2026年4月7日 |
| 7.0.1 | 2026年4月6日 |
| 6.62.2 | 2026年3月29日 |
| 6.62.1 | 2026年3月1日 |
| 6.62.0 | 2026年2月16日 |
| 6.61.0 | 2026年2月13日 |
| 6.60.3 | 2026年2月7日 |
| 6.60.2 | 2026年2月6日 |
| 6.60.1 | 2026年2月6日 |
| 6.60.0 | 2026年2月6日 |
| 6.59.2 | 2026年2月6日 |
| 6.59.1 | 2026年2月5日 |
| 6.59.0 | 2026年2月5日 |
| 6.58.1 | 2026年2月5日 |
| 6.58.0 | 2026年2月5日 |
| 6.57.0 | 2026年2月5日 |
| 6.56.0 | 2026年2月4日 |
| 6.55.1 | 2026年2月4日 |
| 6.55.0 | 2026年2月4日 |
| 6.54.0 | 2026年2月4日 |
| 6.53.1 | 2026年2月4日 |
| 6.53.0 | 2026年2月4日 |
| 6.52.0 | 2026年2月4日 |
| 6.51.0 | 2026年2月2日 |
| 6.50.0 | 2026年1月27日 |
| 6.49.0 | 2026年1月26日 |
| 6.48.2 | 2026年1月26日 |
| 6.48.1 | 2026年1月25日 |
| 6.48.0 | 2026年1月25日 |
| 6.47.1 | 2026年1月25日 |
| 6.47.0 | 2026年1月25日 |
| 6.46.1 | 2026年1月25日 |
| 6.46.0 | 2026年1月25日 |
| 6.45.1 | 2026年1月25日 |
| 6.45.0 | 2026年1月25日 |
| 6.44.0 | 2026年1月25日 |
| 6.43.1 | 2026年1月25日 |
| 6.43.0 | 2026年1月25日 |