
GitLab MCP Server
io.github.sumirati由 GitHub 账号 sumirati 发布v3.2.0更新于 Oct 24, 2026
Developer-ready GitLab MCP server for CE and EE instances.
发布方自己的服务:Gitlab
概览
本地运行的 GitLab MCP 服务器,让助手在 GitLab.com 或自建实例上读取和管理项目、分支、提交、合并请求、议题与 CI/CD 流水线。
- 可以做什么
- 通过精简的混合工具入口发现并执行 14 个领域的 GitLab 操作,也可选择直接暴露全部 90 个动作。读取仓库:文件内容、目录树、项目元数据、分支、提交与差异。管理仓库与分支:创建、更新、复刻和删除项目,创建和删除分支,设置分支保护。处理合并请求、议题、里程碑、标签、Wiki 和代码片段,包括差异讨论与议题备注。查看和控制 CI/CD:列出、触发、取消和重试流水线,读取作业日志、构建产物和 JUnit 测试报告,管理项目 CI/CD 变量。检查实例健康、Runner、推送镜像和 Webhook。
- 适用场景
- 适合让助手在不克隆仓库的情况下操作 GitLab:审查合并请求与差异、排查流水线失败和作业日志、读取源码,或通过 API 提交代码和变更分支。只做查看的场景可使用只读模式。
- 运行要求
- 通过 npx 或全局 npm 安装在本机运行,需要 Node.js。需要在 GITLAB_PERSONAL_ACCESS_TOKEN 中提供具有 api 权限的 GitLab 个人访问令牌,并能访问 GitLab 实例网络。GITLAB_API_URL 用于指向自建 CE/EE 实例,默认是 GitLab.com。
安装
在 SourceWeft 中
- 打开 控制台中的 GitLab MCP Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
GitLab MCP Server (@sumirati/mcp-gitlab)
A modern, 2026 AI-native Model Context Protocol (MCP) server for GitLab API v4, engineered for self-hosted GitLab Community Edition (CE), Enterprise Edition (EE), and GitLab.com.
[npm version] [License: MIT] [GitHub] [GitLab]
What makes v3.0.0 Unique: The 2026 5-Tool Hybrid Standard
In early MCP servers, dumping 50–100 tools into the client's tool list consumed 10,000+ prompt context tokens on every turn ("System Prompt Tax") and resulted in poor Coherence ratings on the Glama TDQS rubric.
@sumirati/mcp-gitlab v3 solves this with a 5-Tool Hybrid Surface:
- Glama TDQS Coherence Tier A (5/5): By exposing exactly 5 tools to the client, the server sits in the ideal 3–15 tool coherence sweet spot.
- Ultra-Lean System Prompt Tax: Drops schema overhead from 27,681 tokens to 1,292 tokens (95.3% reduction), preserving context windows and maximizing LLM prompt-cache hits.
- Zero-Hop Hourly Drivers: The 3 operations developers and agents actually use constantly during pair-programming (
get_file_contents,get_project,get_commit) remain eager tools for instant zero-hop execution. - 100% Platform Access on Demand: The entire platform surface of 90 actions across 14 domains is accessible on-demand via dynamic action discovery (
gitlab_find_actions$\rightarrow$gitlab_execute_action), delivering 75%–96% token savings with default high-density Markdown tables and summaries (format: "markdown" | "json"). - Resilient Fallback: If an agent directly invokes any catalog action name (e.g.
list_pipelines), the server dynamically executes it with full input validation and projection.
Core Capabilities Across 14 Domains
- Enterprise Observability & Self-Hosted Operations:
- System Health Diagnostics: End-to-end connectivity, token identity verification, and API latency testing (
system_health_check). - Push Mirrors: Verify upstream replication to remote Git hosts (
list_push_mirrors) and force immediate sync (trigger_push_mirror_sync). - CI Runners: Audit runner health, online/paused status, and tags (
list_runners,get_runner_status). - Webhooks: Inspect registered automation hooks (
list_project_hooks).
- System Health Diagnostics: End-to-end connectivity, token identity verification, and API latency testing (
- Repository & Branch Governance: Project CRUD, group hierarchy resolution (
buggycode/project-name), branch lifecycle, branch protection management (list_protected_branches,protect_branch,unprotect_branch), file/directory reading (get_file_contents), and atomic multi-file commits (push_files,create_commit). - CI/CD Observability: Query pipelines by status, trigger/cancel/retry pipelines (
create_pipeline,cancel_pipeline,retry_pipeline), tail failed job logs (get_job_trace) without token blowout, read build artifacts (get_job_artifact_file), and inspect JUnit test reports (get_pipeline_test_report). - Merge Request Reviews & Diff Discussions: Two-stage diff inspection (
get_merge_request_changes), automated lockfile pruning (package-lock.json), and inline diff discussions with SHA coordinate resolution (create_diff_discussion). - Issues & Task Planning: CRUD issues, track blockers/dependencies (
list_issue_links,create_issue_link), and add progress notes (list_issue_notes,create_issue_note). - Milestones & Labels: Human-readable milestone resolution, label creation, and scoped milestone inspection.
- Wikis & Snippets: Documentation outline slicing (
toc_only: true), chapter extraction, and snippet management. - User & Identity Context: Authenticated identity lookup, group enumeration and creation (
create_group), and owned project discovery.
Quickstart & Installation
Option 1: Run with npx (No installation needed)
Option 2: Install Globally
Option 3: Local Clone
Environment Configuration
Client Configuration
Google Antigravity / Claude Desktop / Cursor
Add to your MCP configuration file (mcp_config.json or claude_desktop_config.json):
Complete Action Catalog Reference (90 Actions across 14 Domains)
All 90 actions feature strict input validation and field-mask projections:
1. The 5 Client-Exposed Tools (Hybrid Mode)
2. Enterprise & Self-Hosted Operations (enterprise — 6 actions)
3. Repository & Project Management (repositories — 10 actions)
4. Branch Governance (branches — 7 actions)
5. Git Commits & History (commits — 2 actions)
6. Pipelines & CI/CD Observability (pipelines — 10 actions)
7. Merge Requests & Code Reviews (merge-requests — 12 actions)
8. Issues & Roadmaps (issues — 8 actions)
9. Milestones & Labels (milestones — 6 actions)
10. Releases & Tags (releases — 5 actions)
11. Project Collaborators & Roles (members — 5 actions)
12. CI/CD Environment Variables (variables — 5 actions)
13. Wikis & Documentation (wikis — 4 actions)
14. Snippets & Code Pastes (snippets — 4 actions)
15. User & Group Context (user — 6 actions)
Benchmarks: Token Economy in Action
Reproducible deterministic benchmark (node test/benchmark-test.js & node test/catalog-execution-test.js) measured against canonical GitLab REST API v4 payloads (test/fixtures/gitlab-api-v4-fixtures.js, token count = Math.ceil(utf8Bytes / 4)):
Complete 90-Action Catalog Benchmark (Across All 14 Domains)
Measured across all 90 handlers via node test/catalog-execution-test.js:
Key Token Optimization Pillars:
- Smart Diff & Lockfile Truncation: Commit diffs (
get_commit) and MR changes (get_merge_request_changes) automatically collapse dependency lockfiles (package-lock.json,pnpm-lock.yaml,yarn.lock,go.sum,Cargo.lock,*.min.js) viaignore_lockfiles: trueby default, saving 1,000–3,000 tokens per review. Passignore_lockfiles: falseif full lockfile diffs are required. - Conservative Default Pagination: All list actions default to
per_page: 10(max: 100), eliminating token waste from loading 20–50 items when only recent entries are needed. - Default High-Density Markdown Format: Discovery (
gitlab_find_actions), execution (gitlab_execute_action), project info (get_project), file inspection (get_file_contents), and commit inspection (get_commit) default toformat: "markdown", yielding 75%–96% token reductions for structured metadata. - Recursive Output Projection Filter (
projectOutput): Strips GitLab REST API v4 noise metadata keys (_links,avatar_url,references,time_stats,task_completion_status,commands_changes,user_notes_count,merge_requests_count,upvotes,downvotes,subscribed,has_tasks,service_desk_reply_to,moved_to_id,container_expiration_policy,permissions, and null/empty fields) before payloads reach LLM context.
Roadmap
Upcoming (v3.2)
- Upstream indexed filtering & strict pagination caps (
state,labels,milestone,author_id,assignee_id) - Client error resilience (401 probe disambiguation, 403 insufficient scope, 429 rate limit backoff, 201 ghost write guard)
- Hardened output projection with recursion depth guard (
maxDepth = 32) and empty collection preservation - Nested subgroup hierarchy management (
create_groupwithparent_id) - Smart CI/CD failure log extraction & ANSI sequence stripping in
get_job_trace(strip_ansi,smart_failure) - Outline-first code symbol extraction & line range slicing in
get_file_contents(outline_only,start_line,end_line) - Pre-flight mergeability & conflict verification (
get_mergeability) - Token scope self-auditing & permission pre-flight
Future Horizons (v3.x)
- Standardized collection
_summaryheaders to facilitate multi-turn history pruning in LiteLLM / Eigent agent orchestration - Remote Transports: Streamable SSE and HTTP remote server modes
- Scoped GraphQL query engine for relational deep inspections
- DevSecOps vulnerability & secret scanning alert queries
- Scoped & rate-guarded code search within project repositories
Acknowledgements & Lineage
This project incorporates architectural concepts, schemas, and patterns from:
@modelcontextprotocol/server-gitlab(MIT License) — Copyright (c) 2024 Anthropic, PBC / GitLab, PBC. Baseline repository and file schema patterns.@modelcontextprotocol/sdk(MIT License) — Copyright (c) Anthropic, PBC.zod(MIT License) — Colin McDonnell.- GitLab REST API v4 — GitLab, PBC.
jmrplens/gitlab-mcp-server— Dynamic action discovery and meta-dispatcher pattern concepts.- Architectural patterns evaluated from
Vijay-Duke/mcp-gitlabandzereight/gitlab-mcp.
See NOTICE for complete third-party attribution details.
License
This project is licensed under the MIT License — Copyright (c) 2026 [email protected].
来源:README.md,提交 7fcec0c
工具
0版本历史
5- v3.2.0最新Oct 17, 2026
- v3.1.0Oct 16, 2026
- v2.1.0Oct 15, 2026
- v2.0.0Oct 15, 2026
- v1.0.1Oct 14, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
其他 Gitlab 集成
Gitlab
com.gitlab官方发布者
Gitlab 的托管 MCP 服务,由 gitlab.com 发布;需要凭据;Streamable HTTP。

Gitlab Mcp
由 GitHub 账号 mmedum 发布
本地 stdio MCP 服务器,让助手以你的身份在 gitlab.com 项目中工作:议题、合并请求、评审、仓库与 CI。

Gitlab Ci Break Lint
由 GitHub 账号 jmshinhwa 发布
一个本地 MCP 服务器,用于标出 .gitlab-ci.yml 中在下一次 GitLab 大版本升级后会被 runner 拒绝的行。

Gitlab Mcp
由 GitHub 账号 mrfentmen 发布
让助手无需 API 密钥即可查询 GitLab 上的公开项目和用户信息。
GitLab MCP Server
由 GitHub 账号 zereight 发布
本地运行的 GitLab MCP 服务器,让助手通过 GitLab API 处理项目、合并请求、议题、流水线、Wiki 和发布。