gitlab-mcp-server
Provides tools for managing GitLab repositories, including merge requests, pipelines, branches, and file operations.
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 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 installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/hhldiniz/gitlabmcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server