gitlab-mcp
A Model Context Protocol server for self-hosted GitLab instances, enabling users to manage issues, merge requests, pipelines, and more via Claude Code.
README
GitLab MCP Server
Token-optimized Model Context Protocol server for self-hosted GitLab instances, designed for Claude Code.
Features
- Multi-profile PAT management — switch between multiple GitLab instances
- Compact text responses — minimal token usage for LLM context
- Project caching — avoids redundant API calls (2min TTL)
- Full GitLab workflow — issues, merge requests, pipelines, notes
- Env or config-file auth — flexible credential management
Setup
1. Install dependencies
bun install
2. Get a GitLab Personal Access Token
- Go to your GitLab instance → Settings → Access Tokens
- Create a token with scopes:
api,read_user
3. Configure
Option A: Environment variables
export GITLAB_BASE_URL="https://gitlab.example.com"
export GITLAB_TOKEN="your-personal-access-token"
export GITLAB_DEFAULT_PROJECT="group/subgroup/repo" # optional
Option B: Use the set_gitlab_pat tool at runtime — profiles are stored in ~/.config/gitlab-mcp-server/config.json with 0600 permissions.
4. Add to Claude Code
Add to your ~/.claude/settings.json or project .claude/settings.json:
{
"mcpServers": {
"gitlab": {
"command": "bun",
"args": ["run", "/path/to/gitlab-mcp-server/index.ts"],
"env": {
"GITLAB_BASE_URL": "https://gitlab.example.com",
"GITLAB_TOKEN": "your-personal-access-token",
"GITLAB_DEFAULT_PROJECT": "group/subgroup/repo"
}
}
}
}
Available Tools
Profile Management
| Tool | Description |
|---|---|
set_gitlab_pat |
Save or update a GitLab PAT profile |
list_gitlab_profiles |
List saved profiles (tokens masked) |
use_gitlab_profile |
Switch active profile |
delete_gitlab_profile |
Delete a saved profile |
get_authenticated_user |
Verify PAT and show current user |
Projects
| Tool | Description |
|---|---|
get_projects |
List accessible projects (search, filter) |
get_project |
Get project details by ID or path |
Issues
| Tool | Description |
|---|---|
get_issues |
List issues with filters (state, labels, assignee) |
get_issue |
Full issue details with recent notes |
create_issue |
Create a new issue |
add_issue_note |
Add a comment to an issue |
Merge Requests
| Tool | Description |
|---|---|
get_merge_requests |
List MRs with filters (state, assignee) |
get_merge_request |
Full MR details with recent notes |
create_merge_request |
Create a new merge request |
add_merge_request_note |
Add a comment to a merge request |
Pipelines
| Tool | Description |
|---|---|
get_pipelines |
List recent pipelines (filter by ref, status) |
get_pipeline |
Pipeline details with job breakdown |
retry_pipeline |
Retry all failed jobs in a pipeline |
cancel_pipeline |
Cancel a running pipeline |
Multi-Instance Support
All tools use the active profile. Switch between GitLab instances:
# Save profiles
set_gitlab_pat(name: "work", baseUrl: "https://gitlab.company.com", token: "...")
set_gitlab_pat(name: "oss", baseUrl: "https://gitlab.com", token: "...")
# Switch
use_gitlab_profile(name: "work")
Projects can be referenced by ID or path:
projectId: "123"
projectPath: "group/subgroup/repo"
If defaultProject is set in the profile, it's used when neither is provided.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.