Integrate with GitLab for Code Management
MCP server that connects AI assistants to GitLab's API for project management, file operations, merge requests, issues, and repository actions.
Why it matters
Streamline your development lifecycle by integrating directly with GitLab. Manage projects, code, and merge requests programmatically to automate common tasks.
Outcomes
What it gets done
Create and update files within GitLab projects.
Automate the creation of merge requests and branches.
Search for repositories and create new projects.
Manage issues, including assignment and labeling.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-gitlab | bash Capabilities
Tools your agent gets
Create or update a single file in a project.
Push multiple files in a single commit.
Search for GitLab projects.
Create a new GitLab project.
Get contents of a file or directory.
Create a new issue with title, description, assignees, and labels.
Create a new merge request between branches.
Fork a project to your namespace.
Create a new branch from a source ref.
Overview
GitLab MCP
What it does
GitLab MCP server for repository and project management
How it connects
When you want to perform GitLab operations through AI assistant commands
Source README
The GitLab MCP server provides comprehensive integration with GitLab's API, enabling project management, file operations, merge requests, and more.
Installation
npm install -g @modelcontextprotocol/server-gitlab
Configuration
Add to your Claude Code settings:
{
"mcpServers": {
"gitlab": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-gitlab"],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "your_token_here",
"GITLAB_API_URL": "https://gitlab.com/api/v4"
}
}
}
}
Self-Hosted GitLab
For self-hosted instances, change GITLAB_API_URL to your instance's API endpoint.
Available Tools
create_or_update_file
Create or update a single file in a project.
push_files
Push multiple files in a single commit.
search_repositories
Search for GitLab projects.
create_repository
Create a new GitLab project.
get_file_contents
Get contents of a file or directory.
create_issue
Create a new issue with title, description, assignees, and labels.
create_merge_request
Create a new merge request between branches.
fork_repository
Fork a project to your namespace.
create_branch
Create a new branch from a source ref.
Features
- Automatic Branch Creation: Branches are created automatically if they don't exist
- Comprehensive Error Handling: Clear error messages for common issues
- Git History Preservation: Operations maintain proper Git history
- Batch Operations: Support for both single-file and multi-file operations
Authentication
Create a GitLab Personal Access Token with the following scopes:
api- Full API accessread_api- Read-only accessread_repositoryandwrite_repository- Repository operations
Usage Example
Claude, create a new merge request in my-project from
feature-branch to main with a description of the changes.
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.