mcp-gitlab
Provides tools for interacting with GitLab repositories, issues, merge requests, and pipelines via the glab CLI.
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., "@mcp-gitlablist 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)
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | GET | |
| path | Yes | Path below /api/v4, e.g. 'projects/:id/issues' where :id is numeric or URL-encoded path | |
| fields | No | ||
| headers | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description must carry behavioral disclosure. It lacks details on authentication, rate limits, error handling, or side effects. Only says 'call endpoints'.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Very short, one sentence, front-loaded with purpose. But too terse; every sentence could earn its place by adding more value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a raw API tool with no output schema and no annotations, the description is severely incomplete. Agent needs guidance on constructing paths, allowed methods (though enum helps), and fields/headers usage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 25% (only path described). Description mentions parameter names but adds no meaning for fields or headers objects. Does not compensate for low schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it calls GitLab REST endpoints using glab api with method, path, fields, and headers. It distinguishes from sibling tools which are for specific operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this raw API vs the specific sibling tools. No when-not-to-use or alternatives mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
gitlab_issues_listList GitLab issuesC
List issues for a project using glab issue list
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | Project path or numeric ID, e.g. 'gitlab-org/cli' | |
| state | No | opened | |
| labels | No | Comma-separated label names | |
| assignee | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It only says 'List issues' and references a CLI command, but does not disclose pagination, sorting, rate limits, authentication requirements, or any side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, which is efficient, but it lacks essential details. Conciseness is achieved at the cost of completeness, making it minimally helpful.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With 4 parameters and no output schema, the tool is moderately complex. The description fails to explain return format, pagination, filtering behavior, or typical use cases, leaving significant gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 50%, but the description adds no additional meaning beyond what the input schema already provides. For example, the 'assignee' parameter has no schema description and no description compensation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it lists issues for a project, combining a specific verb and resource. It distinguishes from sibling tools like gitlab_mrs_list and gitlab_pipelines_list by targeting issues, but does not explicitly differentiate within the description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like gitlab_api or gitlab_mrs_list. There is no mention of prerequisites, exclusions, or typical usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
gitlab_mr_createCreate a merge requestC
Create an MR using GitLab REST API via glab api
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| sourceBranch | Yes | ||
| targetBranch | Yes | ||
| title | Yes | ||
| description | No | ||
| draft | No | ||
| labels | No | ||
| assignees | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It only mentions 'via glab api', but does not describe side effects (e.g., triggers pipelines, requires authentication), success/failure behavior, or any constraints. Minimal behavioral disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, which is concise, but it sacrifices completeness. It is front-loaded with the verb 'Create an MR', but lacks essential details. It could be considered under-specified rather than optimally concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has 8 parameters, no output schema, and no annotations. The description fails to explain input parameter semantics, return values, error handling, or usage examples. This is severely incomplete for a creation tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description provides no parameter explanations. Parameters like 'project', 'sourceBranch', 'targetBranch', and 'draft' are not elaborated, leaving ambiguity about their format (e.g., project ID vs path) and usage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action 'Create an MR' and the resource 'merge request', using GitLab REST API. This distinguishes it from sibling tools like gitlab_mrs_list. The title reinforces the purpose. However, it could be more specific about the exact API endpoint.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No usage guidelines are provided. There is no information on when to use this tool versus alternatives, prerequisites (e.g., permissions, project existence), or when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
gitlab_mrs_listList merge requestsC
List MRs for a project using glab mr list
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| state | No | opened | |
| labels | No | ||
| draft | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must fully disclose behavior. It does not mention pagination, rate limits, authentication needs, or output format. The phrase 'using glab mr list' hints at a CLI wrapper but lacks detail.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is very short (one sentence) but is under-specified. It sacrifices information for brevity, making it unhelpful. A concise description should still convey essential details.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Without output schema and with low schema coverage, the description needs to compensate. It does not describe return values, filtering capabilities, or how to interpret results, making it incomplete for a tool with 4 parameters.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description fails to explain the meaning or usage of any parameter. For instance, it does not clarify that 'project' expects a namespace/name format or that 'state' filters by merge request status.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'List MRs for a project', which is a specific verb+resource. It distinguishes from sibling tools like gitlab_issues_list, gitlab_mr_create, and gitlab_pipelines_list by naming the resource type (MRs) and action (list).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. For example, it does not explain that gitlab_issues_list is for issues or that gitlab_mr_create is for creating MRs. The description only states what it does, not when it is appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
gitlab_pipelines_listList pipelinesC
List pipelines for a project using GitLab REST via glab api
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| page | No | ||
| perPage | No | ||
| status | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so description carries full burden. It only mentions it's a list operation but lacks details on pagination, rate limits, authentication, or data shape.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, very concise but lacks structure. No front-loading of critical info.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With 4 parameters, no output schema, and minimal description, the tool is poorly documented for an agent to use effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%. Description does not explain any parameter meaning beyond what's in the schema's property names.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description states verb 'list' and resource 'pipelines' for a project, with context of using GitLab REST via glab. It is clear but does not differentiate from sibling tools like gitlab_issues_list or gitlab_mrs_list.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. No exclusions or prerequisites provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
glab_versionGet glab versionA
Returns 'glab --version' text to verify CLI presence
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must stand alone. It accurately describes the tool's behavior as a read-only version check with no side effects, fulfilling the transparency requirement for this simple operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that is clear and direct, containing no redundant information. Every word serves a purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with no parameters, no output schema, and a simple purpose, the description provides all necessary context: what it returns and why it is used (to verify CLI presence).
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has no parameters, and the input schema is empty with 100% coverage. The description does not need to add parameter details, and the baseline score for zero parameters is 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it returns the 'glab --version' text to verify CLI presence. It uses a specific verb ('Returns') and resource, and it is distinct from sibling tools which deal with API calls, issues, and merge requests.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implicitly indicates usage for verifying glab CLI presence, but it does not explicitly state when to use this tool versus alternatives or when not to use it. Given the simplicity of the tool, the lack of explicit guidance is acceptable but not optimal.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
6 tool updates
v0.1.2- First observed
gitlab_api - First observed
gitlab_issues_list - First observed
gitlab_mr_create - First observed
gitlab_mrs_list - First observed
gitlab_pipelines_list - First observed
glab_version
TDQS
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.
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 Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Task management for people and AI agents, with scoped OAuth access to issues, projects, and docs.
130Access the GitHub API, enabling file operations, repository management, search functionality, and…
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.25MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact seamlessly with self-hosted GitLab instances, supporting repository operations, issue management, merge requests, CI/CD pipelines, and more.5MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with GitLab projects by listing merge requests, issues, and pipelines via MCP tools.1-
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/mikedotJS/mcp-gitlab'
If you have feedback or need assistance with the MCP directory API, please join our Discord server