Skip to content

Configuration

GitLab MCP Server is configured through environment variables for stdio mode and CLI flags for HTTP mode. This page covers all configuration options.

This must be set for the server to start in stdio mode:

VariableDescriptionExample
GITLAB_TOKENPersonal Access Token with api scopeglpat-xxxxxxxxxxxxxxxxxxxx
VariableDefaultDescription
GITLAB_URLhttps://gitlab.comGitLab instance base URL. Set this for self-managed instances
GITLAB_SKIP_TLS_VERIFYfalseSkip TLS certificate verification for self-signed certs
META_TOOLStrueLegacy boolean selector: true for meta-tools or false for individual tools. Use TOOL_SURFACE for dynamic surfaces
TOOL_SURFACEExplicit tool catalog selector: meta, individual, dynamic, dynamic-2, or dynamic-3. When set, it overrides META_TOOLS
CAPABILITY_SURFACEfullResource and prompt catalog selector: full keeps the complete catalog; minimal keeps only gitlab://workspace/roots and disables optional resources and prompts
META_PARAM_SCHEMAopaqueMeta-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_ENTERPRISEfalseEnable 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_ONLYfalseDisable all mutating tools (create, update, delete)
GITLAB_SAFE_MODEfalseReturn structured JSON preview instead of executing mutating tools (dry-run mode)
EXCLUDE_TOOLSComma-separated list of tool names to exclude (e.g., gitlab_delete_project,gitlab_admin)
GITLAB_IGNORE_SCOPESfalseSkip automatic PAT scope detection — register all tools regardless of token scopes
LOG_LEVELinfoLog verbosity: debug, info, warn, error
VariableDefaultDescription
AUTO_UPDATEtrueAuto-update behavior: true (apply on start), check (notify only), false (disabled)
AUTO_UPDATE_REPOjmrplens/gitlab-mcp-serverGitHub repository for release assets
AUTO_UPDATE_INTERVAL1hPeriodic check interval (HTTP mode only)
AUTO_UPDATE_TIMEOUT60sPre-start download timeout (range: 5s–10m)
VariableDefaultDescription
YOLO_MODEfalseSkip destructive action confirmations (not recommended)
RATE_LIMIT_RPS0Per-server tools/call rate limit in req/s (0 = disabled)
RATE_LIMIT_BURST40Token-bucket burst size when RATE_LIMIT_RPS > 0
.env
# Required
GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx
# Optional
GITLAB_SKIP_TLS_VERIFY=false
META_TOOLS=true
GITLAB_ENTERPRISE=false
GITLAB_READ_ONLY=false
GITLAB_SAFE_MODE=false
EXCLUDE_TOOLS=
GITLAB_IGNORE_SCOPES=false
LOG_LEVEL=info
# Auto-update
AUTO_UPDATE=true

For self-managed GitLab, add GITLAB_URL=https://gitlab.example.com.

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}"
}
}
}
}

When running in HTTP mode (--http), configuration uses CLI flags instead of environment variables:

FlagDefaultDescription
--httpfalseEnable HTTP transport mode
--http-addr:8080Listen address and port
--gitlab-urlFixed GitLab instance URL. Omit to require GITLAB-URL per request
--skip-tls-verifyfalseSkip TLS verification
--meta-toolstrueEnable meta-tool mode. Set false for individual tools
--tool-surfaceExplicit tool catalog selector: meta, individual, dynamic, dynamic-2, or dynamic-3. Overrides --meta-tools
--meta-param-schemaopaqueMeta-tool params schema mode: opaque, compact, or full
--capability-surfacefullResource and prompt catalog selector: full or minimal
--enterprisefalseForce Enterprise/Premium tools when explicitly set; omit to auto-detect CE/EE per token+URL entry
--read-onlyfalseRead-only mode
--safe-modefalseIntercept mutating tools and return a JSON preview instead of executing them
--exclude-toolsComma-separated tool names to exclude
--ignore-scopesfalseSkip PAT scope detection
--max-http-clients100Maximum concurrent client sessions
--session-timeout30mIdle session timeout
--auto-updatetrueAuto-update mode
--auto-update-repojmrplens/gitlab-mcp-serverGitHub release repository
--auto-update-interval1hPeriodic update check interval
--auto-update-timeout60sPre-start download timeout (5s–10m)
--auth-modelegacyAuthentication mode: legacy or oauth
--oauth-cache-ttl15mOAuth token identity cache TTL (1m–2h)
--revalidate-interval15mToken re-validation interval; 0 to disable (upper bound: 24h)
--rate-limit-rps0Per-server tools/call rate limit in req/s (0 = disabled)
--rate-limit-burst40Token-bucket burst size when --rate-limit-rps > 0
--trusted-proxy-headerHTTP 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):

FlagDefaultDescription
--shutdownfalseTerminate all running instances and exit

Example:

Terminal window
# 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:8080

The server loads configuration in the following order (later sources override earlier ones):

  1. ~/.gitlab-mcp-server.env — User-level defaults (home directory)
  2. .env — Project-level configuration (current working directory)
  3. System environment variables — Exported variables in the shell
  4. CLI flags — Command-line arguments (highest priority)

For GitLab instances with self-signed TLS certificates:

Terminal window
GITLAB_SKIP_TLS_VERIFY=true

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_api scope

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