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 curated set of 20 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.MCP-client OAuth (zero token paste) — the server is its own OAuth 2.0 Authorization Server: Dynamic Client Registration + authorization-code/PKCE, with opaque, rotating refresh tokens (reuse detection revokes the whole rotation family). GitLab is the upstream identity provider. Manual bearer-token paste remains as a fallback.
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 20 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.
Docker Compose one-command deploy. Vitest unit + integration tests.
Related MCP server: GitLab MR MCP
The 20 tools
Merge requests: create_merge_request, update_merge_request,
get_merge_request, list_merge_requests, get_merge_request_diff,
get_merge_request_versions.
Comments & discussions: add_comment, list_merge_request_discussions,
reply_to_discussion.
Review actions: assign_reviewer, set_labels, approve_merge_request,
unapprove_merge_request.
Pipelines & jobs: get_pipeline_status, list_pipelines,
get_pipeline_jobs, get_job_log.
Repository: get_file_content (read a file at a given ref; read-only).
User lookup: get_current_user, find_user.
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 + 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
cp .env.example .env # set GitLab creds + ENCRYPTION_KEY
# point DATABASE_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.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables interaction with GitLab repositories through secure OAuth 2.0 authentication. Supports comprehensive GitLab operations including merge requests, issues, file management, commits, and branch operations through natural language.Last updated44MIT
- Alicense-qualityDmaintenanceEnables AI agents to interact with GitLab repositories, manage merge requests, review code diffs, post comments, and handle issues directly through natural language.Last updated62MIT
- Alicense-qualityDmaintenanceEnables AI agents to interact with GitLab repositories, allowing them to manage merge requests and issues including listing projects, fetching MR details and diffs, adding comments, and updating MR titles and descriptions.Last updated6294MIT
- Flicense-quality-maintenanceEnables AI agents to interact with GitLab repositories, monitor documentation changes, manage issues and merge requests, and search across projects with comprehensive file and commit operations.Last updated
Related MCP Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
SaaS intelligence for AI agents. 5 unified tools cover 1,000+ services with 91-96% token savings.
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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