Skip to content

Install GitLab MCP to Clients ​

Detect and install GitLab MCP configuration to MCP clients. Can run interactively (wizard) or non-interactively with flags.

Usage ​

bash
gitlab-mcp install [options]

Options ​

FlagDescription
--claude-desktopInstall to Claude Desktop
--claude-codeInstall to Claude Code
--cursorInstall to Cursor
--vscodeInstall to VS Code (GitHub Copilot)
--clineInstall to Cline
--roo-codeInstall to Roo Code
--windsurfInstall to Windsurf
--codexInstall to Codex, through the Codex CLI
--url <endpoint>Register a GitLab MCP server you reach over HTTP instead of a local one (Codex only)
--allInstall to all detected clients
--showPreview configuration without writing
--forceOverwrite existing configurations

Interactive Mode ​

Without any client flags, the command runs an interactive wizard:

  1. Detects all installed MCP clients
  2. Shows detection results (installed, configured, etc.)
  3. Presents multi-select for target clients
  4. Confirms overwrite if already configured
  5. Installs and shows results
bash
npx @structured-world/gitlab-mcp install

Non-Interactive Mode ​

Specify clients directly with flags:

bash
# Install to specific clients
npx @structured-world/gitlab-mcp install --claude-desktop --cursor

# Install to all detected clients
npx @structured-world/gitlab-mcp install --all

# Force overwrite existing config
npx @structured-world/gitlab-mcp install --claude-desktop --force

Preview Configuration ​

View the generated configuration without writing any files:

bash
# Preview Claude Desktop config
npx @structured-world/gitlab-mcp install --show --claude-desktop

# Preview Cursor config
npx @structured-world/gitlab-mcp install --show --cursor

Environment Variables ​

The install command reads from the current environment to build the server configuration:

VariablePurposeDefault
GITLAB_TOKENToken to embed in confignone
GITLAB_API_URLGitLab instance URLhttps://gitlab.com
GITLAB_MCP_PRESETPreset to applynone

Backup Behavior ​

When overwriting an existing configuration, the installer creates a backup:

~/.cursor/mcp.json → ~/.cursor/mcp.json.backup-2025-01-24T12-00-00

Supported Clients ​

ClientDetectionConfig Location (macOS)
Claude DesktopApp bundle~/Library/Application Support/Claude/claude_desktop_config.json
Claude CodeCLI command~/.claude.json
CursorConfig dir~/.cursor/mcp.json
VS CodeConfig dir.vscode/mcp.json
WindsurfConfig dir~/.codeium/windsurf/mcp_config.json
ClineExtension storage~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Roo CodeConfig dir~/.roo/mcp.json
CodexCLI command~/.codex/config.toml (or $CODEX_HOME/config.toml), edited by codex mcp

See Clients for paths on all platforms and Codex installation for how the Codex entry is replaced, rolled back and checked for duplicates.

The command exits with status 1 when any selected client fails or --all finds no supported client.

See Also ​

Released under the Apache 2.0 License.