GitLab MCP Server
Provides tools for managing GitLab resources such as projects, merge requests, issues, and CI/CD pipelines.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@GitLab MCP Serverlist my open merge requests"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
GitLab MCP Server
MCP server for GitLab REST API v4 built with fastmcp. Optimized for minimal token usage.
Prerequisites
For end users (Claude/Codex):
✅ Python 3.10+ installed on your system
✅ GitLab Personal Access Token
That's it! No manual installation needed - everything else is automatic.
Related MCP server: mcp-gitlab
How It Works
When you run the server through npx, the Node.js launcher automatically:
✅ Checks for Python - Looks for
python3orpythonin your PATH✅ Creates virtual environment - In
~/.cache/gitlab-mcp-server/venv✅ Installs dependencies -
fastmcpfromrequirements.txt✅ Caches everything - Fast subsequent launches
First run: ~10-30 seconds (one-time setup) Next runs: Instant (uses cached venv)
If Python is Not Found
If Python 3.10+ is not installed, the launcher will show instructions for your OS:
macOS:
brew install python@3.11or download from python.orgLinux:
sudo apt install python3orsudo yum install python3Windows: Download from python.org or
winget install Python.Python.3.11
You don't need to manually install fastmcp or create virtualenv! The launcher handles that.
Configuration
Claude Code
Add the server using the CLI:
claude mcp add gitlab --transport stdio \
--env GITLAB_TOKEN=your-gitlab-token \
--env GITLAB_URL=https://gitlab.com \
--env GITLAB_TIMEOUT=30 \
-- npx -y git+https://github.com/YOUR_ORG/YOUR_REPO.git#mainOr add to ~/.claude.json:
{
"mcpServers": {
"gitlab": {
"command": "npx",
"args": ["-y", "git+https://github.com/YOUR_ORG/YOUR_REPO.git#main"],
"env": {
"GITLAB_TOKEN": "your-gitlab-token",
"GITLAB_URL": "https://gitlab.com",
"GITLAB_TIMEOUT": "30"
}
}
}
}Codex
Add to ~/.codex/config.toml:
[mcp_servers.gitlab]
command = "npx"
args = ["-y", "git+https://github.com/YOUR_ORG/YOUR_REPO.git#main"]
startup_timeout_sec = 60
enabled = true
[mcp_servers.gitlab.env]
GITLAB_TOKEN = "your-gitlab-token"
GITLAB_URL = "https://gitlab.com"
GITLAB_TIMEOUT = "30"
MCP_TRANSPORT = "stdio"Note: Replace YOUR_ORG/YOUR_REPO with your GitHub repository path (e.g., myorg/gitlab-mcp-server).
Environment Variables
Variable | Required | Default | Description |
| Yes | - | GitLab Personal Access Token |
| No |
| GitLab instance URL |
| No |
| API timeout in seconds |
| No |
| Transport protocol |
| No |
| Custom cache directory for virtualenv |
Available Tools
This server exposes 20+ GitLab operations as MCP tools:
User
gitlab_whoami- Get current user profile and validate credentials
Projects
gitlab_list_projects- List GitLab projects (supports search, pagination)gitlab_get_project- Get single project details by ID or path
Branches
gitlab_list_branches- List repository branches in a project
Merge Requests
gitlab_list_merge_requests- List merge requests (filter by state: opened, merged, closed)gitlab_get_merge_request- Get single merge request detailsgitlab_create_merge_request- Create new merge requestgitlab_merge_merge_request- Merge a merge requestgitlab_list_merge_request_notes- List comments on a merge requestgitlab_create_merge_request_note- Add comment to a merge requestgitlab_list_merge_request_discussions- List discussion threads on a merge requestgitlab_create_merge_request_discussion_note- Reply to a discussion thread
Issues
gitlab_list_issues- List issues in a project (filter by state: opened, closed)gitlab_create_issue- Create new issuegitlab_list_issue_notes- List comments on an issuegitlab_create_issue_note- Add comment to an issue
Pipelines & CI/CD
gitlab_list_pipelines- List CI/CD pipelines (filter by ref, status)gitlab_get_pipeline- Get single pipeline detailsgitlab_create_pipeline- Trigger new pipelinegitlab_list_pipeline_jobs- List jobs in a pipelinegitlab_get_job- Get single job detailsgitlab_play_job- Start a manual jobgitlab_retry_job- Retry a failed jobgitlab_cancel_job- Cancel a running/pending job
All tools support GitLab.com and self-hosted GitLab instances via the GITLAB_URL environment variable.
For Developers
If you're developing or testing locally:
# Clone the repo
git clone https://github.com/YOUR_ORG/YOUR_REPO.git
cd YOUR_REPO
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
# Install dependencies
pip install -r requirements.txt
# Set environment variables
export GITLAB_TOKEN='your-gitlab-token'
export GITLAB_URL='https://gitlab.com'
# Run the server directly
python3 gitlab_mcp_server.py
# Or test via Node.js launcher
node bin/gitlab-mcp-server.jsNote for end users: You don't need to do this! The npx launcher handles everything automatically.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityBmaintenanceMCP server for interacting with GitLab API, supporting both self-hosted instances and gitlab.com. Provides tools for managing issues, merge requests, code review, pipelines, milestones, releases, search, and file access.Last updated696MIT
- Alicense-qualityBmaintenanceMCP server for the GitLab REST API providing tools to manage projects, merge requests, pipelines, CI/CD variables, approvals, issues, and code reviews.Last updated5MIT
- AlicenseAqualityCmaintenanceEnables interacting with GitLab repositories, merge requests, and code through natural language using MCP. Supports authentication with personal access tokens or OAuth2, and provides tools for listing projects, reading repository code, and analyzing merge request lifetimes.Last updated104MIT
- Flicense-qualityCmaintenanceExposes the GitLab REST API to MCP clients for managing projects, issues, merge requests, repositories, and CI/CD pipelines. It is multi-tenant, allowing each user to authenticate with their own token and instance URL.Last updated
Related MCP Connectors
GitLab Public MCP — wraps the GitLab REST API v4 (public endpoints, no auth)
A MCP server built for developers enabling Git based project management with project and personal…
GunBroker MCP Pack — wraps the GunBroker firearms-marketplace API.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/LoindP/gitLab_mcp_loind'
If you have feedback or need assistance with the MCP directory API, please join our Discord server