GitLab MCP Code Review

GitLab MCP Code Review

Enables AI assistants to review GitLab merge requests by fetching changes, analyzing diffs, adding comments, and managing approvals through the GitLab API. Supports complete merge request analysis, file-specific reviews, and version comparisons.

Category
Visit Server

README

GitLab MCP 代码审查工具

Python 3.10+ License: MIT

本项目 fork 自 cayirtepeomer/gerrit-code-review-mcp 并为 GitLab 集成进行了适配。

一个用于将 Claude 等 AI 助手与 GitLab 的合并请求集成的 MCP (Model Context Protocol) 服务器。这使得 AI 助手可以通过 GitLab API 直接审查代码变更。

功能

  • 完整的合并请求分析: 获取合并请求的全部详情,包括差异、提交和评论
  • 文件特定的差异: 分析合并请求中特定文件的变更
  • 版本比较: 比较不同的分支、标签或提交
  • 审查管理: 添加评论、批准或取消批准合并请求
  • 项目概览: 获取项目中的所有合并请求列表

安装

先决条件

Cursor IDE 集成

克隆此仓库:

git clone https://gitea.ffpy.site/ffpy/gitlab-mcp-code-review.git
cd gitlab-mcp-code-review

要将此 MCP 与 Cursor IDE 一起使用,请将以下配置添加到你的 ~/.cursor/mcp.json 文件中:

{
  "mcpServers": {
    "gitlab-mcp-code-review": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/your/gitlab-mcp-code-review",
        "run",
        "server.py"
      ],
      "env": {
        "GITLAB_HOST": "gitlab.com",
        "GITLAB_TOKEN": "xxx"
      }
    }
  }
}
  • /path/to/your/gitlab-mcp-code-review 替换为你克隆仓库的实际路径。
  • GITLAB_HOST 修改为你的Gitlab地址
  • GITLAB_TOKEN 修改为你的AccessToken

可用工具

MCP 服务器提供以下工具用于与 GitLab 交互:

工具 描述
fetch_merge_request 获取有关合并请求的完整信息
compare_versions 比较不同的分支、标签或提交
add_merge_request_comment 向合并请求添加评论
approve_merge_request 批准合并请求
unapprove_merge_request 取消批准合并请求
get_project_merge_requests 获取项目的合并请求列表

故障排除

如果遇到问题:

  1. 验证你的 GitLab 令牌是否具有适当的权限 (api, read_api)
  2. 确保你的 MCP 配置路径正确
  3. 使用以下命令测试连接:curl -H "Private-Token: your-token" https://gitlab.com/api/v4/projects

许可证

本项目根据 MIT 许可证授权 - 有关详细信息,请参阅 LICENSE 文件。

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured