mcp-gitlab
Provides tools for managing GitLab projects, merge requests, pipelines, CI/CD variables, approvals, issues, code reviews, branches, commits, tags, releases, groups, and discussions via the GitLab REST API.
Click on "Deploy 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., "@mcp-gitlablist 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.
mcp-gitlab
mcp-gitlab is a Model Context Protocol (MCP) server for the GitLab REST API that provides 83 tools, 7 resources, and 6 prompts for AI assistants to manage projects, merge requests, pipelines, CI/CD variables, approvals, issues, code reviews, and more. Works with Claude Desktop, Claude Code, Cursor, Windsurf, VS Code Copilot, and any MCP-compatible client.
Supports GitLab.com and self-hosted GitLab instances (CE/EE). No GitLab Duo or Premium required.
Built with FastMCP, httpx, and Pydantic.
Install: uvx mcp-gitlab | PyPI | MCP Registry | Changelog
1-Click Installation
💡 Tip: For other AI assistants (Claude Code, Windsurf, IntelliJ, Gemini CLI), visit the GitLab MCP Installation Gateway.
Prerequisite: Install
uvfirst (required for alluvxinstall flows). Install uv.
Claude Code
claude mcp add gitlab -- uvx mcp-gitlabWindsurf & IntelliJ
Windsurf: Add to ~/.codeium/windsurf/mcp_config.json
IntelliJ: Add to Settings | Tools | MCP Servers
Note: The actual server config starts at
gitlabinside themcpServersobject.
{
"mcpServers": {
"gitlab": {
"command": "uvx",
"args": ["mcp-gitlab"],
"env": {
"GITLAB_URL": "https://gitlab.example.com",
"GITLAB_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx"
}
}
}
}Gemini CLI
gemini mcp add -e GITLAB_URL=https://gitlab.example.com -e GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx gitlab uvx mcp-gitlabpip / uv
uv pip install mcp-gitlabRelated MCP server: gitlab-mcp
Configuration
Variable | Required | Default | Description |
| Yes | - | GitLab instance URL (e.g. |
| Yes | - | Authentication token (see below) |
| No |
| Set to |
| No |
| Request timeout in seconds |
| No |
| Set to |
Supported Token Types
The server checks these environment variables in order — first match wins:
GITLAB_TOKENGITLAB_PATGITLAB_PERSONAL_ACCESS_TOKENGITLAB_API_TOKEN
These accept any of the following token types:
Token Type | Format | Use Case |
Personal access token |
| User-level access with |
OAuth2 token |
| OAuth app integrations |
CI job token |
| GitLab CI pipeline access |
Compatibility
Client | Supported | Install Method |
Claude Desktop | Yes |
|
Claude Code | Yes |
|
Cursor | Yes | One-click deeplink or |
VS Code Copilot | Yes | One-click deeplink or |
Windsurf | Yes |
|
Any MCP client | Yes | stdio or HTTP transport |
Tools (83)
Category | Count | Tools |
Projects | 4 | get, create, delete, update merge settings |
Project Approvals | 10 | get/update config, CRUD approval rules (project + MR) |
Groups | 6 | list, get, share/unshare project, share/unshare group |
Branches | 3 | list, create, delete |
Commits | 4 | list, get (with diff), create, compare |
Merge Requests | 16 | list, get, create, update, merge, merge-sequence, rebase, changes, approve, unapprove, get approvals, list reviewers, list pipelines, list commits, subscribe, unsubscribe |
MR Notes | 6 | list, add, delete, update, award emoji, remove emoji |
MR Discussions | 4 | list, create (inline + multi-line), reply, resolve |
Pipelines | 5 | list, get (with jobs), create, retry, cancel |
Jobs | 4 | retry, play, cancel, get log |
Tags | 4 | list, get, create, delete |
Releases | 5 | list, get, create, update, delete |
CI/CD Variables | 8 | CRUD for project variables, CRUD for group variables |
Issues | 5 | list, get, create, update, add comment |
Projects
Tool | Description |
| Get project details |
| Create a new project |
| Delete a project |
| Update merge settings |
Project Approvals
Tool | Description |
| Get approval config |
| Update approval settings |
| List approval rules |
| Create approval rule |
| Update approval rule |
| Delete approval rule |
| List MR approval rules |
| Create MR approval rule |
| Update MR approval rule |
| Delete MR approval rule |
Groups
Tool | Description |
| List groups |
| Get group details |
| Share project with group |
| Unshare project from group |
| Share group with group |
| Unshare group from group |
Branches
Tool | Description |
| List branches |
| Create a branch |
| Delete a branch |
Commits
Tool | Description |
| List commits |
| Get commit (with optional diff) |
| Create commit with file actions |
| Compare branches/tags/commits |
Merge Requests
Tool | Description |
| List merge requests |
| Get MR details |
| Create merge request |
| Update merge request |
| Merge a merge request |
| Merge multiple MRs in order |
| Rebase a merge request |
| Get MR file changes |
| Approve a merge request |
| Remove approval from a merge request |
| Get MR approval state |
| List MR pipelines |
| List MR commits |
| Subscribe to MR notifications |
| Unsubscribe from MR notifications |
MR Notes
Tool | Description |
| List MR comments |
| Add comment to MR |
| Delete MR comment |
| Update MR comment |
| Award emoji to note |
| Remove emoji from note |
MR Discussions
Tool | Description |
| List discussions |
| Create discussion (inline + multi-line) |
| Reply to discussion |
| Resolve/unresolve discussion |
Pipelines
Tool | Description |
| List pipelines |
| Get pipeline (with optional jobs) |
| Trigger pipeline |
| Retry failed jobs |
| Cancel pipeline |
Jobs
Tool | Description |
| Retry a job |
| Trigger manual job |
| Cancel a job |
| Get job log output |
Tags
Tool | Description |
| List tags |
| Get tag details |
| Create a tag |
| Delete a tag |
Releases
Tool | Description |
| List releases |
| Get release details |
| Create a release |
| Update a release |
| Delete a release |
CI/CD Variables
Tool | Description |
| List project variables |
| Create project variable |
| Update project variable |
| Delete project variable |
| List group variables |
| Create group variable |
| Update group variable |
| Delete group variable |
Issues
Tool | Description |
| List issues |
| Get issue details |
| Create an issue |
| Update an issue |
| Add comment to issue |
Resources (7)
The server exposes curated workflow guides as MCP resources that clients can read on demand.
URI | Name | Description |
| GitLab CI/CD Pipeline Patterns | Stage design, job rules, caching, artifacts, |
| Git Workflow Standards | Branch naming, trunk-based flow, merge vs rebase, protected branches |
| Merge Request Best Practices | MR size, description templates, review checklists, thread resolution |
| Conventional Commits Spec | Commit types, scopes, breaking changes, changelog generation |
| Code Review Standards | Review priorities, inline comments, approval workflows, nit vs blocker |
| GitLab CODEOWNERS Reference | Syntax, section owners, approval rules, pattern matching |
| Approval Workflow Guide | Approval types, project vs MR-level rules, SHA safety, merge readiness |
Prompts (6)
The server provides MCP prompts — reusable multi-tool workflow templates that clients can surface as slash commands.
Prompt | Parameters | Workflow |
|
| Fetch MR → check pipeline → review changes → write discussion notes |
|
| Check approvals → verify pipeline → review changes → approve or request changes |
|
| Fetch pipeline → identify failed jobs → get logs → suggest fix |
|
| Compare commits since last tag → draft changelog → create tag + release |
|
| Review settings → configure merge method → set approval rules |
|
| List open issues → categorize → prioritize → identify duplicates |
Usage Examples
Projects & Branches
"Get details for project my-org/api-gateway"
→ gitlab_get_project(project_id="my-org/api-gateway")
"Create a feature branch from main"
→ gitlab_create_branch(project_id="123", branch_name="feat/login", ref="main")
"Delete all branches merged into main"
→ gitlab_list_branches(project_id="123") → filter merged → gitlab_delete_branch for eachMerge Requests & Code Review
"Open a merge request from feat/login to main"
→ gitlab_create_mr(project_id="123", source_branch="feat/login", target_branch="main", title="Add login")
"Review MR !42 — list changes and add inline comments"
→ gitlab_mr_changes(project_id="123", mr_iid=42)
→ gitlab_create_mr_discussion(project_id="123", mr_iid=42, body="nit: ...", new_path="src/auth.py", new_line=15)
"Merge MR !42 after resolving all threads"
→ gitlab_list_mr_discussions(project_id="123", mr_iid=42) → resolve unresolved
→ gitlab_merge_mr(project_id="123", mr_iid=42, squash=True)Pipelines & CI/CD
"Show failed pipelines on main this week"
→ gitlab_list_pipelines(project_id="123", ref="main", status="failed")
"Retry a failed pipeline"
→ gitlab_retry_pipeline(project_id="123", pipeline_id=456)
"Get the build log for job 789"
→ gitlab_get_job_log(project_id="123", job_id=789, tail_lines=100)Issues
"Create a bug report in project 123"
→ gitlab_create_issue(project_id="123", title="Login page 500 error", labels=["bug","P1"])
"Find open issues assigned to me"
→ gitlab_list_issues(project_id="123", state="opened", assignee_username="johndoe")Security Considerations
Token scope: Use the minimum required scope.
apiscope grants full access; preferread_apifor read-only deployments.Read-only mode: Set
GITLAB_READ_ONLY=trueto disable all write operations (create, update, delete, merge). Read-only mode is enforced server-side before any API call.SSL verification:
GITLAB_SSL_VERIFY=trueby default. Only disable for self-signed certificates in trusted networks.CI/CD variable masking:
gitlab_list_variablesandgitlab_list_group_variablesautomatically mask values of variables marked as masked in GitLab, returning***MASKED***instead of the actual value.MCP tool annotations: Each tool declares
readOnlyHint,destructiveHint, andidempotentHintfor client-side permission prompts.No credential storage: The server does not persist tokens. Credentials are read from environment variables at startup.
Rate Limits & Permissions
Rate Limits
GitLab enforces per-user rate limits (default: 2000 requests/minute for authenticated users). When rate-limited, tools return a 429 error with a hint to wait before retrying. Paginated endpoints default to 20 results per page; use per_page (max 100) to reduce the number of API calls.
Required Permissions
Operation | Minimum GitLab Role |
Read projects, MRs, pipelines, issues | Reporter |
Create branches, MRs, issues | Developer |
Merge MRs, manage CI/CD variables | Maintainer |
Delete projects, manage approval rules | Maintainer/Owner |
Share projects/groups | Owner (or Admin) |
CLI & Transport Options
# Default: stdio transport (for MCP clients)
uvx mcp-gitlab
# HTTP transport (SSE or streamable-http)
uvx mcp-gitlab --transport sse --host 127.0.0.1 --port 8000
uvx mcp-gitlab --transport streamable-http --port 9000
# CLI overrides for config
uvx mcp-gitlab --gitlab-url https://gitlab.example.com --gitlab-token glpat-xxx --read-onlyThe server loads .env files from the working directory automatically via python-dotenv.
Related MCP Servers
mcp-atlassian-extended — Jira + Confluence integration (23 tools, 15 resources, 5 prompts)
mcp-coda — Coda.io integration (54 tools, 12 resources, 5 prompts)
Development
git clone https://github.com/vish288/mcp-gitlab.git
cd mcp-gitlab
uv sync --all-extras
uv run pytest --cov
uv run ruff check .
uv run ruff format --check .License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
GitLab MCP — wraps the GitLab REST API v4 (BYO API key)
Go MCP server for GitLab: 2 dynamic tools reach 1000+ REST/GraphQL actions. Free/CE, no paid tier.
GitLab Public MCP — wraps the GitLab REST API v4 (public endpoints, no auth)
Related MCP Servers
- -licenseAqualityAmaintenanceMCP Server for the GitLab API, enabling project management, file operations, and more.92,942 npm90,196MIT
- AlicenseNot gradedqualityDmaintenanceMCP 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.233 npmMIT
- AlicenseNot gradedqualityAmaintenanceMCP server for interacting with GitLab API, supporting dynamic tool selection and enterprise-grade security.10MIT
- AlicenseAqualityCmaintenanceMCP server for GitLab REST API enabling AI agents to manage pipelines, merge requests, diffs, and local reviews.155 npmMIT