GitLab MCP Server
Allows AI agents to manage GitLab merge requests, pipelines, comments, reviewers, and labels through the GitLab REST API.
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 Servershow my open merge requests"
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 (OAuth)
A production-ready MCP (Model Context Protocol) server that lets AI agents
interact with GitLab through a restricted set of 9 tools. Every user
authenticates with their own GitLab account via OAuth 2.0 — no Personal
Access Tokens. The server calls the GitLab REST API directly (no glab CLI).
User → GitLab OAuth Login → MCP Server → GitLab REST APIFeatures
Per-user OAuth 2.0 login (PKCE +
state), token auto-refresh, logout.Server-issued bearer tokens — the client sends one bearer token; the server maps it to that user's GitLab session.
Secure token storage — GitLab tokens encrypted at rest (AES-256-GCM); session tokens stored only as sha-256 hashes.
Strict tool allowlist — only the 9 tools below; no raw API proxy, no admin/destructive operations.
Real GitLab authorization — every action runs as the authenticated user with their own token; project access is checked before each call.
Audit logging — every tool call recorded in PostgreSQL (secrets stripped).
Streamable HTTP MCP transport, PostgreSQL + Prisma, Redis session cache.
Docker Compose one-command deploy. Vitest unit + integration tests.
Related MCP server: GitLab MR MCP
The 9 tools
create_merge_request, update_merge_request, get_merge_request,
list_merge_requests, add_comment, get_pipeline_status, list_pipelines,
assign_reviewer, set_labels.
Quick start (Docker)
Create a GitLab OAuth application (User Settings → Applications, or an instance/group app). See
docs/oauth.mdfor details.Scopes:
read_user,apiRedirect URI:
http://localhost:3000/auth/callbackCopy the Application ID and Secret.
Configure environment:
cp .env.example .env # edit .env: set GITLAB_CLIENT_ID, GITLAB_CLIENT_SECRET, GITLAB_REDIRECT_URI # and generate an encryption key: openssl rand -hex 32 # paste into ENCRYPTION_KEYFor self-hosted GitLab, also set
GITLAB_BASE_URL.Run the stack (Postgres + Redis + app, migrations run automatically):
docker compose up --buildLog in & get your token: open http://localhost:3000/auth/login in a browser, authorize with GitLab, and copy the bearer token shown.
Configure your MCP client to use the Streamable HTTP endpoint:
URL:
http://localhost:3000/mcpHeader:
Authorization: Bearer <your-token>
Example (clients supporting remote HTTP MCP servers with headers):
{ "mcpServers": { "gitlab": { "type": "http", "url": "http://localhost:3000/mcp", "headers": { "Authorization": "Bearer <your-token>" } } } }
To disconnect: curl -X POST http://localhost:3000/auth/logout -H "Authorization: Bearer <token>".
Local development (without Docker for the app)
# Start datastores only:
docker compose up -d postgres redis
cp .env.example .env # set GitLab creds + ENCRYPTION_KEY
# point DATABASE_URL/REDIS_URL at localhost (the defaults already do)
npm install
npm run db:generate
npm run db:migrate # creates/apply migrations locally
npm run dev # http://localhost:3000Tests
npm testGitLab is always mocked — no live calls and no credentials required.
Documentation
CLAUDE.md— repo conventions / hard rules for contributors.
License
MIT
This server cannot be installed
Maintenance
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/lxnewayfarer/gitlab-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server