GitLab MCP 服务器 标志

GitLab MCP 服务器

组织
yoda-digital

Production-grade GitLab MCP server with 86 tools — full GitLab control from any AI agent (Claude, Cursor, Zed).

发布者yoda-digital
代码仓库mcp-gitlab-server
语言TypeScript
复刻数
23
星标数
64
可用工具
0
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    GitLab MCP 服务器 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 64 个 Star 和 23 个 Fork。

GitLab MCP Server


What it is

GitLab MCP Server lets an AI agent (Claude Desktop, Claude Code, Cursor, Zed, VS Code, or any Model Context Protocol client) talk directly to GitLab. It is a typed, paginated, schema-validated bridge to the GitLab REST API, exposed as 86 MCP tools. It is not a wrapper around glab and it does not screen-scrape.

It runs against gitlab.com or any self-hosted GitLab instance, and authenticates with a personal access token, an OAuth Bearer token forwarded by an upstream gateway, or a read-only token for safe demos.


Why it exists

Anthropic released MCP on November 25, 2024. The reference servers covered Google Drive, Slack, GitHub, Git, Postgres, and Puppeteer. There was no GitLab server. The Yoda Digital engineering team runs on self-hosted GitLab, so the official examples did not help us, and the early community ports were not yet trying to cover the GitLab surface area properly.

We wrote one for ourselves. Group projects, activity tracking, the operations our DevOps actually needed. We open-sourced it on March 18, 2025, expecting maybe five people to find it useful.

A year on the project has 86 tools, working stdio / SSE / Streamable HTTP transports, PAT and OAuth modes, a Docker image on ghcr.io, and a Helm chart written almost entirely by an external contributor we had never met. Releases 0.4.0 and 0.5.0 are mostly someone else's code now, which is the best problem an open-source maintainer can have.


Quick start

Local clients (stdio)

For Claude Desktop, Cursor, Zed, and any client that runs MCP servers as a local subprocess. Add this to your client's MCP config (for Claude Desktop, that's claude_desktop_config.json):

json
{
  "mcpServers": {
    "gitlab": {
      "command": "npx",
      "args": ["-y", "@yoda.digital/gitlab-mcp-server"],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "glpat-…",
        "GITLAB_API_URL": "https://gitlab.com/api/v4"
      }
    }
  }
}

Self-hosted? Replace GITLAB_API_URL with your instance, e.g. https://gitlab.example.com/api/v4. Want a safe demo with no write access? Add "GITLAB_READ_ONLY_MODE": "true". Per-IDE notes are in docs/CURSOR_INTEGRATION.md.

Remote (Streamable HTTP, OAuth-gated)

For shared deployments and modern remote MCP clients, run the server as an HTTP service. Network-exposed deployments require AUTH_MODE=oauth — the server refuses to start with AUTH_MODE=pat on a non-loopback bind. See SECURITY.md for the threat model.

bash
docker run --rm -p 3000:3000 \
  -e HOST=0.0.0.0 \
  -e AUTH_MODE=oauth \
  -e USE_STREAMABLE_HTTP=true \
  ghcr.io/yoda-digital/mcp-gitlab-server:latest

Then front the container with a gateway that injects Authorization: Bearer <token> per connection — the server forwards that Bearer to GitLab as the per-connection PAT. Point clients at http://your-gateway/mcp.

Operational details, probe configuration, and troubleshooting are in docs/OPERATIONS.md.


What's in the box

86 tools, grouped by surface:

  • Repositories: search, create, fork, get and update project metadata.
  • Files and branches: read, create, update, and delete files; multi-file commits; branches (list, create, delete); repository tree.
  • Tags and releases: list and create tags; list and create releases.
  • Issues: create, list, update, notes, threaded discussions.
  • Merge requests: create, update, merge, rebase; approvals; auto-merge; notes, discussions, changes, commits.
  • CI/CD: pipelines (list, get, trigger, retry, cancel), jobs (list, get, log, retry, cancel), environments.
  • Wikis: project and group wikis, including attachments.
  • Groups and members: groups CRUD, subgroups, project and group members.
  • Labels and milestones: list, create, update; protected branches: list, protect, unprotect.
  • Users and meta: current user, list/get user, project events, commit history.

Full tool list in CLAUDE.md. Per-tool docs for selected tools in docs/api/.

Read-only mode (GITLAB_READ_ONLY_MODE=true) filters every mutating tool out at registration time. A misbehaving agent cannot see them, let alone call them.


Transports

TransportWhen to useFlag
stdioLocal clients (Claude Desktop, Cursor, Zed). The default.(default)
SSERemote clients still on the legacy SSE spec.USE_SSE=true
Streamable HTTPRemote clients on the current MCP Streamable HTTP spec.USE_STREAMABLE_HTTP=true

Streamable HTTP runs POST /mcp, GET /mcp, and DELETE /mcp, with session management via the MCP-Session-Id header. The /healthz endpoint returns 503 when active sessions exceed HEALTHZ_MAX_SESSIONS, intended for Kubernetes liveness and readiness probes.


Authentication

Two modes. The right one depends on whether the HTTP transport is reachable from the network.

OAuth per connection (AUTH_MODE=oauth, the default for network-exposed deployments). The server holds no static token. Every MCP connection brings its own Authorization: Bearer <token>, which the server forwards to GitLab as the effective PAT for that connection. Run it behind a gateway that handles your IdP. This is how you operate one shared deployment for an entire team. Required whenever bind is non-loopback.

PAT mode (AUTH_MODE=pat, loopback only). The server holds one personal access token in GITLAB_PERSONAL_ACCESS_TOKEN. The HTTP transport runs without authentication in this mode, so the server enforces a loopback-only bind (HOST=127.0.0.1) and refuses to start otherwise. Right choice for stdio clients and single-tenant local dev. Not supported in Helm — see the chart's auth-validation guard.


Configuration

VariableDefaultPurpose
GITLAB_PERSONAL_ACCESS_TOKEN—Required in PAT mode.
GITLAB_API_URLhttps://gitlab.com/api/v4GitLab API base URL. Point at your self-hosted instance if needed.
GITLAB_READ_ONLY_MODEfalseHide all write tools.
AUTH_MODEpatpat (loopback only) or oauth (any bind).
HOST127.0.0.1Bind address for HTTP transports. Set to 0.0.0.0 to expose to the network — but only with AUTH_MODE=oauth, otherwise startup refuses.
USE_SSEfalseEnable legacy SSE transport.
USE_STREAMABLE_HTTPfalseEnable MCP Streamable HTTP transport.
PORT3000HTTP listen port for SSE and Streamable HTTP.
CORS_ALLOW_ORIGINS(empty)Comma-separated allowlist. Empty means * in PAT-loopback mode (local dev only); empty in OAuth mode means deny. Wildcard is never emitted on a non-loopback bind.
HEALTHZ_MAX_SESSIONS10000/healthz flips to 503 above this threshold.

.env.example ships in the repo for local development.


Deployment

Docker

ghcr.io/yoda-digital/mcp-gitlab-server:latest

Multi-stage build on node:24-alpine. Runs as non-root (uid 1000) with all capabilities dropped. Compatible with read-only root filesystems and the seccompProfile: RuntimeDefault Kubernetes pod-security setting. Image tags follow semver on releases; latest tracks the most recent tagged release.

Kubernetes (Helm)

bash
helm install gitlab-mcp oci://ghcr.io/yoda-digital/charts/gitlab-mcp

The chart defaults to AUTH_MODE=oauth so a vanilla install is auth-gated. Front the Service with an Ingress or gateway that injects Authorization: Bearer <token> per connection.

The chart ships liveness and readiness probes against /healthz, an optional PodDisruptionBudget, ConfigMap and Secret with rolling-restart annotations, and five fail-loud guards that refuse to render bad configurations:

  • AUTH_MODE=pat with non-loopback HOST (CWE-306 — see chart/templates/auth-validation.yaml)
  • empty PAT in PAT mode without existingSecret
  • both existingSecret and inline secret.GITLAB_PERSONAL_ACCESS_TOKEN set (a silent precedence trap, otherwise)
  • PDB minAvailable >= replicaCount (drain deadlock)
  • both minAvailable and maxUnavailable set on the PDB (Kubernetes rejects this combination at admission)

values.yaml is annotated for helm-docs, and chart/README.md is regenerated and drift-checked in CI.


Security

Vulnerabilities go through GitHub's Private Vulnerability Reporting, not public issues. Threat model and scope are in SECURITY.md.

A few things that are true about the supply chain. Every npm publish is signed with Sigstore provenance via OIDC Trusted Publishing. CodeQL runs on every push and PR with the security-extended and security-and-quality query packs. Dependabot is on, grouped, and weekly. npm audit reports zero vulnerabilities at the current release. main requires PRs, status checks, squash or rebase merges, and linear history.

Read-only mode is enforced at tool registration, not at the request boundary. If a regression lets a write tool execute under GITLAB_READ_ONLY_MODE=true, that is a security bug. Please report it.


Where this fits in the ecosystem

There are several ways to combine GitLab and MCP. Pick the one that matches your situation:

  • GitLab's own built-in MCP server at https://<your-instance>/api/v4/mcp. 15 tools, requires GitLab Premium or Ultimate, OAuth integrated with your GitLab IdP. The right choice if you have the subscription and 15 tools is enough surface area for your agents.
  • zereight/gitlab-mcp, the largest community implementation. Broader auth surface (PAT, OAuth2 browser flow, OAuth proxy, remote authorization), more tools. A good fit if you want maximum coverage and do not mind a larger project to reason about.
  • mcpland/gitlab-mcp, with a policy-engine focus. OAuth2 PKCE, multi-instance routing, cookie-based auth. Good for tightly controlled enterprise deployments.
  • This server (@yoda.digital/gitlab-mcp-server). 86 tools, three transports, PAT and OAuth, Sigstore-provenanced npm releases, a non-root multi-stage Docker image, and a Helm chart with fail-loud guards. Good if you want a smaller, security-mature project that lands cleanly into a Kubernetes deployment.

None of these is universally best, and we will not pretend otherwise.


Contributing

PRs welcome. The shape we ask for:

  1. Fork, branch (feature/*, fix/*, docs/*, refactor/*).
  2. Conventional Commits (feat:, fix:, docs:, chore:, …). They drive the changelog.
  3. Add or update vitest tests for behavior changes. npm test is the gate.
  4. Open a PR. CI runs build-and-test, CodeQL, Dockerfile lint, Helm lint and template smoke test, and a Helm chart README drift check.

Local setup:

bash
git clone https://github.com/yoda-digital/mcp-gitlab-server.git
cd mcp-gitlab-server
npm install
npm test
npm run dev

Full guidelines are in CONTRIBUTING.md. AI-assisted contribution rules are in ai_code_of_conduct.md. Code of Conduct: CODE_OF_CONDUCT.md. A few good first issue tickets live in the issue tracker.


Contributors

This project has more authors than its origin suggests.

Ion (Nalyk) Calmîș is the original author and maintainer. CTO at Yoda Digital.

Olivier Gintrand (@ecthelion77) wrote the OAuth per-connection authentication path, the MCP Streamable HTTP transport, the multi-stage Dockerfile, and the Helm chart, including the fail-loud guards. Releases 0.4.0 and 0.5.0 are mostly his work, merged via PR #42 and PR #44.

Thomas Léveil (@thomasleveil) and BenSchoweCONPORT sent early PRs.

Dependabot is responsible for most of the chore commits in the changelog and never sleeps.

If you have sent a PR or a security report and you are not on this list, that is a bug. Please open an issue.


License

MIT.


Links


Built with ❤️ by Yoda.Digital

安装

TypingMind
{
  "mcpServers": {
    "mcp-gitlab-server": {
      "command": "npx",
      "args": [
        "-y",
        "@yoda.digital/gitlab-mcp-server"
      ],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "<GITLAB_PERSONAL_ACCESS_TOKEN>"
      }
    }
  }
}

将 GitLab MCP 服务器 MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 GitLab MCP 服务器 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 GitLab MCP 服务器 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 GitLab MCP 服务器 MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "mcp-gitlab-server": {
      "command": "npx",
      "args": [
        "-y",
        "@yoda.digital/gitlab-mcp-server"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 GitLab MCP 服务器 MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 GitLab MCP 服务器 MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 GitLab MCP 服务器 帮我完成这项任务吗?
GitLab MCP 服务器
当然。我已阅读。
以下是我使用 GitLab MCP 服务器 得到的结果。

常见问题

GitLab MCP 服务器 MCP 服务器有什么用途?

GitLab MCP 服务器 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 GitLab MCP 服务器 MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 GitLab MCP 服务器,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 GitLab MCP 服务器 MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 GitLab MCP 服务器 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 GitLab MCP 服务器 MCP 连接到 TypingMind?

GitLab MCP 服务器 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

GitLab MCP 服务器 MCP 在 TypingMind 中提供哪些工具?

GitLab MCP 服务器 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 GitLab MCP 服务器 MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 GitLab MCP 服务器 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇