GitLab MCP Server
Lässt deinen KI-Agenten mit GitLab-Projekten, Merge Requests, Issues, Pipelines, Wikis und Releases arbeiten.
2.1k Sterne auf GitHubvon zereightLizenz MITAktualisiert vor 18 Tagen
So installierst du ihn
Dieser MCP ist lokal: Er läuft auf deinem Computer.
Er funktioniert in Apps auf deinem PC (Claude Desktop, Claude Code, Cursor, VS Code…). Wähle deine App:
Füge im Terminal ein:
claude mcp add gitlab -- npx -y @zereight/mcp-gitlab
Was du ausfüllen musst
| Name | Wofür | Pflicht |
|---|---|---|
GITLAB_PERSONAL_ACCESS_TOKEN | GitLab personal access token for local stdio use. A non-empty value overrides GITLAB_PERSONAL_ACCESS_TOKEN_FILE. One of this token, GITLAB_PERSONAL_ACCESS_TOKEN_FILE, GITLAB_JOB_TOKEN, GITLAB_AUTH_COOKIE_PATH, or GITLAB_USE_OAUTH=true must be set. Create a token with the GitLab scopes the tools need, such as api or read_api. | Nein |
GITLAB_PERSONAL_ACCESS_TOKEN_FILE | Path to a file that contains the personal access token. Read once at startup and trimmed. Ignored when GITLAB_PERSONAL_ACCESS_TOKEN or --token is non-empty. A missing, unreadable, or empty file stops startup. Does not replace job token, OAuth, cookie, or remote authorization. | Nein |
GITLAB_JOB_TOKEN | Optional GitLab CI job token to use instead of a personal access token when running inside GitLab CI. | Nein |
GITLAB_AUTH_COOKIE_PATH | Optional path to a GitLab authentication cookie file for cookie-based authentication. | Nein |
GITLAB_USE_OAUTH | Set to true to start with GitLab OAuth instead of a personal access token, job token, or cookie file. | Nein |
GITLAB_OAUTH_CLIENT_ID | GitLab OAuth application ID. When GITLAB_USE_OAUTH=true, set this or GITLAB_OAUTH_TOKEN_SCRIPT. | Nein |
GITLAB_OAUTH_TOKEN_SCRIPT | Command that prints an OAuth access token. When GITLAB_USE_OAUTH=true, set this or GITLAB_OAUTH_CLIENT_ID. | Nein |
GITLAB_API_URL | GitLab API base URL. Use https://gitlab.com/api/v4 for GitLab.com or your self-managed GitLab API URL. | Nein |
GITLAB_ALLOWED_PROJECT_IDS | Optional comma-separated list of GitLab project IDs that this server is allowed to access. | Nein |
GITLAB_PERMISSION_MODE | Tool exposure. Allowed values are readonly, modify, and full. Unset uses full. readonly keeps read-only tools. modify blocks delete and teardown tools. | Nein |
GITLAB_TOOLSETS | Optional comma-separated toolset ids (projects, issues, merge_requests, …). Unset keeps the lean core default plus discover_tools. Do not set all unless you accept loading ~all schemas (~73k tokens). | Nein |
GITLAB_TOOLS | Optional comma-separated list of individual tool names to add on top of enabled toolsets. | Nein |
GITLAB_DENIED_TOOLS_REGEX | Optional regular expression used to hide matching tools from the server. | Nein |
GITLAB_TOOL_POLICY_APPROVE | Optional comma-separated list of tool names that require explicit approval before execution. | Nein |
GITLAB_TOOL_POLICY_HIDDEN | Optional comma-separated list of tool names to hide from tools/list. | Nein |
NODE_TLS_REJECT_UNAUTHORIZED | Set to 0 only when you intentionally need to connect to a GitLab instance with invalid or self-signed TLS certificates. | Nein |
GITLAB_CA_CERT_PATH | Optional path to a custom CA certificate file for self-managed GitLab instances. | Nein |
GITLAB_MASKING_ENABLED | Set to true to mask text tool results and returned errors using built-in or configured rules. | Nein |
GITLAB_MASKING_CONFIG | Optional path to a response-masking JSON configuration file. | Nein |
GITLAB_MASKING_POLICY_FILE | Optional protected server-owned JSON file containing managed masking policies. | Nein |
GITLAB_MASKING_WORKSPACE_DIR | Directory used to resolve response-masking configuration paths. | Nein |
Fertig! Jetzt testen
Starte die App neu und füge eine dieser Anfragen im Chat ein:
Liste die geänderten Dateien im Merge Request 123 von group/project auf.
Zeig mir die Ausgabe des fehlgeschlagenen Pipeline-Jobs.
Was es ist
Dieser Server verbindet deinen Agenten über die REST- und GraphQL-API mit GitLab. Er startet mit 40 Tools und kann weitere nach Kategorie aktivieren, insgesamt bis zu 288. Er unterstützt gitlab.com und selbst betriebene Instanzen sowie einen Nur-Lese-Modus.
Was er kann
list_merge_request_changed_filesundget_merge_request_file_diff: einen Merge Request in zwei Schritten prüfenget_pipeline_job_output: Job-Protokolle seitenweise lesendiscover_tools: weitere Tool-Kategorien aktivierenhelpexecute_graphql- Projekte, Issues, Wiki, Releases, Tags und Meilensteine
jmespath-Option, um große Ergebnisse zu verkleinern
Wann du ihn nutzt
- ›Wenn dein Agent einen Merge Request Datei für Datei prüfen soll.
- ›Wenn eine Pipeline fehlschlägt und du das Job-Protokoll ohne GitLab-Oberfläche willst.
- ›Wenn du Issues und Meilensteine direkt aus dem Chat verwalten willst.
Was du brauchst
npm install -g @zereight/mcp-gitlab, dann das Programm zereight-mcp-gitlab verwenden.Skills, die dazu passen
MCP oder Skill?
Der MCP gibt dem Agenten die Hände. Der Skill zeigt, wie man sie richtig benutzt. Zusammen wird das Ergebnis besser und braucht weniger Tokens.
gitlab-automationLässt deinen Agenten Projektmanagement in GitLab automatisieren. Hilft, Issues, Merge Requests und Pipelines per Programm zu steuern.building-devsecops-pipeline-with-gitlab-ciLässt deinen Agenten Sicherheit in den Entwicklungsprozess einbauen. Er prüft Code und Anwendungen auf Schwachstellen, bevor sie veröffentlicht werden.github-gitlabGibt deinem Agenten Zugriff auf GitHub- oder GitLab-Projekte, um Issues, Pull Requests und den Verlauf zu prüfen und kleine, freigegebene Änderungen vorzunehmen.Häufige Fragen
Wie viele Tools zeigt er?
Standardmäßig 40 (38 Kern-Tools plus discover_tools und help). Insgesamt gibt es 288.
Sollte ich alle Tools laden?
Nein. Die README rät davon ab, GITLAB_TOOLSETS=all zu setzen, das kostet etwa 73k Schema-Token. Nutze stattdessen discover_tools.
Wie melde ich mich an?
Mit GITLAB_PERSONAL_ACCESS_TOKEN, lokalem OAuth, MCP-OAuth für Claude.ai oder einer Autorisierung pro Anfrage.
Funktioniert es mit selbst betriebenem GitLab?
Ja, setze GITLAB_API_URL auf deine Instanz.
Kann ich es auch ohne MCP nutzen?
Ja. Ein Skill- und CLI-Weg erledigt dieselben Abläufe im Terminal mit zereight-mcp-gitlab.
Ist das api-Toolset sicher?
Die README warnt, dass es Allowlists und Sicherheitsprüfungen umgeht und durch Prompt Injection gesteuert werden kann. Aktiviere es nur bewusst.
Wenn es nicht funktioniert
- ›Prüfe, ob das Token gesetzt ist und GITLAB_API_URL stimmt, zum Beispiel https://gitlab.com/api/v4.
- ›Prüfe, ob deine Node.js-Version 20 oder neuer ist.
- ›Verwende für project_id einen URL-kodierten Projektpfad wie group%2Fproject.
5 neue Skills pro Woche. 1 Minute Lesezeit.