https://github.com/owayo/gitlab-mcp-server
GitLab-MCP-服务器
提供与 GitLab 集成的模型上下文协议 (MCP) 服务器。它从特定的 GitLab 项目中检索管道故障信息和合并请求结果,并将它们提供给 AI 助手。
概述
该MCP服务器使用GitLab的API向AI助手提供以下信息:
GitLab Pipeline 中失败作业的控制台输出
GitLab MR 的未解决问题(评论)
GitLab MR 中的更改(与本地存储库的当前状态不同)
利用MCP功能,AI助手可以直接从GitLab提取信息,以提供更有针对性的帮助。
Related MCP server: mcp-gitlab-jira
安装
# uvのインストール
$ curl -LsSf https://astral.sh/uv/install.sh | sh
$ cd /path/to/this-mcp-server
# ライブラリのインストール
$ uv sync准备
您将需要您的 GitLab 访问令牌。要颁发访问令牌,请转到 GitLab 设置 → 访问令牌。发布时,请检查read_api 。
功能
1. 获取管道故障信息并修复( get_pipeline_failed_jobs )
获取 GitLab 管道中失败作业的控制台输出。 AI助手会根据获取的信息做出修正。
输出:
失败作业的控制台输出,包括作业名称、状态和详细日志
2. 获取并更正 MR 的评论( get_review_comments )
检索并回复 GitLab MR 中的未解决的问题(评论)。已解决的评论和与文件无关的评论将被排除。
输出:
在MR中打开文件相关问题(包括评论者、时间、评论内容、文件位置等)
3. 获取并审查 MR 中的变更( get_review_changes )
获取从 GitLab MR 的基本提交(base_sha)到本地存储库的当前状态的差异。您可以获取与最新本地版本(包括您正在进行的任何未提交的更改)的差异,而不是获取远程差异。将根据所获得的差异进行审查。
输出:
从 MR 的基本提交到当前本地状态的更改(每个文件的更改类型和差异)
与人工智能助手合作
AI助手(例如Claude)可以在该MCP服务器上调用以下函数:
get_pipeline_failed_jobs():获取管道失败信息get_review_comments():获取 MR 的评论get_review_changes():获取 MR 中的更改
这些函数自动检索与当前分支相关的 MR 的信息。
Claude 用于桌面设置
将以下内容添加到claude_desktop_config.json :
{
"mcpServers": {
"gitlab-mcp": {
"command": "uv",
"args": [
"--directory",
"/path/to/this-mcp-server",
"run",
"main.py"
],
"env": {
"GITLAB_URL": "your_gitlab_url",
"GITLAB_PROJECT_NAME": "gitlab_project_name",
"GITLAB_API_KEY": "your_gitlab_api_key",
"GIT_REPO_PATH": "/path/to/git/repo"
}
}
}
}使用光标设置
将以下内容添加到项目根目录中的.cursor/mcp.json中:
{
"mcpServers": {
"gitlab-mcp": {
"command": "env",
"args": [
"GITLAB_URL=your_gitlab_url",
"GITLAB_PROJECT_NAME=gitlab_project_name",
"GITLAB_API_KEY=your_gitlab_api_key",
"GIT_REPO_PATH=/path/to/git/repo",
"uv",
"--directory",
"/path/to/this-mcp-server",
"run",
"main.py"
]
}
}
}注意:在上面的示例配置中,适当替换以下值:
your_gitlab_api_key:您的 GitLab API 访问令牌/path/to/git/repo:本地 Git 存储库的绝对路径/path/to/this-mcp-server:此 MCP 服务器目录的绝对路径
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceA Model Context Protocol server that enables AI assistants to interact with GitLab repositories, allowing tasks like managing merge requests, searching projects, and creating comments through RESTful API integration.242
- AlicenseBqualityCmaintenanceA Model Context Protocol (MCP) server for GitLab and Jira integration. This server allows AI agents like gemini-cli to interact with your GitLab and Jira instances.323211MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables AI assistants to interact with self-hosted GitLab instances through 30 specialized tools. It supports managing projects, merge requests, CI/CD pipelines, and repository operations via the GitLab REST API v4.30MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server for GitLab integration, enabling AI assistants to manage projects, merge requests, pipelines, issues, releases, and more.MIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
A MCP server built for developers enabling Git based project management with project and personal…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/owayo/gitlab-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server