原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。评价和账户功能将在后续阶段推出。
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

Efficient GitLab

作者:detailobsessed版本 2.33.0i★ –i在你的电脑上运行
注册名称io.github.detailobsessed/efficient-gitlab

安装

概览

作者提供的说明(英文原文)

Token-efficient GitLab MCP: 167 tools via 3 meta-tools, field projection, keyset pagination

PopNx MCP 的三大支柱

这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。

它能帮你做什么

我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。

  • 连接方式: 在你的电脑上运行
  • 传输方式: stdio
  • 分类: 开发者工具
  • 你需要填写:GITLAB_PERSONAL_ACCESS_TOKEN

安装

选择你使用的 AI 应用,然后复制设置。

安装之前

  • 基础检查:1 项中通过 1 项
  • 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
  • 需要你自己填写: GITLAB_PERSONAL_ACCESS_TOKEN, GITLAB_API_URL

标为机密的值是你账户的钥匙。千万不要分享给别人,也不要粘贴到聊天里。

你需要

  • npm已安装 Node.js(用于 npx 命令)

你用的是哪个应用?

在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。

打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json

{
  "mcpServers": {
    "efficient-gitlab": {
      "command": "npx",
      "args": [
        "-y",
        "efficient-gitlab-mcp-server"
      ],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "your-value",
        "GITLAB_API_URL": "your-value"
      }
    }
  }
}

在终端中运行这条命令

claude mcp add efficient-gitlab --env GITLAB_PERSONAL_ACCESS_TOKEN=your-value --env GITLAB_API_URL=your-value -- npx -y efficient-gitlab-mcp-server

运行前请先填写空着的值。

在 Cursor 中打开

或者自己复制设置

粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json

{
  "mcpServers": {
    "efficient-gitlab": {
      "command": "npx",
      "args": [
        "-y",
        "efficient-gitlab-mcp-server"
      ],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "your-value",
        "GITLAB_API_URL": "your-value"
      }
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

在 VS Code 中打开

或者自己复制设置

粘贴到项目中的 .vscode/mcp.json

{
  "servers": {
    "efficient-gitlab": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "efficient-gitlab-mcp-server"
      ],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "your-value",
        "GITLAB_API_URL": "your-value"
      }
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。

你的选择通过 Cookie 保存在这台设备上,无需账户。

需要你填写的值

  • GITLAB_PERSONAL_ACCESS_TOKEN 机密 必填 env
    GitLab personal access token with API scope
  • GITLAB_API_URL env
    GitLab API base URL (default: https://gitlab.com)

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月6日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 detailobsessed 验证,该账户拥有此仓库

  • … 尚未检查

    仍在维护

    我们还没有从 GitHub 读取这个仓库

  • … 尚未检查

    有许可证

    我们还没有从 GitHub 读取这个仓库

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

与“开发者工具”中的其他服务器比较i

  • 星标数多于此分类中其他 1385 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 1385 个服务器的 17% 更新
  • 基础检查结果等于或优于此分类中其他 1385 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

Efficient GitLab 安全吗?

它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

你需要填写:GITLAB_PERSONAL_ACCESS_TOKEN

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于–,最新版本(2.33.0)于6个月前进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。

有什么可以替代它?

同一分类中有:GitHub, Desktop Commander, Cloudflare MCP

替代选择

同一分类中其他作者的服务器,按星标数排序。

如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

GitHub

作者:github

Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.

电脑或云端★ 34,245MIT3天前更新
安装

Desktop Commander

作者:wonderwhy-er

MCP server for terminal commands, file operations, and process management

在你的电脑上运行★ 10,225MIT15天前更新
安装

Cloudflare MCP

作者:cloudflare

Cloudflare MCP servers

在云端运行★ 4,446Apache-2.014个月前更新
安装

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

Efficient GitLab MCP

[!CAUTION]

This repository is archived (2026-05-22).

Upstream zereight/gitlab-mcp v2.1+ has independently implemented progressive disclosure and schema slimming (commit 44983ec). The differentiators that justified this fork no longer apply — please use upstream instead.

Token-efficient GitLab MCP server. A fork of zereight/gitlab-mcp re-architected for agent context budgets: 167 tools delivered through 3 meta-tools, with field projection on every list endpoint, server-side file trimming, and keyset pagination on large directories.

If your agent's first turn against an MCP server costs ~20K tokens of tool definitions before you've asked anything, this fork is for you.


Quick Start

Prerequisites
  • A GitLab Personal Access Token with api scope (or read_api for read-only). Create one →
  • Node.js 18+ (for npx) or Bun 1.0+ (for bunx)
MCP client config (recommended for most users)

Add this to your MCP client config — Claude Desktop, Cursor, Claude Code, IDE extensions, etc.:

{

"mcpServers": { "gitlab": { "command": "npx", "args": ["efficient-gitlab-mcp-server@latest"], "env": { "GITLAB_PERSONAL_ACCESS_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx", "GITLAB_API_URL": "https://gitlab.com" } } } }

Restart your client. The server is live with 3 meta-tools (list_categories, activate_tools, deactivate_tools). Your agent discovers GitLab tools by activating categories on demand — see How It Works for a worked example.

Prefer bun? Replace "command": "npx" with "command": "bunx".

Variants

Self-hosted GitLab — point at your instance's base URL (the server appends /api/v4 itself):

"env": {

"GITLAB_PERSONAL_ACCESS_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx", "GITLAB_API_URL": "https://gitlab.your-company.com" }

Pinned to a single project — agents don't need to repeat project_id; it's used as a default:

"env": {

"GITLAB_PERSONAL_ACCESS_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx", "GITLAB_API_URL": "https://gitlab.com", "GITLAB_PROJECT_ID": "12345" }

Restricted to multiple projects — every call must specify a project_id from the allow-list:

"env": {

"GITLAB_PERSONAL_ACCESS_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx", "GITLAB_API_URL": "https://gitlab.com", "GITLAB_ALLOWED_PROJECT_IDS": "12345,67890,123" }

Read-only (auto-detected) — use a PAT with only read_api scope; the server detects the limited scope at startup and only exposes the 93 read tools. No extra config needed.

Read-only (forced) — keep your api-scope PAT but force read-only mode at the server level:

"env": {

"GITLAB_PERSONAL_ACCESS_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx", "GITLAB_API_URL": "https://gitlab.com", "GITLAB_READ_ONLY_MODE": "true" }

Other entry points

Claude Code CLI (one-liner add):

claude mcp add -s user gitlab \

-e GITLAB_PERSONAL_ACCESS_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx \ -e GITLAB_API_URL=https://gitlab.com \ -- npx efficient-gitlab-mcp-server@latest

GitLab CI runner — CI_JOB_TOKEN is auto-detected if no PAT is set. Use GITLAB_PROJECT_ID: $CI_PROJECT_ID to scope to the running project. No extra setup.

From source (development):

git clone https://github.com/detailobsessed/efficient-gitlab-mcp.git

cd efficient-gitlab-mcp bun install bun run build bun start

Hit a snag? See Troubleshooting. Need to tune more env vars? See full Configuration reference.


Table of Contents

  • Quick Start
  • Why this fork?
  • Token Efficiency
  • Progressive Disclosure
  • Field Projection
  • Server-Side File Trimming
  • Keyset Pagination
  • What's Different From Upstream?
  • Available Categories
  • How It Works
  • Configuration
  • Features
  • Read-Only Mode & PAT Safety
  • Secret Redaction
  • Tool Annotations
  • MCP Protocol Logging
  • HTTP Transport Security
  • Troubleshooting
  • Development
  • Upstream Tracking
  • Security
  • Acknowledgments
  • License

Why this fork?

GitLab's API surface is huge, and the upstream MCP server reflects that — every tool is exposed at startup, all the time. For an agent on a context budget, that's wasteful in three places:

  1. Tool definitions at startup. Hundreds of tool schemas are forced into the prompt before the first user turn.
  2. List-endpoint responses. GitLab list endpoints return objects with 100+ fields per row by default; relevant signal is usually <10 fields.
  3. File contents and large directories. Reading a single file can pull in thousands of irrelevant lines; listing a large repository tree returns everything at once.

This fork addresses all three: progressive disclosure for tool definitions, field projection for list responses, and trimming + keyset pagination for content.


Token Efficiency

Progressive Disclosure

Instead of exposing 167 individual tools, the server exposes 3 meta-tools:

Meta-ToolPurpose
list_categoriesDiscover available tool categories and their activation status
activate_toolsEnable all tools in one or more categories
deactivate_toolsDisable a category once you're done — frees the tokens back
ApproachTools ExposedApproximate Token Cost
Traditional167 tools~20,000+ tokens
Progressive Disclosure3 meta-tools~1,500 tokens

~90% reduction in tool-definition tokens at startup. Tools are registered with the MCP SDK but kept disabled (tool.disable()) until the LLM activates a category — activation triggers a tools/list_changed notification so the client picks them up live.

Field Projection

List endpoints — and a growing set of singular get_* endpoints — return a curated, allow-listed default set of fields per resource. Callers can opt into the full payload with fields: "all" or pick their own list with fields: ["id", "name"].

Currently applied to:

  • list_projects, list_group_projects, get_project
  • list_issues, my_issues, get_issue
  • list_merge_requests, get_merge_request
  • list_pipelines, get_pipeline
  • list_releases
  • list_commits, get_commit
  • get_current_user, get_user, get_users, search_users

A spike measurement against list_projects with 5 owned projects went from ~32 KB → ~3 KB by switching to the compact default. Because it's allow-list based, the compact output stays compact when GitLab adds new fields upstream.

Example — fetch a merge request with the compact default vs. the full GitLab payload:

// Default: ~17 fields (iid, title, state, draft, labels, branches, author, …)

{ "name": "get_merge_request", "arguments": { "merge_request_iid": 42 } }

// Opt out: the raw GitLab response { "name": "get_merge_request", "arguments": { "merge_request_iid": 42, "fields": "all" } }

// Custom pick { "name": "get_merge_request", "arguments": { "merge_request_iid": 42, "fields": ["iid", "title", "state"] } }

The slim defaults are derived from the same Zod response schemas that validate GitLab API responses (see src/schemas/), so they stay in sync with the type-level shape and there's a single source of truth per resource.

Server-Side File Trimming

get_file_contents accepts trim parameters so agents don't have to pull whole files into context just to read a function:

ParameterPurpose
head: NReturn only the first N lines
tail: NReturn only the last N lines
range: "start-end"Return a specific line range
max_bytes: NHard byte cap (composes with line-based trims)

Truncated responses include a note like Showing lines 100-200 of 5234, so a follow-up call can target a different range without re-fetching to count lines first.

Keyset Pagination

get_repository_tree supports keyset pagination (pagination=keyset) and returns an envelope:

{

"items": [...], "pagination_note": "Next page available — call again with pagination=keyset&page_token=..." }

Large monorepos no longer dump 10K entries into a single response. The server reads the cursor from X-Next-Page-Token (or falls back to X-Next-Page on older GitLab instances) and surfaces it inline.


What's Different From Upstream?

This fork builds on zereight/gitlab-mcp with a redesigned architecture focused on token efficiency and maintainability. We regularly review upstream commits and selectively port new features and bugfixes — we don't blindly rebase, since the codebases have structurally diverged.

Architecture at a Glance
AreaUpstreamThis Fork
ArchitectureSingle index.ts (~10K lines)Modular src/ with 16 tool modules
Tool DiscoveryAll 140+ tools exposed at onceSDK-native progressive disclosure (3 meta-tools)
List ResponsesFull GitLab payload (100+ fields/row)Field projection: compact default + opt-in fields
File ContentsWhole-file fetchServer-side head / tail / range / max_bytes trimming
Tree ListingOffset pagination onlyOffset + keyset (pagination=keyset) with cursor envelope
Tool AnnotationsPartialComplete: readOnlyHint / destructiveHint / idempotentHint / openWorldHint on every tool
ConfigurationFlat individual exportsTyped ServerConfig interface with loadConfig()

| Logging | console.log | Structu

只显示了开头部分;其余内容请在仓库中阅读

问 PopNx