mcp-gitlab
Provides tools for interacting with GitLab repositories, issues, merge requests, and pipelines via the glab CLI.
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-gitlab list open issues in my GitLab 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.
@weirdscience/mcp-gitlab
A Model Context Protocol (MCP) server that provides GitLab integration tools using the glab CLI. This server enables AI assistants to interact with GitLab repositories, issues, merge requests, and pipelines through a standardized MCP interface.
Features
Issue Management: List, create, and manage GitLab issues
Merge Requests: List and create merge requests
Pipeline Monitoring: View project pipelines and their status
Raw API Access: Direct access to GitLab REST API endpoints
Multi-Instance Support: Works with gitlab.com and self-hosted GitLab instances
Pagination Support: Automatic handling of large result sets
Related MCP server: GitLab Code Review MCP Server
Prerequisites
Node.js 18+
glabCLI tool installed and configuredGitLab personal access token
Installation
Global Installation
npm install -g @weirdscience/mcp-gitlabLocal Installation
npm install @weirdscience/mcp-gitlabSetup
1. Install glab CLI
First, install the glab CLI tool:
# macOS
brew install glab
# Linux
sudo apt install glab
# Windows
winget install GitLab.GLab2. Configure glab
Authenticate with your GitLab instance:
# For gitlab.com
glab auth login
# For self-hosted GitLab
glab auth login --hostname gitlab.your-instance.com3. Configure MCP
Add the server to your MCP configuration file (~/.config/mcp.json or similar):
{
"mcpServers": {
"gitlab-glab": {
"command": "mcp-gitlab",
"env": {
"GITLAB_HOST": "gitlab.com",
"GITLAB_TOKEN": "your-gitlab-token"
}
}
}
}Cursor Configuration
To use this MCP server with Cursor, you need to configure it in Cursor's settings:
Method 1: Global Configuration
Open Cursor's Command Palette (
Cmd/Ctrl + Shift + P)Search for "MCP" and select "MCP: Configure Servers"
Add a new server configuration:
{
"name": "gitlab-glab",
"command": "mcp-gitlab",
"env": {
"GITLAB_HOST": "gitlab.com",
"GITLAB_TOKEN": "your-gitlab-token"
}
}Method 2: Workspace Configuration
Create a .cursorrules file in your project root:
{
"mcpServers": {
"gitlab-glab": {
"command": "mcp-gitlab",
"env": {
"GITLAB_HOST": "gitlab.com",
"GITLAB_TOKEN": "your-gitlab-token"
}
}
}
}Method 3: Settings UI
Open Cursor Settings (
Cmd/Ctrl + ,)Search for "MCP"
Add the server configuration in the MCP settings section
Verification
After configuration, you can verify the server is working by:
Opening Cursor's Command Palette
Running "MCP: List Available Tools"
You should see tools like
gitlab_issues_list,gitlab_mrs_list, etc.
Usage in Cursor
Once configured, you can use GitLab tools directly in Cursor:
Ask Cursor to "list open issues in my project"
Request "create a merge request for the current branch"
Ask "show me the latest pipeline status"
Cursor will automatically use the appropriate MCP tools to fulfill these requests.
Environment Variables
Variable | Description | Example |
| GitLab instance hostname |
|
| GitLab personal access token |
|
| Full GitLab instance URI |
|
Available Tools
gitlab_issues_list
List issues for a project.
Parameters:
project(string): Project path or numeric ID (e.g.,'gitlab-org/cli')state(optional): Issue state ('opened','closed','all') - default:'opened'labels(optional): Comma-separated label namesassignee(optional): Assignee username
gitlab_mrs_list
List merge requests for a project.
Parameters:
project(string): Project path or numeric IDstate(optional): MR state ('opened','merged','closed','all') - default:'opened'labels(optional): Comma-separated label namesdraft(optional): Filter for draft MRs (boolean)
gitlab_mr_create
Create a new merge request.
Parameters:
project(string): Project path or numeric IDsourceBranch(string): Source branch nametargetBranch(string): Target branch nametitle(string): MR titledescription(optional): MR description - default:''draft(optional): Create as draft MR (boolean) - default:falselabels(optional): Comma-separated labelsassignees(optional): Comma-separated assignee usernames
gitlab_pipelines_list
List pipelines for a project.
Parameters:
project(string): Project path or numeric IDpage(optional): Page number (default: 1)perPage(optional): Items per page (default: 50, max: 100)status(optional): Pipeline status filter
gitlab_api
Low-level access to GitLab REST API.
Parameters:
method(optional): HTTP method ('GET','POST','PUT','PATCH','DELETE') - default:'GET'path(string): API path below/api/v4fields(optional): Request body fields (object)headers(optional): Custom headers (object)
glab_version
Get the installed glab CLI version.
Usage Examples
List Open Issues
{
"tool": "gitlab_issues_list",
"arguments": {
"project": "gitlab-org/cli",
"state": "opened"
}
}Create Merge Request
{
"tool": "gitlab_mr_create",
"arguments": {
"project": "my-group/my-project",
"sourceBranch": "feature/new-feature",
"targetBranch": "main",
"title": "Add new feature",
"description": "This PR adds a new feature to improve user experience.",
"labels": "enhancement,frontend"
}
}Get Project Pipelines
{
"tool": "gitlab_pipelines_list",
"arguments": {
"project": "my-group/my-project",
"perPage": 10,
"status": "success"
}
}Development
Prerequisites
Node.js 18+
npm or yarn
Setup
git clone https://github.com/weirdscience/mcp-gitlab.git
cd mcp-gitlab
npm installBuild
npm run buildDevelopment Mode
npm run devTesting
npm run checkLinting
npm run lint
npm run lint:fixFormatting
npm run formatContributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Model Context Protocol for the MCP specification
glab CLI for GitLab command-line interface
GitLab for the GitLab platform
Support
If you encounter any issues or have questions:
Check the GitHub Issues
Review the glab CLI documentation
Consult the MCP documentation
Changelog
0.1.0
Initial release
Basic GitLab integration via glab CLI
Support for issues, merge requests, and pipelines
Raw API access capability
Available Tools
6 toolsgitlab_apiRaw GitLab API via glabC
Call GitLab REST endpoints with glab api (method, path, fields, headers)
Inputs: path (required), method, fields, headers.
gitlab_issues_listList GitLab issuesC
List issues for a project using glab issue list
Inputs: project (required), state, labels, assignee.
gitlab_mr_createCreate a merge requestC
Create an MR using GitLab REST API via glab api
Inputs: project (required), sourceBranch (required), targetBranch (required), title (required), +4 more.
gitlab_mrs_listList merge requestsC
List MRs for a project using glab mr list
Inputs: project (required), state, labels, draft.
gitlab_pipelines_listList pipelinesC
List pipelines for a project using GitLab REST via glab api
Inputs: project (required), page, perPage, status.
glab_versionGet glab versionA
Returns 'glab --version' text to verify CLI presence
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: generic API call, list issues, create MR, list MRs, list pipelines, and version check. No ambiguity between them.
Most tools follow a 'gitlab_<resource>_<action>' pattern, but 'gitlab_api' and 'glab_version' deviate in prefix and structure, creating inconsistency.
Six tools is reasonable for a GitLab server covering basic operations, though it could benefit from a few more like issue creation or MR merge.
The toolset covers listing issues, MRs, and pipelines, and creating MRs, but lacks full CRUD for issues and MRs. The generic gitlab_api partially fills gaps, but agents need endpoint knowledge.
Related MCP Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Read and write KukGit repositories, files, issues and pull requests from an AI assistant.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceConnects AI assistants to GitLab projects, enabling users to query merge requests, review discussions, view test results and pipelines, search by branch, and respond to comments through natural language commands.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with GitLab merge requests, review code changes, search projects, and create draft comments for code review workflows.ISC
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact seamlessly with self-hosted GitLab instances, supporting repository operations, issue management, merge requests, CI/CD pipelines, and more.213 PyPI5MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with GitLab projects by listing merge requests, issues, and pipelines via MCP tools.1-