GitLab MCP Server
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 Server Create merge request in my-project from feature to main"
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
This documentation is available in简体中文.
A GitLab API server built on the Model Context Protocol (MCP). This server provides a set of tools that allow AI models to interact with GitLab instances, with a focus on branch management and merge request (MR) operations.
Project Info
Package: @jesbrian/gitlab-mcp-server
Version: 0.2.4
Type: CommonJS
Main Entry: index.js
Executable: gitlab-mcp-server
Config Module: config/Config.js
Related MCP server: GitLab MR MCP
Project Structure
gitlab-mcp-server/
├── index.js # Main entry file
├── config/ # Config directory
│ └── Config.js # Centralized config file
├── lib/ # Library directory
│ └── GitLabClient.js # GitLab API client
├── package.json
└── README.mdModular Design
GitLabClient.js: Client class encapsulating GitLab API calls (root directory)
config/Config.js: Centralized management for all configuration items (GitLab connection, client options, MCP Server config, Tools definitions)
index.js: MCP Server main logic, handles tool invocations and request processing
Features
User Management: Get current GitLab user information.
Project Management: Search projects, get project ID mappings, and retrieve project details.
Branch Management:
List repository branches.
Create new branches (supports specifying source branch/tag).
Delete branches.
Merge Request (MR) Management:
Create MRs (supports standard creation and quick creation for public repositories).
Get MR status (including merge status, conflict detection).
Execute merge operations.
Close MRs.
Poll and wait for MR to become mergeable (supports timeout settings).
Configuration
All configuration items are centralized in lib/config/Config.js, customizable via environment variables:
Configure the following environment variables:
Variable | Description | Required | Default |
| GitLab instance URL (e.g., | Yes | - |
| GitLab personal access token (Private Token) | Yes | - |
| Request timeout in milliseconds | No | 10000 |
| Polling interval in milliseconds | No | 2000 |
Usage
As an MCP Server
Add to Claude Desktop configuration file:
Option 1: Using npx (Recommended)
{
"mcpServers": {
"gitlab": {
"command": "npx",
"args": ["@jesbrian/gitlab-mcp-server"],
"env": {
"GITLAB_URL": "https://your-gitlab-url.com",
"GITLAB_PRIVATE_TOKEN": "your-private-token"
}
}
}
}Option 2: Local Path
Start the project locally first, then configure Claude Code:
# After cloning the project, enter the directory and install dependencies
cd gitlab-mcp-server
npm install
# Start the service locally (choose one method)
npm start # Option 1: Use npm scripts
node index.js # Option 2: Run directly
gitlab-mcp-server # Option 3: Install globally and use commandAdd to Claude Code MCP configuration:
{
"mcpServers": {
"gitlab": {
"command": "node",
"args": ["/path/to/gitlab-mcp-server/index.js"],
"env": {
"GITLAB_URL": "https://your-gitlab-url.com",
"GITLAB_PRIVATE_TOKEN": "your-private-token"
}
}
}
}Available Tools
User & Project Management
get_current_user: Get current GitLab user information.get_project_ids: Search projects by name and get project ID mappings (returns IDs across different namespaces).get_project: Get detailed information for a specified project.
Branch Operations
get_repository_branches: List branches of a project.create_branch: Create a new branch (can specify source branch/tag, defaults to master).delete_branch: Delete a branch.
Merge Request (MR)
create_merge_request: Create a merge request (supports custom title and description).create_merge_request_to_public: Quick tool that auto-detects personal and public repositories, creates MR from personal branch to public repository.merge_branch: Execute merge operation.get_merge_request_status: Get current MR status (including merge status, conflicts, etc.).close_merge_request: Close a merge request.wait_for_mergeable_status: Poll and wait for MR to become mergeable (supports timeout, default 5 minutes).
Available Tools
1 toolget_merge_request_statusC
获取合并请求状态
Inputs: mergeRequestIid (required), targetProjectId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap.
A single tool trivially maintains naming consistency; there are no inconsistencies to assess.
One tool for a GitLab server is extremely thin; GitLab's broad feature set requires many more tools for meaningful coverage.
The server only exposes a merge request status check, missing all other essential GitLab operations such as issue, repository, and pipeline management.
Maintenance
Related MCP Connectors
Git-backed platform for skills, tools, and context for AI agents
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
Read and write KukGit repositories, files, issues and pull requests from an AI assistant.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides GitLab integration for AI assistants using Model Context Protocol, enabling repository operations, file management, issue tracking, merge requests, and branch/tag administration through natural language.2-
- AlicenseNot gradedqualityBmaintenanceEnables 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.94MIT
- AlicenseNot gradedqualityCmaintenanceIntegrates GitLab with AI assistants to manage merge requests, analyze CI/CD pipelines, and create Architecture Decision Records. It enables seamless code searching, pipeline triggering, and deployment management through the Model Context Protocol.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI-assisted code review and repository management for on-premise GitLab instances. It provides tools for interacting with merge requests, browsing source code, and searching repositories via the Model Context Protocol.1MIT