Skip to content

npm / npx Installation

The simplest way to run GitLab MCP Server.

TIP

For guided setup with auto-detection, use the Setup Wizard:

bash
npx @structured-world/gitlab-mcp setup

npx (No Installation)

json
{
  "mcpServers": {
    "gitlab": {
      "command": "npx",
      "args": ["-y", "@structured-world/gitlab-mcp"],
      "env": {
        "GITLAB_TOKEN": "your_gitlab_token",
        "GITLAB_API_URL": "https://gitlab.com",
        "GITLAB_READ_ONLY_MODE": "false"
      }
    }
  }
}

Yarn dlx

json
{
  "mcpServers": {
    "gitlab": {
      "command": "yarn",
      "args": ["dlx", "-q", "@structured-world/gitlab-mcp@latest", "stdio"],
      "env": {
        "GITLAB_TOKEN": "your_gitlab_token",
        "GITLAB_API_URL": "https://gitlab.com"
      }
    }
  }
}

Environment Variables

All configuration is done via environment variables. See Configuration for the complete reference.

Required

VariableDescription
GITLAB_TOKENGitLab personal access token with api scope

Optional

VariableDescriptionDefault
GITLAB_API_URLGitLab instance URLhttps://gitlab.com
GITLAB_PROJECT_IDDefault project ID
GITLAB_ALLOWED_PROJECT_IDSComma-separated allowed project IDs
GITLAB_READ_ONLY_MODERestrict to read-only toolsfalse

Feature Flags

Enable or disable tool groups by setting these to true or false:

json
{
  "env": {
    "USE_LABELS": "true",
    "USE_MRS": "true",
    "USE_FILES": "true",
    "USE_VARIABLES": "true",
    "USE_WORKITEMS": "true",
    "USE_WEBHOOKS": "true",
    "USE_SNIPPETS": "true",
    "USE_INTEGRATIONS": "true",
    "USE_GITLAB_WIKI": "true",
    "USE_MILESTONE": "true",
    "USE_PIPELINE": "true",
    "USE_RELEASES": "true",
    "USE_REFS": "true",
    "USE_MEMBERS": "true",
    "USE_SEARCH": "true"
  }
}

Released under the Apache 2.0 License.