MG

mcpland/gitlab-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

10 stars 9 forks 质量 84 趋势 26MIT

A MCP server for GitLab with powerful, safe, policy-controlled access

概览

A production-ready MCP server for GitLab. It lets AI assistants read and manage GitLab projects, merge requests, issues, pipelines, wikis, releases, and more through a broad, policy-controlled tool registry. - — projects, merge requests (with code-context analysis), issues, pipelines, wikis, milestones, releases, labels, commits, branches, GraphQL, and file management - — stdio for local CLI usage, Streamable HTTP for remote deployments, optional SSE - — personal access tokens, OAuth 2.0 PKCE, external token scripts, token files, cookie-based auth, and per-request remote authorization - — readonly/modify/full modes, tool allowlist/denylist, feature toggles, and project-scoped restrictions - — HTTP/HTTPS proxy, custom CA certificates, Cloudflare bypass, multi-instance API rotation - — JSON, compact JSON, or YAML formatting with configurable response size limits Claude Desktop, Claude Code, VS Code, GitHub Copilot Chat (VS Code), Cursor, JetBrains AI Assistant, GitLab Duo, and any MCP...

README

以下为原文 README 节选,完整内容请查看原文。

gitlab-mcp

A production-ready MCP server for GitLab. It lets AI assistants read and manage GitLab projects, merge requests, issues, pipelines, wikis, releases, and more through a broad, policy-controlled tool registry.

Highlights

  • Comprehensive GitLab coverage — projects, merge requests (with code-context analysis), issues, pipelines, wikis, milestones, releases, labels, commits, branches, GraphQL, and file management
  • Multiple transports — stdio for local CLI usage, Streamable HTTP for remote deployments, optional SSE
  • Flexible authentication — personal access tokens, OAuth 2.0 PKCE, external token scripts, token files, cookie-based auth, and per-request remote authorization
  • Policy engine — readonly/modify/full modes, tool allowlist/denylist, feature toggles, and project-scoped restrictions
  • Enterprise networking — HTTP/HTTPS proxy, custom CA certificates, Cloudflare bypass, multi-instance API rotation
  • Output control — JSON, compact JSON, or YAML formatting with configurable response size limits

Usage

Supported clients

Claude Desktop, Claude Code, VS Code, GitHub Copilot Chat (VS Code), Cursor, JetBrains AI Assistant, GitLab Duo, and any MCP client that supports stdio or streamable HTTP.

Current client format references:

Authentication methods

The server supports three auth patterns:

  1. Personal Access Token (PAT)
  2. OAuth 2.0 PKCE (recommended for local interactive use)
  3. Remote per-request auth (REMOTE_AUTHORIZATION=true, HTTP mode)
  1. Create a GitLab OAuth application in Settings -> Applications.
  2. Set redirect URI to http://127.0.0.1:8765/callback (or your custom callback).
  3. Set scope to api.
  4. Copy the Application ID as GITLAB_OAUTH_CLIENT_ID.
{
  "mcpServers": {
    "gitlab": {
      "command": "npx",
      "args": ["-y", "gitlab-mcp@latest"],
      "env": {
        "GITLAB_USE_OAUTH": "true",
        "GITLAB_OAUTH_CLIENT_ID": "your_oauth_client_id",
        "GITLAB_OAUTH_REDIRECT_URI": "http://127.0.0.1:8765/callback",
        "GITLAB_API_URL": "https://gitlab.com/api/v4",
        "GITLAB_ALLOWED_PROJECT_IDS": "",
        "GITLAB_PERMISSION_MODE": "full",
        "USE_GITLAB_WIKI": "true",
在 GitHub 查看完整 README

安装

npx -y gitlab-mcp@latest
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "gitlab": { "command": "npx", "args": ["-y", "gitlab-mcp@latest"], "env": { "GITLAB_USE_OAUTH": "true", "GITLAB_OAUTH_CLIENT_ID": "your_oauth_client_id", "GITLAB_OAUTH_REDIRECT_URI": "http://127.0.0.1:8765/callback", "GITLAB_API_URL": "https://gitlab.com/api/v4", "GITLAB_ALLOWED_PROJECT_IDS": "", "GITLAB_PERMISSION_MODE": "full", "USE_GITLAB_WIKI": "true", "USE_MILESTONE": "true", "USE_PIPELINE": "true" } } } }