Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
dubuqingfeng avatar

Gitlab Mcp Server

  • 9 repo stars
  • Updated September 10, 2025
  • dubuqingfeng/gitlab-mcp-server

GitLab MCP Server is a MCP server that connects AI agents to GitLab APIs via stdio using GITLAB_TOKEN.

About

GitLab MCP Server exposes GitLab to AI coding agents over MCP stdio so you can automate issue updates, project queries, and workflow actions from Claude Code, Cursor, or other MCP clients. You configure a personal access token and optionally point at your own GitLab host; developers who use Feishu/Lark can mirror notifications to a team bot. It is a task integration, not a methodology skill—install it when your repo lives on GitLab and you want fewer context switches than the web UI. Optional note routing helps small teams keep humans in the loop when the agent posts comments or status. Pair it with your normal ship and review habits; the server does not replace code review or security checks on merge requests.

  • Stdio npm package @dubuqingfeng/gitlab-mcp-server (v2.0.12) with required GITLAB_TOKEN and optional GITLAB_URL for self-
  • Optional Lark robot webhooks (LARK_WEBHOOK_URL, LARK_SECRET_KEY) with LARK_ENABLE_NOTIFICATION toggle
  • GITLAB_NOTE_MODE: gitlab_only, lark_only, or both for where agent notes land
  • Model Context Protocol server aimed at AI agents operating on GitLab resources

Gitlab Mcp Server by the numbers

  • Data as of Jul 7, 2026 (Skillselion catalog sync)
terminal
claude mcp add --env GITLAB_TOKEN=YOUR_GITLAB_TOKEN --env GITLAB_URL=YOUR_GITLAB_URL --env LARK_WEBHOOK_URL=YOUR_LARK_WEBHOOK_URL --env LARK_SECRET_KEY=YOUR_LARK_SECRET_KEY --env LARK_ENABLE_NOTIFICATION=YOUR_LARK_ENABLE_NOTIFICATION --env GITLAB_NOTE_MODE=YOUR_GITLAB_NOTE_MODE gitlab-mcp-server -- npx -y @dubuqingfeng/gitlab-mcp-server

Add your badge

Show developers this MCP server is listed on Skillselion. Paste this into your README.

Listed on Skillselion
repo stars9
Package@dubuqingfeng/gitlab-mcp-server
TransportSTDIO
AuthRequired
Last updatedSeptember 10, 2025
Repositorydubuqingfeng/gitlab-mcp-server

What it does

Let your coding agent read and act on GitLab projects, issues, and merge requests from Claude Code or Cursor without leaving the chat.

Who is it for?

Best when you're on GitLab (gitlab.com or self-hosted) and want agent-driven issue and project workflows with optional Lark alerts.

Skip if: Skip if you're on GitHub-only workflows or anyone unwilling to store a GitLab PAT in local MCP config.

What you get

After registration, your agent can call GitLab-backed MCP tools with your token and optional Lark/GitLab note routing for team visibility.

  • Agent-callable GitLab MCP tools over stdio
  • Configurable GitLab base URL for SaaS or self-hosted
  • Optional dual-path notes to GitLab and/or Lark

By the numbers

  • Catalog server version 1.0.1; npm package @dubuqingfeng/gitlab-mcp-server v2.0.12
  • Transport: stdio
  • Required env: GITLAB_TOKEN; optional GITLAB_URL and Lark webhook vars
README.md

Gitlab Mcp server

支持服务:

  1. gitlab
  2. code-review-rules (代码审查规则)

场景

  1. gitlab 代码 review,获取信息
  2. 智能代码审查规则 - 根据项目类型提供代码审查建议

GitLab

GitLab 集成使用 @gitbeaker/rest 库支持获取 Merge Request 信息。

环境变量

export GITLAB_TOKEN="your_personal_access_token"
export GITLAB_URL="https://gitlab.com"  # 可选,默认为 gitlab.com(注意:不需要 /api/v4 后缀)

可用工具

  • get_merge_request: 获取特定 MR 的详细信息
  • list_merge_requests: 列出项目的 MR 列表
  • gitlab_code_review: 对 MR 进行综合代码审查
  • gitlab_branch_code_review: 对指定分支进行全面代码审查
  • gitlab_commit_review: 对指定提交进行代码审查
  • get_file_content: 获取仓库中特定文件的内容
  • list_branches: 列出项目的所有分支
  • write_gitlab_mr_note: 在 MR 中写入审查备注(支持灵活的通知模式)

依赖

  • @gitbeaker/rest: GitLab API 客户端库

详细使用说明请参考 GitLab 文档

Lark 机器人集成

支持通过 Lark(飞书)机器人发送通知,可以在写入 GitLab MR 评论时自动发送 Lark 通知。

环境变量

export LARK_WEBHOOK_URL="https://open.feishu.cn/open-apis/bot/v2/hook/xxx"  # Lark 机器人 Webhook URL
export LARK_SECRET_KEY="your_secret_key"  # 可选:签名密钥(如果机器人启用了签名验证)
export LARK_ENABLE_NOTIFICATION="true"  # 可选:是否启用通知,默认为 true
export GITLAB_NOTE_MODE="gitlab_only"  # 可选:通知模式 - gitlab_only(仅GitLab)、lark_only(仅Lark)、both(两者都发),默认为 gitlab_only

功能特性

  • 灵活的通知模式:可以选择只写 GitLab、只发 Lark 或两者都做
  • 支持富文本卡片消息,包含项目名称、MR 标题、评论内容等信息
  • 支持自定义 Lark 消息(文本或卡片格式)
  • 失败不影响主流程,确保 GitLab 操作的可靠性

通知模式说明

  • gitlab_only: 仅写入 GitLab MR 评论,不发送 Lark 通知(默认)
  • lark_only: 仅发送 Lark 通知,不写入 GitLab MR 评论
  • both: 同时写入 GitLab MR 评论并发送 Lark 通知

使用示例

// 使用环境变量配置的默认模式
await write_gitlab_mr_note({
  projectId: "group/project",
  mergeRequestIid: 123,
  note: "代码审查完成,LGTM!"
});

// 明确指定只写入 GitLab
await write_gitlab_mr_note({
  projectId: "group/project",
  mergeRequestIid: 123,
  note: "内部备注",
  notificationMode: "gitlab_only"
});

// 只发送 Lark 通知,不写入 GitLab
await write_gitlab_mr_note({
  projectId: "group/project",
  mergeRequestIid: 123,
  note: "团队通知:代码已审查",
  notificationMode: "lark_only"
});

// 强制两者都执行(覆盖环境变量)
await write_gitlab_mr_note({
  projectId: "group/project",
  mergeRequestIid: 123,
  note: "重要通知",
  notificationMode: "both"
});

Code Review Rules (代码审查规则)

智能代码审查规则系统,根据不同项目类型和文件扩展名提供相应的代码审查建议。

可用工具

  • get_code_review_rules: 获取适用于特定项目和文件的代码审查规则
  • list_all_code_review_rules: 列出所有可用的代码审查规则
  • get_project_types: 获取支持的项目类型信息

支持的项目类型

  • TypeScript / JavaScript
  • React
  • Node.js
  • Go
  • Python
  • Rust
  • Backend (通用后端规则)
  • Database (数据库相关)

规则类别

  • 🔒 Security (安全)
  • ⚡ Performance (性能)
  • 🔧 Maintainability (可维护性)
  • 🎨 Style (代码风格)
  • ✨ Best Practice (最佳实践)

项目特定规则

支持为特定项目配置专属的代码审查规则:

  • 可以通过外部 JSON 配置文件定义项目特定规则
  • 支持启用/禁用默认规则
  • 支持排除特定的默认规则
  • 可以添加额外的项目类型

详细使用说明请参考:

Recommended MCP Servers

How it compares

MCP GitLab integration, not a standalone Claude skill or full CI replacement.

FAQ

Who is GitLab MCP Server for?

and small-team developers using Claude Code, Cursor, or other MCP clients who keep source code and issues in GitLab.

When should I use GitLab MCP Server?

Use it during Build and Ship when you want the agent to query or update GitLab without manual copy-paste, especially alongside optional Lark notifications.

How do I add GitLab MCP Server to my agent?

Install @dubuqingfeng/gitlab-mcp-server from npm, set GITLAB_TOKEN (and GITLAB_URL if self-hosted), add the stdio server entry in your MCP config, then restart the client.

Developer Toolsgitintegrationsdevops

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.