home / mcp / gitlab mcp server
Provides access to GitLab projects, MRs, pipelines, commits, and more via MCP for AI-assisted workflows.
Configuration
View docs{
"mcpServers": {
"nguyenvanduocit-gitlab-mcp": {
"url": "http://localhost:3000/mcp",
"headers": {
"GITLAB_URL": "https://gitlab.com",
"GITLAB_TOKEN": "ghp_exampleTOKEN"
}
}
}
}GitLab MCP is a Go-based connector that lets you interact with GitLab repositories, projects, pipelines, and more through natural language. It enables AI assistants to perform common GitLab tasks directly, reducing context switching and speeding up workflows.
You connect your MCP client to a running GitLab MCP server (either via a local stdio server, a Docker-based deployment, or an HTTP server). Once connected, you can ask Claude to list projects, review merge requests, trigger pipelines, manage variables, search code, and monitor deployments using natural language. Your commands are interpreted by the MCP server and translated into GitLab API calls.
Prerequisites: you need a GitLab account with access to your instance, a personal access token, and an MCP-enabled Cursor client.
Step 1. Obtain a GitLab Personal Access Token - Go to your GitLab instance β User Settings β Access Tokens - Create a token with scopes: api, read_user, read_repository, write_repository - Copy the token (you wonβt see it again) and keep it secure.
Step 2. Choose your installation method - Docker (recommended for easiest setup) - Binary download - Build from source (Go) if you want to customize the server.
{
"mcpServers": {
"gitlab": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "GITLAB_URL=https://gitlab.com",
"-e", "GITLAB_TOKEN=your-personal-access-token",
"ghcr.io/nguyenvanduocit/gitlab-mcp:latest"
]
}
}
}{
"mcpServers": {
"gitlab": {
"command": "/usr/local/bin/gitlab-mcp",
"env": {
"GITLAB_URL": "https://gitlab.com",
"GITLAB_TOKEN": "your-personal-access-token"
}
}
}
}If you run a self-hosted GitLab instance, replace the URL with your own (for example, https://gitlab.yourcompany.com).
Restart Cursor completely, then open a new chat with Claude. Try simple queries to verify data is returned from GitLab, for example listing groups, showing recent merge requests, or checking pipeline status.
You can run the MCP server in HTTP mode for development or centralized access. Start the server on port 3000 and point Cursor to the HTTP URL.
# Start HTTP server on port 3000
gitlab-mcp -env .env -http_port 3000
```
```json
{
"mcpServers": {
"gitlab": {
"url": "http://localhost:3000/mcp"
}
}
}If you encounter authentication or connection errors, verify the GITLAB_URL includes https:// and that your GITLAB_TOKEN has the required scopes. If you see a message about missing MCP servers, restart Cursor and double-check the MCP configuration in Cursor settings.
List projects in a group with details and access levels
Get detailed information about a specific project
List merge requests with filtering options (state, author, target branch)
Retrieve detailed MR information including changes, discussions, and approvals
Create a new merge request with a title and description
Add comments to a merge request to support discussions
List all comments on a merge request
Get pipelines associated with a merge request
Get the commit history for a merge request
Rebase a merge request against the target branch
List pipelines for a project with status and duration
Get detailed information about a pipeline and its jobs
Trigger a new pipeline with optional variables
List CI/CD jobs for a project
Get detailed information about a specific job, including logs and artifacts
Cancel a running job and monitor status
Retry a failed job to re-run it
Create release branches following Git Flow conventions
Finish releases by creating merge requests to develop and master
Create feature branches for development features
Finish features by creating merge requests to develop
Create hotfix branches for urgent fixes
Finish hotfixes by creating merge requests to both branches
List Git Flow branches by type
List members of a group and their roles
Show user activity events and contribution streams
List accessible groups with filtering
List variables at the group level with security information
Create a new group-scoped variable with proper permissions
Update an existing group variable
Remove a group variable
List all deploy tokens (admin) across projects and groups
List deploy tokens at the group level
Get details about a group deploy token
Create a new group deploy token with scopes and expiration
Delete a group deploy token
List deploy tokens for a specific project
Get details about a project deploy token
Create a project deploy token with scopes and expiration
Delete a project deploy token
Search across all GitLab content globally (issues, MRs, commits, code)
Search within a specific group
Search within a specific project
Global search for issues across all groups/projects
Global search for merge requests
Global search for commits
Global search for code
Get file content from a repository with branch/commit support
Search commits by author, path, or date within a project
Get detailed information about a specific commit
Add a comment to a commit for code review
Get merge requests associated with a commit
Cherry-pick a commit to another branch
Revert a commit to undo changes
Get details about a specific group variable
Get details about a project deploy token
Delete a project deploy token