Configuration
GitLab MCP Server is configured through environment variables for stdio mode and CLI flags for HTTP mode. This page covers all configuration options.
Required variables
Section titled “Required variables”This must be set for the server to start in stdio mode:
| Variable | Description | Example |
|---|---|---|
GITLAB_TOKEN | Personal Access Token with api scope | glpat-xxxxxxxxxxxxxxxxxxxx |
Core options
Section titled “Core options”| Variable | Default | Description |
|---|---|---|
GITLAB_URL | https://gitlab.com | GitLab instance base URL. Set this for self-managed instances |
GITLAB_SKIP_TLS_VERIFY | false | Skip TLS certificate verification for self-signed certs |
META_TOOLS | true | Legacy boolean selector: true for meta-tools or false for individual tools. Use TOOL_SURFACE for dynamic surfaces |
TOOL_SURFACE | — | Explicit tool catalog selector: meta, individual, dynamic, dynamic-2, or dynamic-3. When set, it overrides META_TOOLS |
CAPABILITY_SURFACE | full | Resource and prompt catalog selector: full keeps the complete catalog; minimal keeps only gitlab://workspace/roots and disables optional resources and prompts |
META_PARAM_SCHEMA | opaque | Meta-tool input-schema strategy: opaque (default), compact (~5x), or full (~10x). Per-action schema is discoverable via gitlab://schema/meta/{tool}/{action} when CAPABILITY_SURFACE=full |
GITLAB_ENTERPRISE | false | Enable Enterprise/Premium tools in stdio mode. In HTTP mode, --enterprise can force the catalog; otherwise edition is auto-detected per token+URL entry |
GITLAB_READ_ONLY | false | Disable all mutating tools (create, update, delete) |
GITLAB_SAFE_MODE | false | Return structured JSON preview instead of executing mutating tools (dry-run mode) |
EXCLUDE_TOOLS | — | Comma-separated list of tool names to exclude (e.g., gitlab_delete_project,gitlab_admin) |
GITLAB_IGNORE_SCOPES | false | Skip automatic PAT scope detection — register all tools regardless of token scopes |
LOG_LEVEL | info | Log verbosity: debug, info, warn, error |
Auto-update
Section titled “Auto-update”| Variable | Default | Description |
|---|---|---|
AUTO_UPDATE | true | Auto-update behavior: true (apply on start), check (notify only), false (disabled) |
AUTO_UPDATE_REPO | jmrplens/gitlab-mcp-server | GitHub repository for release assets |
AUTO_UPDATE_INTERVAL | 1h | Periodic check interval (HTTP mode only) |
AUTO_UPDATE_TIMEOUT | 60s | Pre-start download timeout (range: 5s–10m) |
Admin options
Section titled “Admin options”| Variable | Default | Description |
|---|---|---|
YOLO_MODE | false | Skip destructive action confirmations (not recommended) |
RATE_LIMIT_RPS | 0 | Per-server tools/call rate limit in req/s (0 = disabled) |
RATE_LIMIT_BURST | 40 | Token-bucket burst size when RATE_LIMIT_RPS > 0 |
Example .env file
Section titled “Example .env file”# RequiredGITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx
# OptionalGITLAB_SKIP_TLS_VERIFY=falseMETA_TOOLS=trueGITLAB_ENTERPRISE=falseGITLAB_READ_ONLY=falseGITLAB_SAFE_MODE=falseEXCLUDE_TOOLS=GITLAB_IGNORE_SCOPES=falseLOG_LEVEL=info
# Auto-updateAUTO_UPDATE=trueFor self-managed GitLab, add GITLAB_URL=https://gitlab.example.com.
Client configuration
Section titled “Client configuration”Create .vscode/mcp.json in your workspace:
{ "servers": { "gitlab": { "type": "stdio", "command": "/path/to/gitlab-mcp-server", "env": { "GITLAB_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx" } } }}Secure token configuration using VS Code input variables:
{ "inputs": [ { "id": "gitlab-token", "type": "promptString", "description": "GitLab Personal Access Token", "password": true } ], "servers": { "gitlab": { "type": "stdio", "command": "/path/to/gitlab-mcp-server", "env": { "GITLAB_TOKEN": "${input:gitlab-token}" } } }}Edit claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{ "mcpServers": { "gitlab": { "command": "/path/to/gitlab-mcp-server", "env": { "GITLAB_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx" } } }}Create .cursor/mcp.json in your project:
{ "mcpServers": { "gitlab": { "command": "/path/to/gitlab-mcp-server", "env": { "GITLAB_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx" } } }}claude mcp add gitlab \ --transport stdio \ -- /path/to/gitlab-mcp-serverSet environment variables before launching:
export GITLAB_TOKEN="glpat-xxxxxxxxxxxxxxxxxxxx"Set GITLAB_URL here only for self-managed instances.
Or use a .env file in the working directory.
Add to ~/.continue/config.yaml (or your workspace .continue/config.yaml):
mcpServers: - name: gitlab command: /path/to/gitlab-mcp-server env: GITLAB_TOKEN: glpat-xxxxxxxxxxxxxxxxxxxxReload the Continue window after editing the config. See the Continue MCP docs for HTTP-mode and OAuth alternatives.
Edit ~/.codeium/windsurf/mcp_config.json (Cascade → Plugins → Configure):
{ "mcpServers": { "gitlab": { "command": "/path/to/gitlab-mcp-server", "env": { "GITLAB_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx" } } }}Restart Windsurf or click Refresh in the Plugins panel to pick up changes.
JetBrains IDEs (IntelliJ IDEA, GoLand, PyCharm, etc.) with the AI Assistant plugin support MCP servers via Settings → Tools → AI Assistant → Model Context Protocol.
Add a stdio entry pointing at the binary:
- Name:
gitlab - Command:
/path/to/gitlab-mcp-server - Environment variables:
GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx
Add GITLAB_URL=https://gitlab.example.com for self-managed GitLab.
Alternatively, create .idea/mcp.json in the project root with the same JSON shape used by VS Code / Cursor. Restart the IDE after editing.
HTTP mode flags
Section titled “HTTP mode flags”When running in HTTP mode (--http), configuration uses CLI flags instead of environment variables:
| Flag | Default | Description |
|---|---|---|
--http | false | Enable HTTP transport mode |
--http-addr | :8080 | Listen address and port |
--gitlab-url | — | Fixed GitLab instance URL. Omit to require GITLAB-URL per request |
--skip-tls-verify | false | Skip TLS verification |
--meta-tools | true | Enable meta-tool mode. Set false for individual tools |
--tool-surface | — | Explicit tool catalog selector: meta, individual, dynamic, dynamic-2, or dynamic-3. Overrides --meta-tools |
--meta-param-schema | opaque | Meta-tool params schema mode: opaque, compact, or full |
--capability-surface | full | Resource and prompt catalog selector: full or minimal |
--enterprise | false | Force Enterprise/Premium tools when explicitly set; omit to auto-detect CE/EE per token+URL entry |
--read-only | false | Read-only mode |
--safe-mode | false | Intercept mutating tools and return a JSON preview instead of executing them |
--exclude-tools | — | Comma-separated tool names to exclude |
--ignore-scopes | false | Skip PAT scope detection |
--max-http-clients | 100 | Maximum concurrent client sessions |
--session-timeout | 30m | Idle session timeout |
--auto-update | true | Auto-update mode |
--auto-update-repo | jmrplens/gitlab-mcp-server | GitHub release repository |
--auto-update-interval | 1h | Periodic update check interval |
--auto-update-timeout | 60s | Pre-start download timeout (5s–10m) |
--auth-mode | legacy | Authentication mode: legacy or oauth |
--oauth-cache-ttl | 15m | OAuth token identity cache TTL (1m–2h) |
--revalidate-interval | 15m | Token re-validation interval; 0 to disable (upper bound: 24h) |
--rate-limit-rps | 0 | Per-server tools/call rate limit in req/s (0 = disabled) |
--rate-limit-burst | 40 | Token-bucket burst size when --rate-limit-rps > 0 |
--trusted-proxy-header | — | HTTP header with real client IP for rate limiting behind proxies (e.g. Fly-Client-IP, X-Forwarded-For) |
General flags (both stdio and HTTP modes):
| Flag | Default | Description |
|---|---|---|
--shutdown | false | Terminate all running instances and exit |
Example:
# Single GitLab.com instance (fixed URL for all clients; replace for self-managed GitLab)./gitlab-mcp-server \ --http \ --http-addr=0.0.0.0:8080 \ --gitlab-url=https://gitlab.com \ --max-http-clients=200 \ --session-timeout=1h
# Multi-instance (each client specifies their GitLab URL via GITLAB-URL header)./gitlab-mcp-server \ --http \ --http-addr=0.0.0.0:8080Configuration load order
Section titled “Configuration load order”The server loads configuration in the following order (later sources override earlier ones):
~/.gitlab-mcp-server.env— User-level defaults (home directory).env— Project-level configuration (current working directory)- System environment variables — Exported variables in the shell
- CLI flags — Command-line arguments (highest priority)
Self-signed certificates
Section titled “Self-signed certificates”For GitLab instances with self-signed TLS certificates:
GITLAB_SKIP_TLS_VERIFY=trueRead-only mode
Section titled “Read-only mode”Enable GITLAB_READ_ONLY=true to restrict the server to read-only operations. All tools that create, update, or delete resources are disabled. This is useful for:
- Audit and compliance environments
- Shared servers where users should only query data
- Tokens with
read_apiscope
Safe mode
Section titled “Safe mode”Enable GITLAB_SAFE_MODE=true to intercept mutating tools and return a structured JSON preview of what would be executed, without actually performing the operation. Read-only tools work normally. This is useful for:
- Reviewing operations before execution (dry-run)
- Training environments where you want to see tool behavior
- Debugging tool parameters without side effects