Skip to content

Getting Started

Get up and running with GitLab MCP Server in under 5 minutes.

Before you begin, make sure you have:

  1. A GitLab instance — GitLab.com, self-hosted CE, or EE
  2. A Personal Access Token (PAT) with the api scope
  3. An MCP-compatible AI client — VS Code + Copilot, Claude Desktop, Cursor, or Claude Code
  1. Go to GitLab → Preferences → Access Tokens
  2. Create a new token with the api scope
  3. Copy the token — you’ll need it for configuration

Download the latest binary for your platform from the GitHub Releases page:

PlatformBinary
Linux (x86_64)gitlab-mcp-server-linux-amd64
Linux (ARM64)gitlab-mcp-server-linux-arm64
macOS (Intel)gitlab-mcp-server-darwin-amd64
macOS (Apple Silicon)gitlab-mcp-server-darwin-arm64
Windows (x86_64)gitlab-mcp-server-windows-amd64.exe
Windows (ARM64)gitlab-mcp-server-windows-arm64.exe
Terminal window
chmod +x gitlab-mcp-server-*

Optionally, move it to a directory in your PATH:

Terminal window
sudo mv gitlab-mcp-server-linux-amd64 /usr/local/bin/gitlab-mcp-server

The easiest way to configure local stdio clients is the built-in setup wizard:

Terminal window
gitlab-mcp-server --setup

The wizard will:

  • Prompt for your GitLab URL and token
  • Load any existing configuration so you can keep or change previous values
  • Configure supported MCP clients
  • Write ~/.gitlab-mcp-server.env without placing secrets in client JSON files

Install as an Open Plugin (Cursor / Claude Code)

Section titled “Install as an Open Plugin (Cursor / Claude Code)”

This repository ships an Open Plugins v1.0.0 manifest (.plugin/plugin.json) and referenced MCP config (mcp.json) so the server can be installed in a single step on any conformant host (Cursor, Claude Code, OpenCode):

Terminal window
# Cursor / Claude Code (when supported by your version)
/plugin install jmrplens/gitlab-mcp-server

The plugin uses the published Docker image ghcr.io/jmrplens/gitlab-mcp-server:latest via docker run -i --rm, so you need Docker installed and running. The bundled mcp.json is configured for stdio MCP clients and passes --http=false after the image name to override the Docker image’s HTTP default. Keep that override if you copy the Docker configuration into VS Code or another stdio client; otherwise the container will start an HTTP listener and the client will wait forever for a stdio initialize response.

The host must provide these variables before enabling the plugin:

VariableRequiredDescription
GITLAB_URLNoGitLab instance URL. Defaults to https://gitlab.com; set for self-managed instances
GITLAB_TOKENYesPersonal Access Token (glpat-...)
GITLAB_SKIP_TLS_VERIFYNotrue for self-signed certs (default false)
META_TOOLSNoLegacy boolean selector: true for meta-tools or false for individual tools (default true)
TOOL_SURFACENoExplicit tool catalog selector: meta, individual, dynamic, dynamic-2, or dynamic-3
CAPABILITY_SURFACENoResource and prompt catalog selector: full or minimal (default full)
GITLAB_ENTERPRISENotrue to enable Premium/Ultimate tools (default false)
GITLAB_READ_ONLYNotrue to disable mutating tools (default false)
GITLAB_SAFE_MODENotrue to preview mutating tool inputs (default false)
LOG_LEVELNodebug, info, warn, error (default info)

TOOL_SURFACE is the preferred current selector and takes precedence over META_TOOLS when both are set. Use TOOL_SURFACE=meta instead of META_TOOLS=true, TOOL_SURFACE=individual instead of META_TOOLS=false, and TOOL_SURFACE=dynamic, dynamic-2, or dynamic-3 for dynamic surfaces. META_TOOLS remains supported for backward compatibility but should be treated as deprecated in favor of the explicit selector.

The Open Plugins spec runs every entry in the referenced MCP config automatically, so the bundled config uses Docker stdio for portability. For detached HTTP deployments, do not use a stdio client entry; run the Docker image in HTTP mode and configure the MCP client with type: "http" and a URL such as http://localhost:8080/mcp. See HTTP Server Mode.

If you prefer the native binary, install the plugin, locate the installed gitlab-mcp-server plugin directory from your host’s plugin UI or installation output, and then edit its local mcp.json (commonly under .agents/plugins/gitlab-mcp-server/) to replace the Docker command / args with a path to the platform binary you downloaded from GitHub Releases:

{
"mcpServers": {
"gitlab": {
"command": "/usr/local/bin/gitlab-mcp-server",
"env": {
"GITLAB_TOKEN": "${GITLAB_TOKEN}"
}
}
}
}

GITLAB_URL defaults to https://gitlab.com; add it only for self-managed GitLab instances.

If you prefer to configure manually, choose your AI client:

Create or edit .vscode/mcp.json in your workspace root:

{
"servers": {
"gitlab": {
"type": "stdio",
"command": "/path/to/gitlab-mcp-server",
"env": {
"GITLAB_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx"
}
}
}
}

Instead of placing secrets in client config files, you can use a .env file:

.env
GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx

Add GITLAB_URL=https://gitlab.example.com for self-managed GitLab.

The server loads .env from the current working directory automatically. See Configuration for the full load order.

For team deployments, you can run the server in HTTP mode where each user authenticates with their own token:

Terminal window
./gitlab-mcp-server --http --http-addr=0.0.0.0:8080 --gitlab-url=https://gitlab.com

Each client connects via HTTP and provides their own GitLab token. See HTTP Server Mode for details.

For zero-config token management, use OAuth mode. Users authorize through the browser — no token copying or distribution required:

Terminal window
./gitlab-mcp-server --http --gitlab-url=https://gitlab.com --auth-mode=oauth

MCP clients that support OAuth 2.1 (VS Code, Claude Code) discover the authorization server automatically via /.well-known/oauth-protected-resource. See docs/oauth-app-setup.md for creating the required GitLab OAuth Application.

If you’re connecting to a self-hosted GitLab instance (Community Edition or Enterprise Edition), the setup is the same — just make sure GITLAB_URL points to your internal instance:

.env
GITLAB_URL=https://gitlab.internal.company.com
GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx

Many self-hosted instances use self-signed or internal CA certificates. If you see x509: certificate signed by unknown authority errors, add:

.env
GITLAB_SKIP_TLS_VERIFY=true
.env
GITLAB_URL=https://gitlab.internal.company.com
GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx

Both GitLab CE (free) and EE (Premium/Ultimate) are fully supported. For EE-exclusive features like DORA metrics, epics, and vulnerability management, enable the Enterprise/Premium catalog with GITLAB_ENTERPRISE=true in stdio mode or --enterprise/auto-detection in HTTP mode. See Configuration for all available options.

Once configured, open your AI client and ask:

Who am I on GitLab?

The server should return your GitLab user profile, confirming the connection is working. You can also try:

List my assigned merge requests
Show recent pipelines in my-project

If you see results, you’re all set!

By default, the server runs in meta-tool mode — instead of registering hundreds of individual tools (up to 1011 on GitLab.com Enterprise/Premium), it consolidates them into 32 domain-level meta-tools (47 on self-managed Enterprise/Premium, 48 on GitLab.com Enterprise/Premium with Orbit) that cover 100% of the functionality.

For example, instead of separate gitlab_list_issues, gitlab_create_issue, gitlab_close_issue tools, there’s a single gitlab_issue tool with an action parameter:

{
"tool": "gitlab_issue",
"arguments": {
"action": "create",
"project": "my-group/my-project",
"title": "Fix login redirect"
}
}

This is transparent to you — your AI client handles the routing automatically. You just ask naturally: “create an issue for the login bug” and the LLM selects the right meta-tool and action.

  • Configuration — Fine-tune environment variables and optional features
  • Meta-tools — Understand how tools are organized and discover all available operations
  • Architecture — Understand how the server works under the hood
  • Tools Reference — Explore all available tools by domain