gitlab
MCP server from dubuqingfeng/gitlab-mcp-server
claude mcp add --transport stdio dubuqingfeng-gitlab-mcp-server node path/to/server.js \ --env GITLAB_URL="https://gitlab.com" \ --env GITLAB_TOKEN="your_personal_access_token" \ --env LARK_SECRET_KEY="optional_signing_key" \ --env GITLAB_NOTE_MODE="gitlab_only" \ --env LARK_WEBHOOK_URL="https://open.feishu.cn/open-apis/bot/v2/hook/xxx" \ --env LARK_ENABLE_NOTIFICATION="true"
How to use
This MCP server integrates with GitLab to fetch Merge Request information and perform intelligent code review guidance. It uses the @gitbeaker/rest GitLab API client to retrieve MR details, list MRs, and run code review checks. The server also supports a Lark (Feishu) bot integration to notify teams about MR reviews. Available tools include getting MR details, listing MRs, performing code reviews on MRs, branches, or commits, retrieving file content, listing branches, and writing review notes to MR comments with flexible notification modes. By configuring environment variables, you can enable GitLab access and optional Lark notifications. The system is designed to provide actionable review feedback and streamline collaboration between GitLab reviews and team notifications.
How to install
Prerequisites:
- Node.js (v14+ recommended) and npm installed
- Access token for GitLab with appropriate scopes
- If using Lark notifications, an accessible Feishu/Lark webhook and optional signing secret
- Clone the MCP server repository or download the package
- git clone https://example.com/your-repo.git
- cd repo
- Install dependencies
- npm install
- Configure environment variables
- Create a .env file or export variables in your shell. Example: export GITLAB_TOKEN="your_personal_access_token" export GITLAB_URL="https://gitlab.com" # optional, defaults to gitlab.com export LARK_WEBHOOK_URL="https://open.feishu.cn/open-apis/bot/v2/hook/xxx" export LARK_SECRET_KEY="your_secret_key" # optional export LARK_ENABLE_NOTIFICATION="true" # optional, defaults to true export GITLAB_NOTE_MODE="gitlab_only" # optional: gitlab_only | lark_only | both
- Start the MCP server
- node path/to/server.js
- Verify operation
- Check logs for initialization messages and ensure GitLab authentication succeeds. Use the available tools (get_merge_request, list_merge_requests, gitlab_code_review, etc.) to validate responses and review outputs.
Additional notes
Notes:
- Ensure GITLAB_TOKEN has the necessary scopes for MR access and notes writing if you plan to post review comments.
- If GITLAB_URL is not provided, the default is https://gitlab.com; do not include /api/v4 in this URL.
- The Lark integration can be configured to notify only GitLab, only Lark, or both via GITLAB_NOTE_MODE. The default is gitlab_only.
- The write_gitlab_mr_note tool supports flexible notification modes and can surface reviews in both GitLab and Lark depending on configuration.
- Refer to the Code Review Rules and Code Review Documentation for understanding available rules and how they apply to different project types.
Common issues:
- If GitLab API requests fail, verify token scopes and network access.
- If Lark notifications fail, check webhook URL validity and secret key configuration.
- Make sure the environment supports the features you enable (e.g., Lark when using lark_only or both).
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud