gd-gitlab-mcp
v1.0.1
Published
GitLab MCP server — HTTP and stdio transport
Downloads
44
Readme
GitLab MCP Server
MCP server for GitLab — supports both HTTP and stdio transport.
Features
- Search projects
- List & inspect merge requests + diffs
- Review, comment, approve / reject MR
- Open & merge MR
- Trigger & monitor pipelines
Quickstart (stdio — recommended for local use)
{
"mcpServers": {
"gitlab-mcp": {
"command": "npx",
"args": ["-y", "gd-gitlab-mcp", "--stdio"],
"env": {
"GITLAB_BASE_URL": "https://gitlab.example.com",
"GITLAB_TOKEN": "YOUR_GITLAB_PAT"
}
}
}
}
GITLAB_TOKEN— GitLab Personal Access Token withapiscope.
Transport Modes
Mode 1: stdio (local, no server needed)
The MCP client spawns the process directly. Configure as shown above.
VS Code (mcp.json)
{
"servers": {
"gitlab-mcp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "gd-gitlab-mcp", "--stdio"],
"env": {
"GITLAB_BASE_URL": "https://gitlab.example.com",
"GITLAB_TOKEN": "YOUR_GITLAB_PAT"
}
}
}
}Claude Desktop / Claude Code (~/.claude/mcp.json)
{
"mcpServers": {
"gitlab-mcp": {
"command": "npx",
"args": ["-y", "gd-gitlab-mcp", "--stdio"],
"env": {
"GITLAB_BASE_URL": "https://gitlab.example.com",
"GITLAB_TOKEN": "YOUR_GITLAB_PAT"
}
}
}
}Mode 2: HTTP server (shared / team deployment)
Run the server once, multiple users connect via URL. Each user provides their own PAT per request via header — the token is never stored server-side.
Requirements
- Node.js 20+
Environment
GITLAB_BASE_URL=https://gitlab.example.com
PORT=4000 # optional, default 4000Run
npm install
npm run build
npm startServer listens at http://localhost:4000/mcp.
Docker
docker build -t gd-gitlab-mcp:latest .
docker run --rm -p 4000:4000 \
-e GITLAB_BASE_URL=https://gitlab.example.com \
gd-gitlab-mcp:latestVS Code (mcp.json)
{
"servers": {
"gitlab-mcp": {
"type": "http",
"url": "http://localhost:4000/mcp",
"headers": {
"x-gitlab-token": "YOUR_GITLAB_PAT"
}
}
}
}Claude Code CLI
claude mcp add --transport http --scope user gitlab-mcp \
http://localhost:4000/mcp --header "x-gitlab-token: YOUR_GITLAB_PAT"Tools Available
| Tool | Description |
|------|-------------|
| search_projects | Search projects by name/path |
| resolve_project | Resolve project query to project ID |
| list_user_repositories | List repositories by access scope |
| list_merge_requests | List MRs with optional filters |
| get_merge_request | Get MR details including approvals |
| get_merge_request_diff | Get MR diff/changes |
| merge_readiness_check | Check if MR is ready to merge |
| check_project_merge_requests | Resolve project + list open MRs in one call |
| get_mr_discussions | Get MR discussion threads |
| merge_request_action | comment / review / approve / merge / reject |
| open_merge_request | Open a new MR |
| merge_merge_request | Merge an MR |
| reject_merge_request | Reject and close an MR |
| run_staging_pipeline | Trigger staging pipeline |
| check_pipeline_status | Check pipeline status |
| list_pipeline_jobs | List jobs in a pipeline |
| retry_pipeline_job | Retry a failed job |
Development
npm install
npm run dev # HTTP mode with hot reloadPublish
npm run build
npm publishRequires npm login with access to `` on npm registry.
