GitLab MCP Server
Provides comprehensive interaction with GitLab instances, allowing AI agents to manage projects, merge requests, CI/CD pipelines, jobs, and repository resources like branches and commits.
Click on "Install 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 MCP ServerList the open merge requests for the frontend 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 MCP Server
GitLab MCP Server — 透過 Model Context Protocol 讓 AI 助手(Claude Code、Cursor 等)直接操作自架 GitLab。
支援 GitLab 14.x+ REST API v4,使用 Personal Access Token 認證。
安裝與部署
前置需求
Docker
GitLab Personal Access Token(權限範圍:
api,read_user)取得方式:GitLab > User Settings > Access Tokens
Docker 部署
# 1. 建置 image
docker compose build
# 2. 建立 .env 檔案
cp .env.example .env
# 編輯 .env,填入 GITLAB_URL 和 GITLAB_TOKEN
# 3. 啟動服務
docker compose up -d或直接使用 docker run:
docker run -d --name gitlab-mcp \
-p 8001:8000 \
-e GITLAB_URL=https://your-gitlab.example.com \
-e GITLAB_TOKEN=your_token_here \
-e GITLAB_MCP_TRANSPORT=sse \
--restart unless-stopped \
gitlab-mcpMCP 客戶端設定
在 Claude Code 或其他 MCP 客戶端中加入:
{
"mcpServers": {
"gitlab": {
"type": "sse",
"url": "http://localhost:8001/sse"
}
}
}環境變數
變數 | 必填 | 預設值 | 說明 |
| Yes | — | GitLab 位址 |
| Yes | — | Personal Access Token |
| No |
| 傳輸模式( |
| No |
| SSE 監聽位址 |
| No |
| SSE 監聽端口 |
| No |
| 日誌等級 |
| No |
| API 請求逾時(秒) |
功能列表(30 tools)
管理工具
Tool | 說明 |
| 取得伺服器資訊與 GitLab 版本 |
| 檢查連線狀態 |
Projects
Tool | 說明 |
| 列出可存取的專案(支援搜尋) |
| 取得專案詳情 |
| 列出專案成員 |
Merge Requests
Tool | 說明 |
| 列出 MR(可依狀態篩選) |
| 取得 MR 詳情 |
| 建立 MR |
| 更新 MR(標題、描述、指派、狀態) |
| 執行合併 |
| 核准 MR |
| 取得 MR 檔案變更(diff) |
| 取得 MR 包含的 commits |
| 列出 MR 留言 |
| 新增 MR 留言 |
CI/CD Pipelines & Jobs
Tool | 說明 |
| 列出 Pipelines(可依狀態、分支篩選) |
| 取得 Pipeline 詳情 |
| 觸發新 Pipeline |
| 重試 Pipeline |
| 取消 Pipeline |
| 列出 Pipeline 的 Jobs |
| 取得 Job 詳情 |
| 取得 Job 執行日誌 |
| 重試單一 Job |
Repository
Tool | 說明 |
| 列出分支 |
| 取得分支詳情 |
| 列出 Commits |
| 取得 Commit 詳情 |
| 比較兩個分支差異 |
| 瀏覽檔案結構 |
開發
# 安裝依賴(需要 uv)
uv sync
# 本地啟動(stdio 模式)
uv run gitlab-mcp
# 本地啟動(SSE 模式)
uv run gitlab-mcp --transport sse --port 8001License
MIT
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/snowild/gitlab-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server