Getting Started
Get up and running with GitLab MCP Server in under 5 minutes.
Prerequisites
Section titled “Prerequisites”Before you begin, make sure you have:
- A GitLab instance — GitLab.com, self-hosted CE, or EE
- A Personal Access Token (PAT) with the
apiscope - An MCP-compatible AI client — VS Code + Copilot, Claude Desktop, Cursor, or Claude Code
Creating a personal access token
Section titled “Creating a personal access token”- Go to GitLab → Preferences → Access Tokens
- Create a new token with the
apiscope - Copy the token — you’ll need it for configuration
Download
Section titled “Download”Download the latest binary for your platform from the GitHub Releases page:
| Platform | Binary |
|---|---|
| Linux (x86_64) | gitlab-mcp-server-linux-amd64 |
| Linux (ARM64) | gitlab-mcp-server-linux-arm64 |
| macOS (Intel) | gitlab-mcp-server-darwin-amd64 |
| macOS (Apple Silicon) | gitlab-mcp-server-darwin-arm64 |
| Windows (x86_64) | gitlab-mcp-server-windows-amd64.exe |
| Windows (ARM64) | gitlab-mcp-server-windows-arm64.exe |
Make it executable (Linux/macOS)
Section titled “Make it executable (Linux/macOS)”chmod +x gitlab-mcp-server-*Optionally, move it to a directory in your PATH:
sudo mv gitlab-mcp-server-linux-amd64 /usr/local/bin/gitlab-mcp-serverSetup wizard
Section titled “Setup wizard”The easiest way to configure the server is the built-in setup wizard:
./gitlab-mcp-server setup-wizardThe wizard will:
- Prompt for your GitLab URL and token
- Test the connection
- Auto-detect your AI client
- Generate the correct configuration file
Manual configuration
Section titled “Manual configuration”If you prefer to configure manually, choose your AI client:
Create or edit .vscode/mcp.json in your workspace root:
{ "servers": { "gitlab": { "type": "stdio", "command": "/path/to/gitlab-mcp-server", "env": { "GITLAB_URL": "https://gitlab.example.com", "GITLAB_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx" } } }}Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{ "mcpServers": { "gitlab": { "command": "/path/to/gitlab-mcp-server", "env": { "GITLAB_URL": "https://gitlab.example.com", "GITLAB_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx" } } }}Create or edit .cursor/mcp.json in your project root:
{ "mcpServers": { "gitlab": { "command": "/path/to/gitlab-mcp-server", "env": { "GITLAB_URL": "https://gitlab.example.com", "GITLAB_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx" } } }}Add the server using the CLI:
claude mcp add gitlab \ --transport stdio \ -- /path/to/gitlab-mcp-serverThen set the required environment variables:
export GITLAB_URL="https://gitlab.example.com"export GITLAB_TOKEN="glpat-xxxxxxxxxxxxxxxxxxxx"Or create a .env file in your working directory with the variables above.
Edit ~/.codeium/windsurf/mcp_config.json:
{ "mcpServers": { "gitlab": { "command": "/path/to/gitlab-mcp-server", "env": { "GITLAB_URL": "https://gitlab.example.com", "GITLAB_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx" } } }}- Open Settings → Tools → AI Assistant → MCP Servers
- Click + Add and select stdio
- Set the command to
/path/to/gitlab-mcp-server - Add environment variables:
GITLAB_URL=https://gitlab.example.comGITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx
- Click OK and restart the IDE
Edit your Zed settings.json and add:
{ "context_servers": { "gitlab": { "command": "/path/to/gitlab-mcp-server", "args": [], "env": { "GITLAB_URL": "https://gitlab.example.com", "GITLAB_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx" } } }}Create or edit .kiro/mcp.json in your project root:
{ "mcpServers": { "gitlab": { "command": "/path/to/gitlab-mcp-server", "args": [], "env": { "GITLAB_URL": "https://gitlab.example.com", "GITLAB_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx" } } }}Open the Cline sidebar → click the MCP servers icon → Edit Global MCP, or edit the settings file directly:
- macOS:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json - Linux:
~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json - Windows:
%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
{ "mcpServers": { "gitlab": { "command": "/path/to/gitlab-mcp-server", "env": { "GITLAB_URL": "https://gitlab.example.com", "GITLAB_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx" } } }}Open the Roo Code sidebar → click the MCP servers icon → Edit Global MCP (for global config) or Edit Project MCP (creates .roo/mcp.json):
{ "mcpServers": { "gitlab": { "command": "/path/to/gitlab-mcp-server", "env": { "GITLAB_URL": "https://gitlab.example.com", "GITLAB_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx" } } }}Using an .env file
Section titled “Using an .env file”Instead of placing secrets in client config files, you can use a .env file:
GITLAB_URL=https://gitlab.example.comGITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxxThe server loads .env from the current working directory automatically. See Configuration for the full load order.
HTTP mode
Section titled “HTTP mode”For team deployments, you can run the server in HTTP mode where each user authenticates with their own token:
./gitlab-mcp-server --http --http-addr=0.0.0.0:8080 --gitlab-url=https://gitlab.example.comEach client connects via HTTP and provides their own GitLab token. See HTTP Server Mode for details.
OAuth mode (recommended for production)
Section titled “OAuth mode (recommended for production)”For zero-config token management, use OAuth mode. Users authorize through the browser — no token copying or distribution required:
./gitlab-mcp-server --http --gitlab-url=https://gitlab.example.com --auth-mode=oauthMCP clients that support OAuth 2.1 (VS Code, Claude Code) discover the authorization server automatically via /.well-known/oauth-protected-resource. See docs/oauth-app-setup.md for creating the required GitLab OAuth Application.
Self-hosted GitLab
Section titled “Self-hosted GitLab”If you’re connecting to a self-hosted GitLab instance (Community Edition or Enterprise Edition), the setup is the same — just make sure GITLAB_URL points to your internal instance:
GITLAB_URL=https://gitlab.internal.company.comGITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxxSelf-signed certificates
Section titled “Self-signed certificates”Many self-hosted instances use self-signed or internal CA certificates. If you see x509: certificate signed by unknown authority errors, add:
GITLAB_SKIP_TLS_VERIFY=trueCommon configurations
Section titled “Common configurations”GITLAB_URL=https://gitlab.internal.company.comGITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxxGITLAB_URL=https://gitlab.company.com:8443GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxxGITLAB_URL=http://gitlab.local:3000GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxxGITLAB_URL=https://gitlab.internal.company.comGITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxxGITLAB_SKIP_TLS_VERIFY=trueBoth GitLab CE (free) and EE (Premium/Ultimate) are fully supported. For EE-exclusive features like DORA metrics, epics, and vulnerability management, enable enterprise mode with GITLAB_ENTERPRISE=true. See Configuration for all available options.
Verify the setup
Section titled “Verify the setup”Once configured, open your AI client and ask:
Who am I on GitLab?The server should return your GitLab user profile, confirming the connection is working. You can also try:
List my assigned merge requestsShow recent pipelines in my-projectIf you see results, you’re all set!
Understanding meta-tools
Section titled “Understanding meta-tools”By default, the server runs in meta-tool mode — instead of registering 1006 individual tools (which would consume most of the LLM’s context window), it consolidates them into 42 domain-level meta-tools that cover 100% of the functionality.
For example, instead of separate gitlab_list_issues, gitlab_create_issue, gitlab_close_issue tools, there’s a single gitlab_issue tool with an action parameter:
{ "tool": "gitlab_issue", "arguments": { "action": "create", "project": "my-group/my-project", "title": "Fix login redirect" }}This is transparent to you — your AI client handles the routing automatically. You just ask naturally: “create an issue for the login bug” and the LLM selects the right meta-tool and action.
Next steps
Section titled “Next steps”- Configuration — Fine-tune environment variables and optional features
- Meta-tools — Understand how tools are organized and discover all available operations
- Architecture — Understand how the server works under the hood
- Tools Reference — Explore all available tools by domain