MG

mehmetakinn/gitlab-mcp-code-review

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

45 stars 16 forks Качество 69 Тренд 0MIT

mehmetakinn/gitlab-mcp-code-review - кандидат на сервер MCP, импортированный из https://github.com/mehmetakinn/gitlab-mcp-code-review.

Обзор

mehmetakinn/gitlab-mcp-code-review - кандидат на сервер MCP, импортированный из https://github.com/mehmetakinn/gitlab-mcp-code-review.

Обзор (машинный перевод)

Этот проект разветвляется от cayirtepeomer/gerrit-code-review-mcp и адаптирован для интеграции GitLab.

Сервер MCP (Model Context Protocol) для интеграции помощников ИИ, таких как Claude, с запросами GitLab на слияние. Это позволяет ИИ-помощникам просматривать изменения кода непосредственно через API GitLab.

Особенности

** Анализ запросов на полное слияние : Получите полную информацию о запросах на слияние, включая диффы, обязательства и комментарии ** File-Specific Diffs: анализ изменений в конкретных файлах в запросах слияния Сравнение версий: Сравните различные ветви, теги или фиксации Рецензирование: Добавлять комментарии, одобрять или не одобрять запросы на слияние Обзор проекта: Получите списки всех запросов на объединение в проекте

##Установка

Предпосылки

Python 3.10+

  • персональный токен доступа GitLab с областью API (read api, api) Cursor IDE или Claude Desktop App для интеграции MCP

###Быстрый старт

  1. Клонировать это хранилище:

2 Создание и активация виртуальной среды:

  1. Установить зависимости:

  2. Создайте файл .env с конфигурацией GitLab (см. .env.example для всех вариантов):

Конфигурационные опции

Следующие переменные среды могут быть настроены в вашем '.

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

GitLab MCP for Code Review

This project is forked from cayirtepeomer/gerrit-code-review-mcp and adapted for GitLab integration.

An MCP (Model Context Protocol) server for integrating AI assistants like Claude with GitLab’s merge requests. This allows AI assistants to review code changes directly through the GitLab API.

Features

  • Complete Merge Request Analysis: Fetch full details about merge requests including diffs, commits, and comments
  • File-Specific Diffs: Analyze changes to specific files within merge requests
  • Version Comparison: Compare different branches, tags, or commits
  • Review Management: Add comments, approve, or unapprove merge requests
  • Project Overview: Get lists of all merge requests in a project

Installation

Prerequisites

Quick Start

  1. Clone this repository:
git clone https://github.com/mehmetakinn/gitlab-mcp-code-review.git
cd gitlab-mcp-code-review
  1. Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file with your GitLab configuration (see .env.example for all options):
# Required
GITLAB_TOKEN=your_personal_access_token_here

# Optional settings
GITLAB_HOST=gitlab.com
GITLAB_API_VERSION=v4
LOG_LEVEL=INFO

Configuration Options

The following environment variables can be configured in your .env file:

Variable Required Default Description
GITLAB_TOKEN Yes - Your GitLab personal access token
GITLAB_HOST No gitlab.com GitLab instance hostname
GITLAB_API_VERSION No v4 GitLab API version to use
LOG_LEVEL No INFO Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
DEBUG No false Enable debug mode
REQUEST_TIMEOUT No 30 API request timeout in seconds
MAX_RETRIES No 3 Maximum retry attempts for failed requests

Cursor IDE Integration

To use this MCP with Cursor IDE, add this configuration to your ~/.cursor/mcp.json file:

{
  "mcpServers": {
    "gitlab-mcp-code-review": {
      "command": "/path/to/your/gitlab-mcp-code-review/.venv/bin/python",
      "args": [
        "/path/to/your/gitlab-mcp-code-review/server.py",
        "--transport",
        "stdio"
      ],
      "cwd": "/path/to/your/gitlab-mcp-code-review",
      "env": {
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "gitlab-mcp-code-review": { "command": "/path/to/your/gitlab-mcp-code-review/.venv/bin/python", "args": [ "/path/to/your/gitlab-mcp-code-review/server.py", "--transport", "stdio" ], "cwd": "/path/to/your/gitlab-mcp-code-review", "env": { "PYTHONPATH": "/path/to/your/gitlab-mcp-code-review", "VIRTUAL_ENV": "/path/to/your/gitlab-mcp-code-review/.venv", "PATH": "/path/to/your/gitlab-mcp-code-review/.venv/bin:/usr/local/bin:/usr/bin:/bin" }, "stdio": true } } }