@godrix/mcp-gitlab-utils
MCP server for GitLab REST API enabling AI agents to manage pipelines, merge requests, diffs, and local reviews.
README
@godrix/mcp-gitlab-utils
Node.js MCP server for the GitLab REST API — built for AI agents (pipelines, merge requests, diffs, local review, and context discovery).
Version 0.3.1 — gitlab_-prefixed tools, full MR lifecycle, read-only mode, server instructions, prompts, and resources.
Prerequisites
- Node.js 18+
- GitLab PAT with
apiandread_repository(write scope for merge/comment/approve) - Git on PATH (for
repo_path, worktrees, and local review)
Quick install (npx)
No clone or local build — the published npm package includes compiled JavaScript.
Cursor / Claude Desktop (mcp.json)
{
"mcpServers": {
"gitlab-utils": {
"command": "npx",
"args": ["-y", "@godrix/mcp-gitlab-utils"],
"env": {
"GITLAB_TOKEN": "glpat-...",
"GITLAB_BASE_URL": "https://gitlab.example.com",
"GITLAB_READ_ONLY": "false"
}
}
}
}
Restart your MCP client after saving. Optional variables: GITLAB_PROJECT_ID, WORKTREE_DIR.
Global install (alternative)
npm install -g @godrix/mcp-gitlab-utils
Then use "command": "mcp-gitlab-utils" in mcp.json (no npx).
Environment variables
| Variable | Required | Description |
|---|---|---|
GITLAB_TOKEN |
Yes | Sent as PRIVATE-TOKEN header |
GITLAB_BASE_URL |
Yes | e.g. https://gitlab.example.com |
GITLAB_PROJECT_ID |
No | Fallback group/repo or numeric ID |
WORKTREE_DIR |
No | Default: /tmp/referencia_ao_mcp_worktree |
GITLAB_READ_ONLY |
No | Default: false. When true, blocks writes (merge, comment, approve, pipeline control, prepare_review) |
Project resolution: pass project_id on a tool, or repo_path (local clone) to infer group/repo from origin, or set GITLAB_PROJECT_ID.
MR without IID: with repo_path, the current branch resolves the open MR (source_branch); errors if zero or multiple MRs match. Use gitlab_resolve_context to discover the IID.
Tools
Discovery
| Tool | Description |
|---|---|
gitlab_resolve_context |
Resolve project_path, branch, and MR from repo_path |
gitlab_search_projects |
Search projects accessible by the token |
Merge requests
| Tool | Description |
|---|---|
gitlab_get_merge_request |
MR metadata (state, reviewers, pipeline) |
gitlab_get_mr_merge_status |
Mergeability: conflicts, draft, pipeline, approvals, blockers |
gitlab_get_mr_context |
Diff/changes + optional CI traces and discussions |
gitlab_get_mr_discussions |
Review threads and comments |
gitlab_add_mr_inline_comment |
Inline comment on a diff line |
gitlab_manage_merge_requests |
list, get, create, update, approve, unapprove, comment, merge, close, reopen, mark_draft, mark_ready |
CI/CD
| Tool | Description |
|---|---|
gitlab_list_pipelines |
List pipelines (by ref, MR, or status) |
gitlab_get_pipeline |
Pipeline + jobs |
gitlab_get_job_trace |
Job log |
gitlab_control_pipeline |
list_jobs, play, retry_job, retry_pipeline, cancel_pipeline |
Repository
| Tool | Description |
|---|---|
gitlab_get_file |
Read remote file at a ref (e.g. .gitlab-ci.yml) |
gitlab_compare |
Diff between two refs |
Local review
| Tool | Description |
|---|---|
gitlab_prepare_review |
git worktree + npm ci / composer install |
Prompts (workflows)
| Prompt | Use |
|---|---|
review_merge_request |
Full MR review with checklist |
merge_merge_request |
Validate mergeability and merge |
fix_failed_ci |
Diagnose and fix failed pipeline |
create_mr_from_branch |
Create MR from current branch |
triage_open_mrs |
Prioritize open MRs |
Resources
| URI | Content |
|---|---|
gitlab://guide |
Markdown agent guide (tools and flows) |
gitlab://project/{project_ref} |
Project metadata JSON |
Read-only mode
With GITLAB_READ_ONLY=true:
- Allowed: reads (MR, diff, pipeline, merge status, list/get)
- Blocked: merge, comment, inline comment, approve, create/update MR, pipeline control, prepare_review
Useful for analysis/review agents without mutating GitLab.
Migration 0.2 → 0.3
New tools and actions (no breaking changes to existing names):
| Addition | Description |
|---|---|
gitlab_get_mr_merge_status |
Mergeability state and blockers |
gitlab_add_mr_inline_comment |
Inline diff comment |
gitlab_manage_merge_requests |
New actions: merge, close, reopen, mark_draft, mark_ready |
Migration 0.1 → 0.2
Legacy names were renamed with the gitlab_ prefix:
| 0.1.0 | 0.2.0 |
|---|---|
control_pipeline |
gitlab_control_pipeline |
get_mr_context |
gitlab_get_mr_context |
manage_mrs |
gitlab_manage_merge_requests |
prepare_review |
gitlab_prepare_review |
gitlab_control_pipeline: retry → retry_job; new actions retry_pipeline and cancel_pipeline.
MCPB install (Claude Desktop / local bundle)
Alternative to npx for clients that support .mcpb files:
- Clone the repo:
git clone ... && npm install && npm run build npm run pack:mcpb— produces.mcpbwithmanifest.json,dist/, andnode_modules- For a smaller bundle:
npm run pack:mcpb:slim - Install the
.mcpbin your client and fill in token + URL
Local development
To contribute or test changes before publishing to npm:
git clone https://github.com/godrix/mcp-gitlab-utils.git
cd mcp-gitlab-utils
npm install
cp .env.example .env # set GITLAB_TOKEN and GITLAB_BASE_URL
npm run dev # tsx, stdio
# or
npm run build && npm start
Cursor config pointing at the clone (instead of npx):
{
"mcpServers": {
"gitlab-utils": {
"command": "node",
"args": ["/absolute/path/mcp-gitlab-utils/dist/main.js"],
"env": {
"GITLAB_TOKEN": "glpat-...",
"GITLAB_BASE_URL": "https://gitlab.example.com",
"GITLAB_READ_ONLY": "false"
}
}
}
}
Extra requirements for local review: npm and/or composer depending on the target repo.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。