Get the FREE Ultimate OpenClaw Setup Guide →

gitlab

MCP server for GitLab - DevOps platform with CI/CD integration

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio lokimcpuniverse-gitlab-mcp-server python -m gitlab_mcp_server \
  --env LOG_LEVEL="INFO" \
  --env GITLAB_BASE_URL="https://gitlab.example.com" \
  --env GITLAB_API_TOKEN="your_gitlab_personal_access_token"

How to use

This MCP server integrates GitLab with GenAI applications using the MCP (Model Context Protocol) framework. It exposes a Python-based GitLab MCP server that provides comprehensive access to the GitLab API, supports multiple authentication methods, and includes error handling with retry logic for robust integration. The server is designed to be lightweight and asynchronous to handle high-throughput scenarios typical of CI/CD workflows. Use the server to feed GitLab data (projects, pipelines, issues, merge requests, etc.) into GenAI applications for tasks like code analysis, release automation, and intelligent incident response. After starting the server, you can configure clients or tools to connect to it via the MCP protocol endpoints and begin exchanging contextually rich GitLab objects supported by the API.

How to install

Prerequisites:

  • Python 3.8+ installed on the host
  • pip available for installing Python packages
  • Access to a GitLab instance and a personal access token (PAT) with the required scopes

Install from PyPI:

pip install gitlab-mcp-server

Install from source:

Clone the repository

git clone https://github.com/LokiMCPUniverse/gitlab-mcp-server.git cd gitlab-mcp-server

Optional: create and activate a virtual environment

python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate

Install in editable mode for development

pip install -e .

Configure environment variables (example):

Run the server:

python -m gitlab_mcp_server

Alternatively, if you are packaging for deployment, ensure your deployment environment sets the required variables as described above.

Additional notes

Environment variables are essential for authenticating with GitLab. Ensure GITLAB_BASE_URL is set to the base URL of your GitLab instance (including https://). The GITLAB_API_TOKEN should be a PAT with the appropriate scopes for the data you plan to access. If you encounter rate limiting or retry issues, adjust LOG_LEVEL or implement backoff strategies as supported by the server. The MCP server supports asynchronous operation for better performance under load. If running behind a container or orchestrator, pass environment variables through your deployment descriptor and mount any necessary configuration files if required by your setup.

Related MCP Servers

Sponsor this space

Reach thousands of developers