Provides comprehensive GitLab API integration enabling management of projects, issues, merge requests, repository files, branches, CI/CD pipelines, and discussions. Includes advanced features like batch operations, AI-optimized summaries, and smart diffs.
MCP GitLab Server
A Model Context Protocol (MCP) server that provides comprehensive GitLab API integration. This server enables LLMs to interact with GitLab repositories, manage merge requests, issues, and perform various Git operations.
Features
Core Features
- 🔍 Project Management - List, search, and get details about GitLab projects
- 📝 Issues - List, read, search, and comment on issues
- 🔀 Merge Requests - List, read, update, approve, and merge MRs
- 📁 Repository Files - Browse, read, and commit changes to files
- 🌳 Branches & Tags - List and manage branches and tags
- 🔧 CI/CD Pipelines - View pipeline status and history
- 💬 Discussions - Read and resolve merge request discussions
- 🎯 Smart Operations - Batch operations, AI summaries, and smart diffs
Advanced Features
- Batch Operations - Execute multiple GitLab operations atomically with rollback support
- AI-Optimized Summaries - Generate concise summaries of MRs, issues, and pipelines
- Smart Diffs - Get structured diffs with configurable context and size limits
- Safe Preview - Preview file changes before committing
- Cross-Reference Support - Reference results from previous operations in batch mode
Installation
Using uvx (recommended - no installation needed)
From source
Configuration
Environment Variables
Set one of the following authentication tokens:
Getting a GitLab Token
- Go to your GitLab profile settings
- Navigate to "Access Tokens"
- Create a new token with the following scopes:
api
- Full API accessread_repository
- Read repository contentwrite_repository
- Write repository content (for commits)
Usage
With Claude Desktop
Add to your Claude Desktop configuration:
Using uvx (recommended - no installation needed):
Using uv (if you've cloned the repository):
Replace /path/to/mcp-gitlab
with the full path to where you cloned the repository.
Running with uvx
The easiest way to run the MCP GitLab server is using uvx
:
Standalone Usage
Available Tools
Project Management
gitlab_list_projects
List accessible GitLab projects with pagination and search.
gitlab_get_project
Get detailed information about a specific project.
gitlab_get_current_project
Get the GitLab project information from the current git repository.
Issues
gitlab_list_issues
List project issues with state filtering.
gitlab_get_issue
Get a single issue with full details.
gitlab_add_issue_comment
Add a comment to an issue.
Merge Requests
gitlab_list_merge_requests
List merge requests with filtering options.
gitlab_get_merge_request
Get detailed merge request information.
gitlab_update_merge_request
Update merge request fields.
gitlab_merge_merge_request
Merge a merge request with options.
gitlab_approve_merge_request
Approve a merge request.
Repository Operations
gitlab_get_file_content
Read file content from the repository.
gitlab_create_commit
Create a commit with multiple file changes.
gitlab_compare_refs
Compare two branches, tags, or commits.
Advanced Tools
gitlab_batch_operations
Execute multiple operations atomically with rollback support.
gitlab_summarize_merge_request
Generate an AI-friendly summary of a merge request.
gitlab_smart_diff
Get a structured diff with context and size limits.
Complete Tool List
- Projects:
gitlab_list_projects
,gitlab_get_project
,gitlab_get_current_project
,gitlab_search_projects
- Issues:
gitlab_list_issues
,gitlab_get_issue
,gitlab_add_issue_comment
- Merge Requests:
gitlab_list_merge_requests
,gitlab_get_merge_request
,gitlab_update_merge_request
,gitlab_close_merge_request
,gitlab_merge_merge_request
,gitlab_add_merge_request_comment
,gitlab_get_merge_request_notes
,gitlab_approve_merge_request
,gitlab_get_merge_request_approvals
,gitlab_get_merge_request_discussions
,gitlab_resolve_discussion
,gitlab_get_merge_request_changes
,gitlab_rebase_merge_request
- Repository:
gitlab_get_file_content
,gitlab_list_repository_tree
,gitlab_list_commits
,gitlab_get_commit
,gitlab_get_commit_diff
,gitlab_create_commit
,gitlab_cherry_pick_commit
,gitlab_compare_refs
,gitlab_list_tags
- Branches:
gitlab_list_branches
- Pipelines:
gitlab_list_pipelines
,gitlab_summarize_pipeline
- Search:
gitlab_search_projects
,gitlab_search_in_project
- Users:
gitlab_list_user_events
,gitlab_list_project_members
- Releases:
gitlab_list_releases
- Webhooks:
gitlab_list_project_hooks
- AI Tools:
gitlab_summarize_merge_request
,gitlab_summarize_issue
,gitlab_summarize_pipeline
- Advanced:
gitlab_batch_operations
,gitlab_smart_diff
,gitlab_safe_preview_commit
Examples
Auto-detect and List Issues
Create a Fix with Batch Operations
Development
Running Tests
Code Style
The project uses:
- Black for code formatting
- isort for import sorting
- flake8 for linting
- mypy for type checking
Troubleshooting
Authentication Issues
- Ensure your token has the required scopes (
api
,read_repository
,write_repository
) - Check token expiration date
- Verify GitLab URL if using self-hosted instance
Rate Limiting
GitLab API has rate limits. The server handles rate limit errors gracefully and returns appropriate error messages.
Large Responses
Responses are automatically truncated if they exceed size limits. Use pagination parameters to retrieve data in chunks.
Contributing
- 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 Apache License 2.0 - see the LICENSE file for details.
Acknowledgments
- Built on the Model Context Protocol
- Uses python-gitlab for GitLab API interaction
- Inspired by the need for better LLM-GitLab integration
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables comprehensive GitLab integration allowing LLMs to manage projects, issues, merge requests, repository files, CI/CD pipelines, and perform batch operations. Supports advanced features like AI-optimized summaries, smart diffs, and atomic operations with rollback support.
Related MCP Servers
- AsecurityAlicenseAqualityEnables LLMs to interact with GitHub issues by providing details as tasks, allowing for seamless integration and task management through GitHub's platform.Last updated -171613JavaScriptMIT License
- -securityFlicense-qualityA custom server implementation that allows AI assistants to interact with GitLab repositories, providing capabilities for searching, fetching files, creating/updating content, and managing issues and merge requests.Last updated -JavaScript
- AsecurityFlicenseAqualityEnables comprehensive GitHub operations through natural language including file management, repository administration, issue tracking, and advanced code searching.Last updated -4701TypeScript
- AsecurityAlicenseAquality基于MCP框架构建的GitLab集成服务器,提供多种GitLab RESTful API工具,支持项目搜索、任务管理、合并请求创建与审核等功能,帮助开发团队高效协作。Last updated -882TypeScriptMIT License