Get the FREE Ultimate OpenClaw Setup Guide →

gitlab

A Model Context Protocol (MCP) server that provides GitLab integration tools for Claude Code.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio sgaunet-gitlab-mcp docker run -i sgaunet/gitlab-mcp \
  --env GITLAB_URI="Optional: self-hosted GitLab instance URL (e.g., https://gitlab.example.com)" \
  --env GITLAB_TOKEN="GitLab personal access token with api, read_api, and write_api scopes"

How to use

This MCP server provides GitLab integration tools for Claude Code, enabling you to interact with GitLab projects, issues, labels, epics, and CI/CD pipelines directly from Claude. After starting the container, Claude can communicate with the server to list, create, and update issues and labels, fetch and modify project metadata (descriptions and topics), manage epics (Premium/Ultimate tier), and monitor pipelines and job logs. Use the installed command-line client inside Claude to issue tool requests, and leverage the CLI flags to tailor the set of active tools to your needs.

Key capabilities include:

  • Issue management: list, create, update issues, and add comments
  • Label management: list labels and filter them as needed
  • Project management: read and update project descriptions and topics
  • Epic management: list and create epics (requires appropriate GitLab tier)
  • CI/CD integration: monitor pipelines, view job logs, and download traces
  • Direct project access via namespace/project-name paths without needing IDs

To use, configure your environment with the required GitLab token and, if applicable, the GitLab URI for self-hosted instances. Then deploy the Docker-based MCP server and invoke Claude Code tooling to interact with GitLab through the MCP gateway.

How to install

Prerequisites:

  • Docker installed on the host (with proper permissions to run containers)
  • A GitLab personal access token with api, read_api, and write_api scopes
  • Optional: GitLab URI if you are using a self-hosted instance

Installation steps:

  1. Pull and run the MCP container:
# Set environment variables (replace placeholders accordingly)
export GITLAB_TOKEN=your_personal_access_token
export GITLAB_URI=https://your.gitlab.instance  # optional for self-hosted

# Run the MCP server in Docker
docker run -d --name gitlab-mcp \
  -e GITLAB_TOKEN="$GITLAB_TOKEN" \
  -e GITLAB_URI="$GITLAB_URI" \
  -p 8080:8080 \
  sgaunet/gitlab-mcp
  1. Verify the container is running:
docker ps | grep gitlab-mcp
  1. Configure Claude Code to point to the MCP server endpoint (as exposed by your environment). If you expose via localhost, ensure Claude Code can reach the host port (e.g., http://localhost:8080).

  2. If you prefer building from source (advanced): clone the repository, install dependencies, and build the binary, then run with your preferred runner. (Follow the repository’s development docs for Go-based builds if applicable.)

Additional notes

Tips and common considerations:

  • If your GitLab instance is self-hosted, ensure GITLAB_URI is set to the correct base URL and that the token has the required scopes.
  • When using Docker, you can map a host port to access the MCP API from Claude Code or other clients.
  • The available tools have specific purposes (e.g., list_issues, create_issues, update_project_description). You can disable certain tool sets via CLI flags on your GitLab MCP client if your workflow requires minimal interaction.
  • Epics functionality requires the appropriate GitLab tier (Premium/Ultimate).
  • For large projects, consider filtering by project or group to optimize responses and reduce token usage.
  • Check the container logs if you encounter authentication errors or 401/403 responses from GitLab; the logs can indicate misconfigurations in GITLAB_TOKEN or GITLAB_URI.

Related MCP Servers

Sponsor this space

Reach thousands of developers