
一个模型上下文协议(MCP)服务器,使你能够与你的GitLab账户交互。获取差异、分析合并请求、审查代码、挑选修改等。
概览
一个模型上下文协议(MCP)服务器,允许您与 GitLab 账户交互。获取差异、分析合并请求、审查代码、挑选更改等功能。这是模型上下文协议项目中 MCP GitLab 服务器的扩展版本。 该MCP服务器提供与GitLab仓库交互的全面工具,包括: - 列出项目并检索详细信息 - 管理分支和仓库 - 处理合并请求和差异 - 为合并请求添加注释和内部备注 - 更新合并请求属性 - 列出并处理问题 - 获取和比较仓库文件内容 - 管理项目集成与服务 - 配置和控制 Slack 集成 - 设置、更新和测试 webhook - 使用管道触发令牌 - 管理CI/CD变量 - 触发和控制管道 - 列出和管理用户 - 与组及组成员合作 - 管理项目......
概述(AI 翻译)
一个模型上下文协议(MCP)服务器,允许您与 GitLab 账户交互。获取差异、分析合并请求、审查代码、挑选更改等功能。这是模型上下文协议项目中 MCP GitLab 服务器的扩展版本。
特色
该MCP服务器提供与GitLab仓库交互的全面工具,包括:
核心仓库功能
- 列出项目并获取详细信息
- 管理分支和仓库
- 处理合并请求和差异处理
- 为合并请求添加评论和内部注释
- 更新合并请求属性
- 列出并处理问题
- 获取和比较仓库文件内容
项目设置与集成
- 管理项目集成与服务
- 配置和控制 Slack 集成
- 设置、更新和测试webhook
CI/CD管理
- 处理流水线触发令牌
- 管理CI/CD变量
- 触发和控制管道
用户与组管理
- 列出和管理用户
- 与团体及团体成员合作
- 管理项目成员和访问层级
安装
先决条件
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
GitLab MCP Server
A Model Context Protocol (MCP) server that enables you to interact with your GitLab account. Get diffs, analyze merge requests, review code, cherry-pick changes, and more. This is an extended version of the MCP GitLab Server from the Model Context Protocol project.
Features
This MCP server provides comprehensive tools for interacting with GitLab repositories, including:
Core Repository Features
- Listing projects and retrieving details
- Managing branches and repositories
- Working with merge requests and diffs
- Adding comments and internal notes to merge requests
- Updating merge request attributes
- Listing and working with issues
- Getting and comparing repository file contents
Project Settings & Integrations
- Managing project integrations and services
- Configuring and controlling Slack integration
- Setting up, updating, and testing webhooks
CI/CD Management
- Working with pipeline trigger tokens
- Managing CI/CD variables
- Triggering and controlling pipelines
User & Group Administration
- Listing and managing users
- Working with groups and group memberships
- Managing project members and access levels
Installation
Prerequisites
- Node.js (v16 or higher)
- npm
- A GitLab account with an API token
Setup
- Clone the repository:
git clone https://github.com/rifqi96/mcp-gitlab.git
cd mcp-gitlab
- Install dependencies:
npm install
- Build the server:
npm run build
- Install git hooks (optional, but recommended for contributors):
npm run install-hooks
This installs a pre-commit hook that automatically regenerates TOOLS.md when src/utils/tools-data.ts changes.
- Configure your GitLab API token:
You need to provide your GitLab API token in the MCP settings configuration file. The token is used to authenticate with the GitLab API.
For Cursor/Roo Cline, add the following to your MCP settings file (~/Library/Application Support/Cursor/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json):
{
"mcpServers": {
"gitlab": {
"command": "node",
"args": [
"/path/to/mcp-gitlab/build/index.js"
],
"env": {
"GITLAB_API_TOKEN": "YOUR_GITLAB_API_TOKEN",
"GITLAB_API_URL": "https://gitlab.com/api/v4"
}
}
}
}
For Claude Desktop, add the following to your MCP settings file (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"gitlab": {
"command": "node",
"args": [
"/path/to/mcp-gitlab/build/index.js"
],
"env": {
"GITLAB_API_TOKEN": "YOUR_GITLAB_API_TOKEN",
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"gitlab": {
"command": "node",
"args": [
"/path/to/mcp-gitlab/build/index.js"
],
"env": {
"GITLAB_API_TOKEN": "YOUR_GITLAB_API_TOKEN",
"GITLAB_API_URL": "https://gitlab.com/api/v4"
}
}
}
}