GitLab MCP Server
Allows listing merge requests, issues, and pipelines from a GitLab project using the GitLab API.
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 merge requests for project 123"
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
A Model Context Protocol (MCP) server that exposes GitLab project data as tools consumable by AI assistants (e.g., GitHub Copilot, Claude Desktop).
Tools
Tool | Description | Parameters |
| List open merge requests in a GitLab project |
|
| List issues in a GitLab project |
|
| List recent pipelines in a GitLab project |
|
The project parameter accepts a GitLab project ID (integer) or URL-encoded namespace/path (e.g., mygroup%2Fmyrepo).
Related MCP server: GitLab MCP Server
Requirements
Python 3.8+
Runtime dependencies are listed in requirements.txt and are automatically installed into an isolated virtual environment when you run start_server.sh (see Usage).
To install them manually:
pip install -r requirements.txtFor running tests:
pip install -r requirements-test.txtConfiguration
The server reads configuration from two environment variables:
Variable | Description | Example |
| Base URL of the GitLab API (v4) |
|
| GitLab Personal Access Token with |
|
Export them before starting the server:
export GITLAB_URL=https://gitlab.spectrumflow.net/api/v4
export GITLAB_TOKEN=your-personal-access-tokenUsage
Start the server
./start_server.shOn first run the script will:
Create a
.venvvirtual environment inside the project directoryInstall the packages from
requirements.txtinto that venvLaunch
mcp_server.pyusing the venv's Python interpreter
Subsequent runs reuse the existing venv and re-run the pip install step (which is a no-op if dependencies are already satisfied), so startup stays fast.
Or run manually (bring your own environment):
python3 mcp_server.pyProtocol
The server implements the Model Context Protocol (MCP) over stdio using JSON-RPC 2.0, which is the standard expected by VS Code Copilot, Claude Desktop, and other MCP clients.
Handshake sequence (performed automatically by MCP clients):
Client →
initializeServer →
initializeresult (protocolVersion, capabilities, serverInfo)Client →
notifications/initialized(notification — no response)Client →
tools/listServer → tools list
Call a tool:
{"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "list_merge_requests", "arguments": {"project": "123"}}}Response:
{"jsonrpc": "2.0", "id": 3, "result": {"content": [{"type": "text", "text": "[{\"id\": 42, \"title\": \"Fix bug\"}]"}]}}Error response (e.g. missing parameter):
{"jsonrpc": "2.0", "id": 3, "error": {"code": -32602, "message": "Missing required argument: 'project'"}}GitLab API failures are returned as results with "isError": true rather than JSON-RPC errors, per the MCP specification.
VS Code / Copilot MCP Configuration
Add to your mcp.json:
{
"servers": {
"gitlab": {
"type": "stdio",
"command": "/path/to/gitlab-mcp-server/start_server.sh",
"env": {
"GITLAB_URL": "https://gitlab.spectrumflow.net/api/v4",
"GITLAB_TOKEN": "your-personal-access-token"
}
}
}
}Testing
The test suite has 58 tests across three layers. No network calls are made — all GitLab HTTP interactions are mocked.
python -m pytestLayer | File | What it tests |
Unit |
| Tool functions ( |
Integration (in-process) |
|
|
Integration (subprocess) |
| Real process spawned via |
Run a specific layer:
python -m pytest tests/unit/
python -m pytest tests/integration/Project Structure
gitlab-mcp-server/
├── mcp_server.py # MCP server implementation
├── start_server.sh # Startup script (bootstraps venv automatically)
├── requirements.txt # Runtime dependencies
├── requirements-test.txt # Test-only dependencies
├── pytest.ini # pytest configuration
├── README.md
├── .venv/ # Auto-created virtual environment (git-ignored)
└── tests/
├── conftest.py # Shared pytest fixtures and env var setup
├── unit/
│ └── test_tools.py # Unit tests for tool functions
└── integration/
├── test_main_loop.py # In-process integration tests for main()
└── test_subprocess.py # Subprocess integration testsThis 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-qualityDmaintenanceEnables AI agents to interact with GitLab repositories, allowing them to manage merge requests and issues including listing projects, fetching MR details and diffs, adding comments, and updating MR titles and descriptions.Last updated6294MIT
- Flicense-quality-maintenanceEnables AI assistants to interact with GitLab projects, allowing users to query merge requests, view code reviews and discussions, check pipeline test results and logs, and respond to comments through natural language commands.Last updated
- Alicense-qualityDmaintenanceEnables AI assistants to interact with GitLab merge requests, review code changes, search projects, and create draft comments for code review workflows.Last updated4MIT
- 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
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
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/kyle-bober/gitlab-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server