gitlab-review-mcp
Provides tools for interacting with GitLab projects, merge requests, issues, and code reviews, including searching projects, managing merge requests, viewing diffs, adding comments, and handling suggestions.
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-review-mcp show open merge requests in my-project"
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 Review MCP
A Model Context Protocol (MCP) server for GitLab code review and project management. Provides comprehensive tools for interacting with GitLab projects, merge requests, issues, and code reviews through Claude AI.
Features
GitLab Integration - Complete GitLab API integration using python-gitlab
Code Review Tools - List projects, MRs, view diffs, and add comments
Merge Request Management - Create, update, and review merge requests
Suggestion Support - View and apply code change suggestions
Issue Tracking - Fetch and manage GitLab issues
Line Comments - Add precise code review comments to specific lines
Comment Management - Update existing comments and reply to discussions
Singleton Pattern - Efficient connection reuse across all tools
Type Safety - Full Pydantic validation with structured models
Error Handling - Comprehensive error reporting and graceful failure modes
Logging - Centralized logging configuration with optional console output
Related MCP server: GitLab MR MCP
Installation
Using uvx (Recommended)
uvx gitlab-review-mcpUsing uv
uv add gitlab-review-mcp
uv run gitlab-review-mcpConfiguration
Environment Variables
Required:
GITLAB_URL- GitLab instance URL (default:https://gitlab.com)GITLAB_PRIVATE_TOKEN- Your GitLab personal access token
Optional:
GITLAB_REVIEW_MCP_SHOW_LOGS- Set to"true"to enable detailed logging (default:false)
Getting Your GitLab Token
Go to your GitLab instance (e.g., https://gitlab.com)
Navigate to Settings ā Access Tokens
Create a new token with the following scopes:
api- Full API accessread_api- Read API (if you only need read operations)
Copy the token and add it to your environment configuration
Transport Types
stdio(default) - Standard input/output, client launches server automaticallyhttp(recommended for remote) - Modern HTTP transport (aliases:streamable-http,streamable_http)sse(legacy) - Server-Sent Events transport (deprecated)
š Quick Start (uvx)
Stdio Transport
{
"mcpServers": {
"gitlab-review-mcp": {
"command": "uvx",
"args": ["--no-progress", "gitlab-review-mcp"],
"env": {
"GITLAB_URL": "https://gitlab.com",
"GITLAB_PRIVATE_TOKEN": "your-token-here",
"GITLAB_REVIEW_MCP_SHOW_LOGS": "false"
}
}
}
}HTTP Transport
Start server:
uvx --no-progress gitlab-review-mcp --transport http --port 8000 --host 0.0.0.0Client config:
{
"mcpServers": {
"gitlab-review-mcp": {
"url": "http://localhost:8000/mcp",
"transport": "http"
}
}
}SSE Transport
Start server:
uvx --no-progress gitlab-review-mcp --transport sse --port 8000 --host 0.0.0.0Client config:
{
"mcpServers": {
"gitlab-review-mcp": {
"url": "http://localhost:8000/sse",
"transport": "sse"
}
}
}š§ Alternative Commands
Stdio with uv run --with
{
"mcpServers": {
"gitlab-review-mcp": {
"command": "uv",
"args": ["run", "--with", "gitlab-review-mcp", "gitlab-review-mcp"],
"env": {
"GITLAB_REVIEW_MCP_SHOW_LOGS": "false"
}
}
}
}Stdio with uv run --directory (Local Development)
{
"mcpServers": {
"gitlab-review-mcp": {
"command": "uv",
"args": ["run", "--directory", "/path/to/gitlab-review-mcp", "gitlab-review-mcp"],
"env": {
"GITLAB_REVIEW_MCP_SHOW_LOGS": "true"
}
}
}
}HTTP/SSE Alternative Commands
All transport types can use these alternative commands:
# Using uv run --with
uv run --with gitlab-review-mcp gitlab-review-mcp --transport http --port 8000
# Using uv run --directory (local development)
cd /path/to/gitlab-review-mcp
uv run gitlab-review-mcp --transport http --port 8000Available Tools
Project Management
search_projects
Search for GitLab projects by keyword with pagination support.
Search Capabilities:
Performs substring matching across project name, path, namespace, and description
Note: Does not support regex or exact matching - simple keyword search only
Parameters:
search(required) - Search keyword for substring matchingowned(optional) - Only show owned projects (default:false)membership(optional) - Only show projects you're a member of (default:true)page(optional) - Page number for pagination (default:1)per_page(optional) - Results per page (default:20, max:100)order_by(optional) - Sort by:id,name,created_at,star_count,last_activity_at(default)sort(optional) - Sort order:ascordesc(default)
Returns: Formatted list of projects with ID, name, description, URL, default branch, and pagination info
Merge Request Operations
list_merge_requests
List merge requests for a specific project with pagination support.
Parameters:
project_id(required) - GitLab project IDstate(optional) - Filter by state:opened,closed,merged,allauthor_id(optional) - Filter by author user IDassignee_id(optional) - Filter by assignee user IDlabels(optional) - Filter by label names (comma-separated)page(optional) - Page number for pagination (default:1)per_page(optional) - Results per page (default:20, max:100)
Returns: Formatted list of MRs with IID, title, state, author, branches, URLs, and pagination info
get_merge_request
Fetch detailed merge request information.
Parameters:
project_id(required) - GitLab project IDmr_iid(required) - Merge request IID (e.g., !123)
Returns: MR details including title, description, state, branches, author, and timestamps
get_merge_request_diffs
Get code changes (diffs) for a merge request with pagination support.
Parameters:
project_id(required) - GitLab project IDmr_iid(required) - Merge request IIDpage(optional) - Page number for pagination (default:1)per_page(optional) - Results per page (default:20, max:100)
Returns: Complete diff information including file paths, commit SHAs, code changes, and pagination info
add_merge_request_comment
Add a general comment to a merge request.
Parameters:
project_id(required) - GitLab project IDmr_iid(required) - Merge request IIDcomment(required) - Comment text
Returns: Confirmation with comment ID and details
add_merge_request_line_comment
Add a line-specific comment to merge request code.
Parameters:
project_id(required) - GitLab project IDmr_iid(required) - Merge request IIDfile_path(required) - File path in repositoryline_number(required) - Line number in new versioncomment(required) - Comment textbase_sha(required) - Base commit SHA (from diff)head_sha(required) - Head commit SHA (from diff)start_sha(required) - Start commit SHA (from diff)old_line(optional) - Line number in old version
Returns: Confirmation with discussion ID and comment details
get_merge_request_comments
Get all comments and discussions from a merge request, including suggestions, with pagination support.
Parameters:
project_id(required) - GitLab project IDmr_iid(required) - Merge request IIDpage(optional) - Page number for pagination (default:1)per_page(optional) - Results per page (default:20, max:100)
Returns: All comments with note IDs, discussion IDs, authors, timestamps, embedded suggestions, and pagination info
get_merge_request_commits
Get all commits in a merge request with pagination support.
Parameters:
project_id(required) - GitLab project IDmr_iid(required) - Merge request IIDpage(optional) - Page number for pagination (default:1)per_page(optional) - Results per page (default:20, max:100)
Returns: List of commits with SHA, title, message, author, timestamps, and pagination info
update_merge_request_comment
Update an existing merge request comment.
Parameters:
project_id(required) - GitLab project IDmr_iid(required) - Merge request IIDnote_id(required) - Note ID to updatecomment(required) - Updated comment text
Returns: Confirmation with updated comment details
reply_to_merge_request_comment
Reply to an existing discussion thread.
Parameters:
project_id(required) - GitLab project IDmr_iid(required) - Merge request IIDdiscussion_id(required) - Discussion ID to reply tocomment(required) - Reply comment text
Returns: Confirmation with reply details
update_merge_request
Update merge request title and/or description.
Parameters:
project_id(required) - GitLab project IDmr_iid(required) - Merge request IIDtitle(optional) - New titledescription(optional) - New description
Returns: Updated MR details
Suggestion Management
apply_suggestion
Apply a single code change suggestion.
Parameters:
suggestion_id(required) - Suggestion ID to apply
Returns: Confirmation with commit ID
apply_suggestions
Apply multiple code change suggestions in batch.
Parameters:
suggestion_ids(required) - List of suggestion IDs to apply
Returns: Confirmation with commit ID and applied suggestion IDs
Issue Management
get_issue
Fetch detailed issue information.
Parameters:
project_id(required) - GitLab project IDissue_iid(required) - Issue IID (e.g., #123)
Returns: Issue details including title, description, state, assignees, labels, and timestamps
Testing
The project includes comprehensive tests:
# Run all tests
make test
# Run with coverage
make test-covDevelopment
Setup Development Environment
# Clone the repository
git clone https://github.com/midodimori/gitlab-review-mcp.git
cd gitlab-review-mcp
# Install with development dependencies
make install-dev
# Run tests
make test
# Format and lint code
make format
# Check code style and types
make lint
# Run the server locally
make run
# See all available commands
make helpProject Structure
gitlab-review-mcp/
āāā src/gitlab_review_mcp/
ā āāā __init__.py
ā āāā server.py # MCP server implementation
ā āāā config.py # Configuration settings
ā āāā services/ # Business logic layer
ā ā āāā __init__.py
ā ā āāā gitlab_service.py # GitLab API service
ā āāā tools/ # MCP tool implementations
ā ā āāā __init__.py
ā ā āāā gitlab_tools.py # GitLab tools (14 tools)
ā āāā utils/ # Utility modules
ā āāā __init__.py
ā āāā logging.py # Logging configuration
āāā tests/
ā āāā __init__.py
ā āāā test_server.py # Tool function tests with mocks
ā āāā test_pagination.py # Pagination-specific tests
ā āāā test_mcp_integration.py # MCP integration tests
āāā LICENSE
āāā Makefile
āāā PUBLISHING.md # Publishing guide
āāā pyproject.toml # Project configuration
āāā pytest.ini
āāā README.mdContributing
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 MIT License - see the LICENSE file for details.
Links
Support
For questions, issues, or contributions:
Open an issue on GitHub
Check the comprehensive test suite for usage examples
Available Tools
14 toolsadd_merge_request_commentC
Add a general comment to a merge request.
Args: project_id: GitLab project ID mr_iid: Merge request IID comment: Comment text to add
Returns: Confirmation message with comment details
Inputs: mr_iid (required), comment (required), project_id (required). Returns: result
add_merge_request_line_commentB
Add a line-specific comment to a merge request diff.
Args: project_id: GitLab project ID mr_iid: Merge request IID file_path: Path to the file in the repository line_number: Line number in the new version of the file comment: Comment text to add base_sha: Base commit SHA (from diff) head_sha: Head commit SHA (from diff) start_sha: Start commit SHA (from diff) old_line: Line number in the old version (optional, for modified lines)
Returns: Confirmation message with comment details
Inputs: mr_iid (required), comment (required), base_sha (required), head_sha (required), +5 more. Returns: result
apply_suggestionA
Apply a single suggestion to the merge request.
Args: suggestion_id: Suggestion ID to apply
Returns: Confirmation message with apply details
Inputs: suggestion_id (required). Returns: result
apply_suggestionsB
Apply multiple suggestions in batch to the merge request.
Args: suggestion_ids: List of suggestion IDs to apply
Returns: Confirmation message with batch apply details
Inputs: suggestion_ids (required). Returns: result
get_issueA
Fetch issue details.
Args: project_id: GitLab project ID issue_iid: Issue IID (internal ID shown in GitLab UI as #123)
Returns: Formatted string with issue details
Inputs: issue_iid (required), project_id (required). Returns: result
get_merge_requestA
Fetch merge request details.
Args: project_id: GitLab project ID mr_iid: Merge request IID (internal ID shown in GitLab UI as !123)
Returns: Formatted string with MR details
Inputs: mr_iid (required), project_id (required). Returns: result
get_merge_request_commentsA
Get all comments/discussions from a merge request, including suggestions.
Args: project_id: GitLab project ID mr_iid: Merge request IID page: Page number for pagination (default: 1) per_page: Number of results per page (default: 20, max: 100)
Returns: Formatted string with all comments, including note_id, discussion_id, suggestions, and pagination info
Inputs: mr_iid (required), project_id (required), page, per_page. Returns: result
get_merge_request_commitsA
Get commits in a merge request.
Args: project_id: GitLab project ID mr_iid: Merge request IID page: Page number for pagination (default: 1) per_page: Number of results per page (default: 20, max: 100)
Returns: Formatted string with commit list and pagination info
Inputs: mr_iid (required), project_id (required), page, per_page. Returns: result
get_merge_request_diffsA
Get merge request diffs showing code changes.
Args: project_id: GitLab project ID mr_iid: Merge request IID page: Page number for pagination (default: 1) per_page: Number of results per page (default: 20, max: 100)
Returns: Formatted string with diff information including pagination info
Inputs: mr_iid (required), project_id (required), page, per_page. Returns: result
list_merge_requestsA
List merge requests for a specific project.
Args: project_id: GitLab project ID state: Filter by state ('opened', 'closed', 'merged', 'all') author_id: Filter by author user ID assignee_id: Filter by assignee user ID labels: Comma-separated label names (e.g., "bug,urgent") page: Page number for pagination (default: 1) per_page: Number of results per page (default: 20, max: 100)
Returns: Formatted string with merge request list including pagination info
Inputs: project_id (required), page, state, labels, +3 more. Returns: result
reply_to_merge_request_commentA
Reply to an existing merge request discussion/comment.
Args: project_id: GitLab project ID mr_iid: Merge request IID discussion_id: Discussion ID to reply to comment: Reply comment text
Returns: Confirmation message with reply details
Inputs: mr_iid (required), comment (required), project_id (required), discussion_id (required). Returns: result
search_projectsB
Search for GitLab projects by keyword.
The search performs substring matching across project name, path, namespace, and description. Note: Does not support regex or exact matching - it's a simple keyword search.
Args: search: Search keyword (substring match in name/path/namespace/description) owned: Only return projects owned by the authenticated user membership: Only return projects the user is a member of (default: True) page: Page number for pagination (default: 1) per_page: Number of results per page (default: 20, max: 100) order_by: Sort by field: 'id', 'name', 'created_at', 'star_count', 'last_activity_at' (default) sort: Sort order: 'asc' or 'desc' (default)
Returns: Formatted string with project search results including pagination info
Inputs: search (required), page, sort, owned, +3 more. Returns: result
update_merge_requestC
Update merge request title and/or description.
Args: project_id: GitLab project ID mr_iid: Merge request IID title: New title (optional) description: New description (optional)
Returns: Confirmation message with updated MR details
Inputs: mr_iid (required), project_id (required), title, description. Returns: result
update_merge_request_commentC
Update an existing merge request comment.
Args: project_id: GitLab project ID mr_iid: Merge request IID note_id: Note ID to update comment: Updated comment text
Returns: Confirmation message with updated comment details
Inputs: mr_iid (required), comment (required), note_id (required), project_id (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 14 tools
The tools are mostly distinct: retrieval, listing, commenting, and suggestion application each have clear targets. The only potential confusion is apply_suggestion vs apply_suggestions, but the singular/batch distinction is documented.
All tools follow a snake_case verb_noun pattern with clear prefixes like get_, list_, search_, add_, update_, reply_, and apply_. The consistent structure makes the action and resource predictable.
14 tools is within the ideal range for a focused GitLab MR review server. Each tool addresses a specific aspect of browsing, updating, or commenting on merge requests without bloat.
The surface covers the core MR review workflow: fetching MRs/diffs/commits/comments, posting and updating comments, and applying suggestions. Missing capabilities like deleting comments, resolving threads, or approving MRs are minor gaps rather than fatal omissions.
Maintenance
Related MCP Connectors
Persistent context for Claude. Your AI always knows your projects and next actions across sessions.
Manage Redbooth tasks, task lists, comments, tags and files from Claude and other AI assistants.
One workspace of tools for Claude and ChatGPT: connect 600+ apps, generate media, build tools.
Claude-powered AI tools: research, write, code, analyze, translate, debate, pitch, score, and more.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables interaction with GitLab repositories through natural language, supporting project management, issue tracking, merge requests, file access, and repository operations. Includes a conversational agent interface with structured outputs for comprehensive GitLab workflow automation.-
- AlicenseNot gradedqualityCmaintenanceEnables 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
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to manage GitLab projects by providing tools for issues, milestones, and team reports through a read/write interface. Users can interact with project data using natural language directly within Claude Desktop or Claude Code.-
- 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.26 npmMIT