GitLab MCP Server

编码与调试

by ttpears

让 LLM 深度探索和分析 GitLab 实例,支持搜索、代码浏览、Issue 管理,并兼容自托管与 GitLab.com 认证。

什么是 GitLab MCP Server

让 LLM 深度探索和分析 GitLab 实例,支持搜索、代码浏览、Issue 管理,并兼容自托管与 GitLab.com 认证。

README

GitLab MCP Server

npm version License: MIT

A community MCP server for GitLab — works with any GitLab tier (Free, Premium, Ultimate), no GitLab Duo required.

bash
npx @ttpears/gitlab-mcp-server

How This Differs from GitLab's Official MCP Server

GitLab ships an official MCP server (Beta) that requires Premium/Ultimate and GitLab Duo with beta features enabled. This community server is an alternative for teams that don't have those requirements or need different capabilities.

This serverGitLab official
GitLab tierFree, Premium, UltimatePremium / Ultimate only
GitLab Duo requiredNoYes
AuthPersonal Access TokenOAuth 2.0 Dynamic Client Registration
Transportstdio + streamable HTTPstdio (via mcp-remote) + HTTP
Multi-clientClaude Code, LibreChat, any MCP clientClaude Desktop, Claude Code, Cursor, VS Code
Multi-user auth modeshybrid / shared / per-userOAuth per-user
GraphQL schema discoveryYes — introspect & run custom queriesNo
Repository browsing & file readingYesNo
User / group searchYesNo
Update issues & MRsYesNo (create only)
CI/CD pipeline managementYesYes
MR diffs & commitsYesYes
Work item notesYesYes
Semantic code searchNoYes (requires additional setup)
Label searchYesYes
Milestone trackingYesNo
Iteration/sprint trackingYesNo
Time tracking & timelogsYesNo
MR reviewer & approval statusYesNo
Project statistics dashboardYesNo
Group member listingYesNo

Choose this server if you're on GitLab Free/Community Edition, need GraphQL flexibility, want repo browsing, or run LibreChat multi-user deployments.

Choose the official server if you have GitLab Premium/Ultimate with Duo, need semantic code search, or prefer OAuth over PATs.


Quick Start

1. Create a GitLab Token

Go to GitLab → User SettingsAccess Tokens → create a token with read_api (read-only) or api (full access) scope.

2. Choose Your Client


Claude Code

Add to your Claude Code settings (.claude/settings.json or project .mcp.json):

json
{
  "mcpServers": {
    "gitlab": {
      "command": "npx",
      "args": ["-y", "@ttpears/gitlab-mcp-server"],
      "env": {
        "GITLAB_URL": "https://gitlab.com",
        "GITLAB_SHARED_ACCESS_TOKEN": "glpat-your-token-here"
      }
    }
  }
}

Restart Claude Code to load the server.


LibreChat (Docker)

Runs as a sidecar container using streamable HTTP transport for multi-user deployments with per-user credential isolation.

1. Add environment variables to your LibreChat .env:

bash
GITLAB_URL=https://gitlab.com
GITLAB_AUTH_MODE=hybrid
GITLAB_SHARED_ACCESS_TOKEN=glpat-your-shared-token
GITLAB_MCP_PORT=8008
MCP_TRANSPORT=http

2. Add the service to docker-compose.override.yml:

yaml
services:
  gitlab-mcp:
    build:
      context: .
      dockerfile: Dockerfile.mcp-gitlab
    env_file:
      - .env
    ports:
      - "8008:8008"
    networks:
      - librechat
    restart: unless-stopped

Copy the Dockerfile from this repo into your LibreChat directory as Dockerfile.mcp-gitlab. It clones and builds from this repository automatically — no source files needed.

3. Configure in librechat.yml:

yaml
mcpServers:
  gitlab:
    type: streamable-http
    url: "http://gitlab-mcp:8008/"
    headers:
      Authorization: "Bearer {{GITLAB_PAT}}"
      X-GitLab-Url: "{{GITLAB_URL_OVERRIDE}}"
    customUserVars:
      GITLAB_PAT:
        title: "GitLab Personal Access Token"
        description: "PAT with api scope"
      GITLAB_URL_OVERRIDE:
        title: "GitLab URL (optional)"
        description: "e.g., https://gitlab.yourdomain.com"

4. Restart LibreChat:

bash
docker compose down && docker compose -f docker-compose.yml -f docker-compose.override.yml up -d

Available Tools

Search & Discovery

ToolDescription
search_gitlabGlobal search across projects, issues, and merge requests
search_projectsFind repositories by name or description
search_issuesSearch issues globally or within a project (filter by assignee, author, labels, state)
search_merge_requestsFind merge requests by username or within a project
search_usersFind team members and contributors
search_groupsDiscover groups and organizations
search_labelsSearch labels in a project or group
list_group_membersList group members with access levels
browse_repositoryExplore directory structure and files
get_file_contentRead file contents for code analysis

Read Operations

ToolDescription
get_projectDetailed project information
get_issuesList project issues with pagination
get_merge_requestsList project merge requests with pagination
get_merge_request_pipelinesGet CI/CD pipelines for a merge request
get_pipeline_jobsGet jobs for a specific pipeline
get_merge_request_diffsGet diff statistics for a merge request
get_merge_request_commitsGet commits for a merge request
get_notesGet notes/comments on an issue or merge request
list_milestonesList milestones with progress statistics
list_iterationsList iterations/sprints (Premium/Ultimate)
get_time_trackingGet time estimate, spent, and timelogs
get_merge_request_reviewersGet MR approval and reviewer status
get_project_statisticsAggregate project stats dashboard
get_user_issuesGet all issues assigned to a user
get_user_merge_requestsGet MRs authored by or assigned to a user
resolve_pathResolve a path to a project or group
get_available_queriesDiscover available GraphQL operations
execute_custom_queryRun custom GraphQL queries

Write Operations (requires user authentication)

ToolDescription
create_issueCreate new issues
create_merge_requestCreate new merge requests
create_noteAdd a comment/note to an issue or merge request
manage_pipelineRetry or cancel a CI/CD pipeline
update_issueUpdate title, description, assignees, labels, due date
update_merge_requestUpdate title, description, assignees, reviewers, labels

Configuration

Authentication Modes

ModeDescriptionUse Case
hybrid (default)Shared token for reads + per-user tokens for writesMulti-user deployments
sharedSingle token for all operationsSingle-user / trusted environments
per-userAll operations require user authenticationHigh-security environments

Environment Variables

VariableDescriptionDefault
GITLAB_URLGitLab instance URLhttps://gitlab.com
GITLAB_AUTH_MODEAuthentication mode (hybrid, shared, per-user)hybrid
GITLAB_SHARED_ACCESS_TOKENShared token for read operations
GITLAB_MAX_PAGE_SIZEMaximum items per page (1-100)50
GITLAB_TIMEOUTRequest timeout in milliseconds30000
GITLAB_MCP_PORTHTTP server port (LibreChat mode)8008
MCP_TRANSPORTTransport mode (http for LibreChat)stdio

Troubleshooting

Connection issues with LibreChat:

  • Verify type: streamable-http in librechat.yml (not sse)
  • URL should be http://gitlab-mcp:8008/ (the Docker service name, not localhost)
  • Ensure both containers share the same Docker network
  • Check logs: docker logs gitlab-mcp

Authentication errors:

  • Verify token has read_api or api scope and hasn't expired
  • For LibreChat: check the user provided a valid PAT in the credentials UI

Schema introspection failed:

  • Requires GitLab 12.0+ with GraphQL API enabled
  • Verify GITLAB_URL is reachable from the container

Debug logging:

bash
NODE_ENV=development GITLAB_URL=https://your-gitlab.com npm start

Health check (HTTP mode):

bash
curl http://localhost:8008/health

Testing

bash
# Test with MCP Inspector
npx @modelcontextprotocol/inspector npx @ttpears/gitlab-mcp-server

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

License

MIT

常见问题

GitLab MCP Server 是什么?

让 LLM 深度探索和分析 GitLab 实例,支持搜索、代码浏览、Issue 管理,并兼容自托管与 GitLab.com 认证。

相关 Skills

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描114.1k

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描114.1k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描114.1k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
83.4k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
52.2k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.3k

评论