GitLab MCP Server
Provides tools for interacting with GitLab, including browsing projects, managing issues and merge requests, checking pipeline status, and accessing repository files.
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 show my open merge requests"
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
An MCP (Model Context Protocol) server that allows LLMs to interact with GitLab. Access issues, merge requests, pipelines, and repository files directly from Claude Code or other MCP-compatible clients.
Features
Browse and search projects
View issues and merge requests (including your own and team-labeled)
Read MR diffs and comments
Check pipeline status and job logs
Browse repository files
Related MCP server: gitlab-mcp-server
Setup
1. Install dependencies
make install
# or
uv sync2. Create GitLab Personal Access Token
Go to GitLab → Avatar (top-right) → Edit profile
Left sidebar → Access Tokens
Click Add new token
Configure:
Token name: e.g., "MCP Server"
Expiration date: choose as needed
Scopes:
read_api(required)read_repository(for file content access)
Click Create personal access token
Copy the token (won't be shown again)
Direct URL: https://gitlab.com/-/user_settings/personal_access_tokens
3. Configure environment
cp .env.example .envEdit .env with your values:
GITLAB_URL=https://gitlab.com
GITLAB_TOKEN=your-private-token-here
DEFAULT_ASSIGNEE=meConfiguration
Variable | Description | Default |
| Your GitLab instance URL |
|
| Personal access token | (required) |
| Username for "my_*" tools filters |
|
Usage
Run directly
uv run python main.pyRun in background
make start # Start server
make stop # Stop server
make restart # Restart server
make status # Check if running
make logs # Tail server logsAdd to Claude Code
Create .mcp.json in your project root:
{
"mcpServers": {
"gitlab": {
"command": "uv",
"args": ["run", "python", "main.py"],
"cwd": "/path/to/gitlab-mcp-server"
}
}
}Or use the CLI:
claude mcp add gitlab -- uv run python main.pyVerify with /mcp command inside Claude Code.
Test the server
# Test with MCP Inspector
npx @modelcontextprotocol/inspector uv run python main.py
# Test API connection
uv run python -c "
from tools.projects import get_client
with get_client() as client:
r = client.get('/user')
print('Authenticated as:', r.json().get('username'))
"Available Tools
Projects
Tool | Description |
| List accessible projects (search, filter by ownership/membership) |
| Get project details by path |
Issues
Tool | Description |
| List issues in a project (filter by state, labels, search) |
| List issues assigned to you (uses |
| List issues with a team label (default: "RE") |
| Get issue details including description |
| Get comments/notes on an issue |
Merge Requests
Tool | Description |
| List MRs in a project (filter by state, branches, search) |
| List MRs assigned to you |
| List MRs where you are a reviewer |
| List MRs with a team label (default: "RE") |
| Get MR details including description |
| Get MR file diffs |
| Get MR comments/discussions |
Pipelines
Tool | Description |
| List pipelines in a project (filter by status, branch) |
| Get jobs for a pipeline |
| Get job log output |
Repository
Tool | Description |
| List files/directories in a repo |
| Get file content from a repo |
Project Structure
gitlab-mcp-server/
├── main.py # Entry point
├── client.py # HTTP client & settings
├── models.py # Pydantic models
├── tools/
│ ├── projects.py # Project tools
│ ├── issues.py # Issue tools
│ ├── merge_requests.py # MR tools
│ ├── pipelines.py # Pipeline tools
│ └── repository.py # Repository tools
├── .env.example # Environment template
└── Makefile # Run commandsLicense
MIT
Available Tools
19 toolsget_file_contentA
Get the content of a file from the repository.
Args: project_path: Full path of the project (e.g., 'group/project') file_path: Path to the file within the repository ref: Branch name, tag, or commit SHA (defaults to 'main')
Inputs: file_path (required), project_path (required), ref. Returns: ref, size, content, file_name, +1 more
get_issueA
Get details of a specific issue.
Args: project_path: Full path of the project (e.g., 'group/project') issue_iid: The internal ID of the issue within the project
Inputs: issue_iid (required), project_path (required). Returns: iid, state, title, author, +9 more
get_issue_commentsA
Get comments/notes on a specific issue.
Args: project_path: Full path of the project (e.g., 'group/project') issue_iid: The internal ID of the issue within the project per_page: Number of results per page (max 100)
Inputs: issue_iid (required), project_path (required), per_page. Returns: result
get_job_logA
Get the log/trace output of a specific job.
Args: project_path: Full path of the project (e.g., 'group/project') job_id: The ID of the job
Inputs: job_id (required), project_path (required). Returns: result
get_merge_requestA
Get details of a specific merge request.
Args: project_path: Full path of the project (e.g., 'group/project') mr_iid: The internal ID of the merge request within the project
Inputs: mr_iid (required), project_path (required). Returns: iid, draft, state, title, +15 more
get_merge_request_changesA
Get the file changes (diff) of a merge request.
Args: project_path: Full path of the project (e.g., 'group/project') mr_iid: The internal ID of the merge request within the project
Inputs: mr_iid (required), project_path (required). Returns: iid, title, changes, changes_count
get_merge_request_commentsA
Get comments/notes on a specific merge request.
Args: project_path: Full path of the project (e.g., 'group/project') mr_iid: The internal ID of the merge request within the project per_page: Number of results per page (max 100)
Inputs: mr_iid (required), project_path (required), per_page. Returns: result
get_pipeline_jobsB
Get jobs for a specific pipeline.
Args: project_path: Full path of the project (e.g., 'group/project') pipeline_id: The ID of the pipeline per_page: Number of results per page (max 100)
Inputs: pipeline_id (required), project_path (required), per_page. Returns: result
get_projectA
Get details of a specific GitLab project.
Args: project_path: Full path of the project (e.g., 'group/project' or 'user/project')
Inputs: project_path (required). Returns: id, name, topics, web_url, +6 more
list_issuesB
List issues in a GitLab project.
Args: project_path: Full path of the project (e.g., 'group/project') state: Filter by state: 'opened', 'closed', or 'all' labels: Comma-separated list of label names to filter by search: Search term to filter issues per_page: Number of results per page (max 100)
Inputs: project_path (required), state, labels, search, +1 more. Returns: result
list_merge_requestsA
List merge requests in a GitLab project.
Args: project_path: Full path of the project (e.g., 'group/project') state: Filter by state: 'opened', 'closed', 'merged', or 'all' target_branch: Filter by target branch name source_branch: Filter by source branch name search: Search term to filter merge requests per_page: Number of results per page (max 100)
Inputs: project_path (required), state, search, per_page, +2 more. Returns: result
list_pipelinesA
List pipelines in a GitLab project.
Args: project_path: Full path of the project (e.g., 'group/project') status: Filter by status: 'running', 'pending', 'success', 'failed', 'canceled', 'skipped' ref: Filter by branch or tag name per_page: Number of results per page (max 100)
Inputs: project_path (required), ref, status, per_page. Returns: result
list_projectsA
List GitLab projects accessible to the authenticated user.
Args: search: Search term to filter projects by name owned: If true, only return projects owned by the user membership: If true, only return projects the user is a member of per_page: Number of results per page (max 100)
Inputs: owned, search, per_page, membership. Returns: result
list_repository_treeA
List files and directories in a repository.
Args: project_path: Full path of the project (e.g., 'group/project') path: Path inside the repository to list (empty for root) ref: Branch name, tag, or commit SHA (defaults to 'main') recursive: If true, list files recursively per_page: Number of results per page (max 100)
Inputs: project_path (required), ref, path, per_page, +1 more. Returns: result
my_issuesA
List issues assigned to the current authenticated user across all projects or a specific project.
Args: state: Filter by state: 'opened', 'closed', or 'all' project_path: Optional - filter to a specific project (e.g., 'group/project') per_page: Number of results per page (max 100)
Inputs: state, per_page, project_path. Returns: result
my_merge_requestsA
List merge requests assigned to the current authenticated user across all projects or a specific project.
Args: state: Filter by state: 'opened', 'closed', 'merged', or 'all' project_path: Optional - filter to a specific project (e.g., 'group/project') per_page: Number of results per page (max 100)
Inputs: state, per_page, project_path. Returns: result
my_merge_requests_to_reviewA
List merge requests where the current user is a reviewer across all projects or a specific project.
Args: state: Filter by state: 'opened', 'closed', 'merged', or 'all' project_path: Optional - filter to a specific project (e.g., 'group/project') per_page: Number of results per page (max 100)
Inputs: state, per_page, project_path. Returns: result
team_issuesA
List issues with a specific team label across all projects or a specific project.
Args: label: Team label to filter by (defaults to 'RE') state: Filter by state: 'opened', 'closed', or 'all' project_path: Optional - filter to a specific project (e.g., 'group/project') per_page: Number of results per page (max 100)
Inputs: label, state, per_page, project_path. Returns: result
team_merge_requestsA
List merge requests with a specific team label across all projects or a specific project.
Args: label: Team label to filter by (defaults to 'RE') state: Filter by state: 'opened', 'closed', 'merged', or 'all' project_path: Optional - filter to a specific project (e.g., 'group/project') per_page: Number of results per page (max 100)
Inputs: label, state, per_page, project_path. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
Each tool has a clearly distinct purpose. Retrieval tools for files, issues, merge requests, pipelines, and projects are separate, and specialized filters (my_*, team_*) are well-differentiated with explicit descriptions.
Tool names follow a consistent verb_noun pattern (e.g., get_*, list_*, my_*). The use of 'get' for single items and 'list' for multiple is conventional and predictable.
19 tools is on the higher side but still reasonable for a GitLab MCP server covering file, issue, merge request, pipeline, and project operations. The count reflects the breadth of GitLab's features without being excessive.
The tool set is entirely read-only, lacking any create, update, or delete operations for issues, merge requests, projects, or pipelines. This is a significant gap that prevents agents from performing common management tasks.
Maintenance
Related MCP Connectors
Find, vet, and run MCP tools through a secure audited gateway with prompt-injection risk scoring
Read and write KukGit repositories, files, issues and pull requests from an AI assistant.
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with GitLab for managing projects, branches, issues, and merge requests. It provides tools for searching code and performing file operations like reading and writing directly within repositories.7 npmMIT
- AlicenseAqualityDmaintenanceEnables 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.103MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with GitLab projects by listing merge requests, issues, and pipelines via MCP tools.1-
- AlicenseCqualityDmaintenanceEnables AI agents to interact with GitLab repositories, issues, merge requests, pipelines, wikis, milestones, and more through the GitLab API.11515 npm1MIT