gitlab-mcp-server
Provides tools for managing GitLab repositories, including merge requests, pipelines, branches, and file operations.
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., "@gitlab-mcp-serverlist open merge requests in my-project"
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 managing GitLab repositories — merge requests, pipelines, branches, and file operations — over the Model Context Protocol.
Features
Merge Requests — create, list, get, review diffs, and comment
Pipelines — list, get, retry, and cancel
Branches — create, delete, list, and inspect
Files — push (create/update/delete/move) and read file contents
Enterprise support — works with any GitLab instance (set
GITLAB_URL)
Related MCP server: gitlab-ci-mcp
Installation
pip install gitlab-mcp-serverOr install from source:
git clone https://github.com/hhldiniz/gitlabmcp.git
cd gitlabmcp
pip install -e .For tests:
pip install -e ".[test]"Configuration
Set the following environment variables:
Variable | Required | Default | Description |
| Yes | — | GitLab Personal Access Token |
| No |
| GitLab instance URL |
Usage
Run as a standalone MCP server (stdio)
export GITLAB_TOKEN=glpat-your-token
python -m gitlab_mcp_serverConfigure with an MCP client
Add to your MCP client config (e.g. claude_desktop_config.json):
{
"mcpServers": {
"gitlab": {
"command": "python",
"args": ["-m", "gitlab_mcp_server"],
"env": {
"GITLAB_TOKEN": "glpat-your-token",
"GITLAB_URL": "https://gitlab.com"
}
}
}
}Tools
Tool | Description |
| Create a merge request |
| List merge requests (filter by state) |
| Get merge request details |
| Get MR diff/changes for code review |
| Add a note to a merge request |
| List pipelines (filter by ref) |
| Get pipeline details |
| Retry a failed pipeline |
| Cancel a running pipeline |
| Create a new branch from a ref |
| Delete a branch |
| List repository branches |
| Get branch details |
| Create/update/delete/move files in a single commit |
| Read a file from the repository |
Running Tests
python -m pytest tests -vProject Structure
gitlabmcp/
├── pyproject.toml
├── .env.example
├── client.py # Example MCP client
├── src/
│ └── gitlab_mcp_server/
│ ├── __init__.py
│ ├── __main__.py
│ ├── gitlab_client.py # GitLab API wrapper
│ ├── tools.py # MCP tool definitions + dispatch
│ └── server.py # MCP server (stdio transport)
└── tests/
├── conftest.py # Fixtures and mocks
├── test_gitlab_client.py
├── test_tools.py
└── test_server.pyThis 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.
A MCP server built for developers enabling Git based project management with project and personal…
Related MCP Servers
- -licenseAqualityAmaintenanceMCP Server for the GitLab API, enabling project management, file operations, and more.93,492 npm90,399MIT
- AlicenseAqualityBmaintenanceMCP server for GitLab CI/CD — pipelines, jobs, schedules, branches, tags, merge requests and repository files. Works with any GitLab (SaaS gitlab.com or self-hosted) via python-gitlab.2339 PyPI2MIT
- 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.414 npmMIT
- AlicenseNot gradedqualityBmaintenanceMCP server for the GitLab REST API providing tools to manage projects, merge requests, pipelines, CI/CD variables, approvals, issues, and code reviews.933 PyPI6MIT