G

Gitlab MCP

by zereight · io.github.zereight/gitlab-mcp

GitLab MCP server for projects, merge requests, issues, pipelines, wiki, releases, and more.

npm Local · stdio GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-zereight-gitlab-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@zereight/mcp-gitlab"
      ],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "<YOUR_VALUE>",
        "GITLAB_PERSONAL_ACCESS_TOKEN_FILE": "<VALUE>",
        "GITLAB_JOB_TOKEN": "<YOUR_VALUE>",
        "GITLAB_AUTH_COOKIE_PATH": "<VALUE>",
        "GITLAB_USE_OAUTH": "<VALUE>",
        "GITLAB_OAUTH_CLIENT_ID": "<VALUE>",
        "GITLAB_OAUTH_TOKEN_SCRIPT": "<VALUE>",
        "GITLAB_API_URL": "https://gitlab.com/api/v4",
        "GITLAB_ALLOWED_PROJECT_IDS": "<VALUE>",
        "GITLAB_PERMISSION_MODE": "<VALUE>",
        "GITLAB_TOOLSETS": "<VALUE>",
        "GITLAB_TOOLS": "<VALUE>",
        "GITLAB_DENIED_TOOLS_REGEX": "<VALUE>",
        "GITLAB_TOOL_POLICY_APPROVE": "<VALUE>",
        "GITLAB_TOOL_POLICY_HIDDEN": "<VALUE>",
        "NODE_TLS_REJECT_UNAUTHORIZED": "<VALUE>",
        "GITLAB_CA_CERT_PATH": "<VALUE>",
        "GITLAB_MASKING_ENABLED": "false",
        "GITLAB_MASKING_CONFIG": "<VALUE>",
        "GITLAB_MASKING_POLICY_FILE": "<VALUE>",
        "GITLAB_MASKING_WORKSPACE_DIR": "<VALUE>"
      }
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-zereight-gitlab-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@zereight/mcp-gitlab"
      ],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "<YOUR_VALUE>",
        "GITLAB_PERSONAL_ACCESS_TOKEN_FILE": "<VALUE>",
        "GITLAB_JOB_TOKEN": "<YOUR_VALUE>",
        "GITLAB_AUTH_COOKIE_PATH": "<VALUE>",
        "GITLAB_USE_OAUTH": "<VALUE>",
        "GITLAB_OAUTH_CLIENT_ID": "<VALUE>",
        "GITLAB_OAUTH_TOKEN_SCRIPT": "<VALUE>",
        "GITLAB_API_URL": "https://gitlab.com/api/v4",
        "GITLAB_ALLOWED_PROJECT_IDS": "<VALUE>",
        "GITLAB_PERMISSION_MODE": "<VALUE>",
        "GITLAB_TOOLSETS": "<VALUE>",
        "GITLAB_TOOLS": "<VALUE>",
        "GITLAB_DENIED_TOOLS_REGEX": "<VALUE>",
        "GITLAB_TOOL_POLICY_APPROVE": "<VALUE>",
        "GITLAB_TOOL_POLICY_HIDDEN": "<VALUE>",
        "NODE_TLS_REJECT_UNAUTHORIZED": "<VALUE>",
        "GITLAB_CA_CERT_PATH": "<VALUE>",
        "GITLAB_MASKING_ENABLED": "false",
        "GITLAB_MASKING_CONFIG": "<VALUE>",
        "GITLAB_MASKING_POLICY_FILE": "<VALUE>",
        "GITLAB_MASKING_WORKSPACE_DIR": "<VALUE>"
      }
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-zereight-gitlab-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@zereight/mcp-gitlab"
      ],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "<YOUR_VALUE>",
        "GITLAB_PERSONAL_ACCESS_TOKEN_FILE": "<VALUE>",
        "GITLAB_JOB_TOKEN": "<YOUR_VALUE>",
        "GITLAB_AUTH_COOKIE_PATH": "<VALUE>",
        "GITLAB_USE_OAUTH": "<VALUE>",
        "GITLAB_OAUTH_CLIENT_ID": "<VALUE>",
        "GITLAB_OAUTH_TOKEN_SCRIPT": "<VALUE>",
        "GITLAB_API_URL": "https://gitlab.com/api/v4",
        "GITLAB_ALLOWED_PROJECT_IDS": "<VALUE>",
        "GITLAB_PERMISSION_MODE": "<VALUE>",
        "GITLAB_TOOLSETS": "<VALUE>",
        "GITLAB_TOOLS": "<VALUE>",
        "GITLAB_DENIED_TOOLS_REGEX": "<VALUE>",
        "GITLAB_TOOL_POLICY_APPROVE": "<VALUE>",
        "GITLAB_TOOL_POLICY_HIDDEN": "<VALUE>",
        "NODE_TLS_REJECT_UNAUTHORIZED": "<VALUE>",
        "GITLAB_CA_CERT_PATH": "<VALUE>",
        "GITLAB_MASKING_ENABLED": "false",
        "GITLAB_MASKING_CONFIG": "<VALUE>",
        "GITLAB_MASKING_POLICY_FILE": "<VALUE>",
        "GITLAB_MASKING_WORKSPACE_DIR": "<VALUE>"
      }
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-zereight-gitlab-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@zereight/mcp-gitlab"
      ],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "<YOUR_VALUE>",
        "GITLAB_PERSONAL_ACCESS_TOKEN_FILE": "<VALUE>",
        "GITLAB_JOB_TOKEN": "<YOUR_VALUE>",
        "GITLAB_AUTH_COOKIE_PATH": "<VALUE>",
        "GITLAB_USE_OAUTH": "<VALUE>",
        "GITLAB_OAUTH_CLIENT_ID": "<VALUE>",
        "GITLAB_OAUTH_TOKEN_SCRIPT": "<VALUE>",
        "GITLAB_API_URL": "https://gitlab.com/api/v4",
        "GITLAB_ALLOWED_PROJECT_IDS": "<VALUE>",
        "GITLAB_PERMISSION_MODE": "<VALUE>",
        "GITLAB_TOOLSETS": "<VALUE>",
        "GITLAB_TOOLS": "<VALUE>",
        "GITLAB_DENIED_TOOLS_REGEX": "<VALUE>",
        "GITLAB_TOOL_POLICY_APPROVE": "<VALUE>",
        "GITLAB_TOOL_POLICY_HIDDEN": "<VALUE>",
        "NODE_TLS_REJECT_UNAUTHORIZED": "<VALUE>",
        "GITLAB_CA_CERT_PATH": "<VALUE>",
        "GITLAB_MASKING_ENABLED": "false",
        "GITLAB_MASKING_CONFIG": "<VALUE>",
        "GITLAB_MASKING_POLICY_FILE": "<VALUE>",
        "GITLAB_MASKING_WORKSPACE_DIR": "<VALUE>"
      }
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-zereight-gitlab-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@zereight/mcp-gitlab"
      ],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "<YOUR_VALUE>",
        "GITLAB_PERSONAL_ACCESS_TOKEN_FILE": "<VALUE>",
        "GITLAB_JOB_TOKEN": "<YOUR_VALUE>",
        "GITLAB_AUTH_COOKIE_PATH": "<VALUE>",
        "GITLAB_USE_OAUTH": "<VALUE>",
        "GITLAB_OAUTH_CLIENT_ID": "<VALUE>",
        "GITLAB_OAUTH_TOKEN_SCRIPT": "<VALUE>",
        "GITLAB_API_URL": "https://gitlab.com/api/v4",
        "GITLAB_ALLOWED_PROJECT_IDS": "<VALUE>",
        "GITLAB_PERMISSION_MODE": "<VALUE>",
        "GITLAB_TOOLSETS": "<VALUE>",
        "GITLAB_TOOLS": "<VALUE>",
        "GITLAB_DENIED_TOOLS_REGEX": "<VALUE>",
        "GITLAB_TOOL_POLICY_APPROVE": "<VALUE>",
        "GITLAB_TOOL_POLICY_HIDDEN": "<VALUE>",
        "NODE_TLS_REJECT_UNAUTHORIZED": "<VALUE>",
        "GITLAB_CA_CERT_PATH": "<VALUE>",
        "GITLAB_MASKING_ENABLED": "false",
        "GITLAB_MASKING_CONFIG": "<VALUE>",
        "GITLAB_MASKING_POLICY_FILE": "<VALUE>",
        "GITLAB_MASKING_WORKSPACE_DIR": "<VALUE>"
      }
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-zereight-gitlab-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@zereight/mcp-gitlab"
      ],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "<YOUR_VALUE>",
        "GITLAB_PERSONAL_ACCESS_TOKEN_FILE": "<VALUE>",
        "GITLAB_JOB_TOKEN": "<YOUR_VALUE>",
        "GITLAB_AUTH_COOKIE_PATH": "<VALUE>",
        "GITLAB_USE_OAUTH": "<VALUE>",
        "GITLAB_OAUTH_CLIENT_ID": "<VALUE>",
        "GITLAB_OAUTH_TOKEN_SCRIPT": "<VALUE>",
        "GITLAB_API_URL": "https://gitlab.com/api/v4",
        "GITLAB_ALLOWED_PROJECT_IDS": "<VALUE>",
        "GITLAB_PERMISSION_MODE": "<VALUE>",
        "GITLAB_TOOLSETS": "<VALUE>",
        "GITLAB_TOOLS": "<VALUE>",
        "GITLAB_DENIED_TOOLS_REGEX": "<VALUE>",
        "GITLAB_TOOL_POLICY_APPROVE": "<VALUE>",
        "GITLAB_TOOL_POLICY_HIDDEN": "<VALUE>",
        "NODE_TLS_REJECT_UNAUTHORIZED": "<VALUE>",
        "GITLAB_CA_CERT_PATH": "<VALUE>",
        "GITLAB_MASKING_ENABLED": "false",
        "GITLAB_MASKING_CONFIG": "<VALUE>",
        "GITLAB_MASKING_POLICY_FILE": "<VALUE>",
        "GITLAB_MASKING_WORKSPACE_DIR": "<VALUE>"
      }
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
GITLAB_PERSONAL_ACCESS_TOKEN secret Yes Your GitLab personal access token.
GITLAB_PERSONAL_ACCESS_TOKEN_FILE No 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.
GITLAB_JOB_TOKEN secret No Optional GitLab CI job token to use instead of a personal access token when running inside GitLab CI.
GITLAB_AUTH_COOKIE_PATH No Optional path to a GitLab authentication cookie file for cookie-based authentication.
GITLAB_USE_OAUTH No Set to true to start with GitLab OAuth instead of a personal access token, job token, or cookie file.
GITLAB_OAUTH_CLIENT_ID No GitLab OAuth application ID. When GITLAB_USE_OAUTH=true, set this or GITLAB_OAUTH_TOKEN_SCRIPT.
GITLAB_OAUTH_TOKEN_SCRIPT No Command that prints an OAuth access token. When GITLAB_USE_OAUTH=true, set this or GITLAB_OAUTH_CLIENT_ID.
GITLAB_API_URL No Your GitLab API URL. Defaults to https://gitlab.com/api/v4 Default: https://gitlab.com/api/v4
GITLAB_ALLOWED_PROJECT_IDS No Optional comma-separated list of GitLab project IDs that this server is allowed to access.
GITLAB_PERMISSION_MODE No Tool exposure. Allowed values are readonly, modify, and full. Unset uses full. readonly keeps read-only tools. modify blocks delete and teardown tools.
GITLAB_TOOLSETS No 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).
GITLAB_TOOLS No Optional comma-separated list of individual tool names to add on top of enabled toolsets.
GITLAB_DENIED_TOOLS_REGEX No Optional regular expression used to hide matching tools from the server.
GITLAB_TOOL_POLICY_APPROVE No Optional comma-separated list of tool names that require explicit approval before execution.
GITLAB_TOOL_POLICY_HIDDEN No Optional comma-separated list of tool names to hide from tools/list.
NODE_TLS_REJECT_UNAUTHORIZED No Set to 0 only when you intentionally need to connect to a GitLab instance with invalid or self-signed TLS certificates.
GITLAB_CA_CERT_PATH No Optional path to a custom CA certificate file for self-managed GitLab instances.
GITLAB_MASKING_ENABLED No Set to true to mask text tool results and returned errors using built-in or configured rules. Default: false
GITLAB_MASKING_CONFIG No Optional path to a response-masking JSON configuration file.
GITLAB_MASKING_POLICY_FILE No Optional protected server-owned JSON file containing managed masking policies.
GITLAB_MASKING_WORKSPACE_DIR No Directory used to resolve response-masking configuration paths.

Similar servers