@zereight/mcp-gitlab 2.3.15 → 2.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ko.md CHANGED
@@ -252,7 +252,7 @@ command = lib.getExe inputs.gitlab-mcp.packages.${system}.default;
252
252
 
253
253
  예시는 기존 `mcp-gitlab`보다 충돌 가능성이 낮은 `zereight-mcp-gitlab` 별칭을 사용합니다. MCP 클라이언트가 찾지 못하면 `which zereight-mcp-gitlab`의 절대 경로를 사용하세요.
254
254
 
255
- 전역 설치를 쓰지 않으려면 `npx -y @zereight/mcp-gitlab@2.3.14`처럼 직전 안정 버전(문서가 권장하는 버전)으로 고정하세요. 항상 최신 버전을 원하면 `npx -y @zereight/mcp-gitlab@latest`를 사용하세요. `main`에 머지된 수정을 다음 안정 버전 전에 확인하려면 프리릴리스 빌드인 `npx -y @zereight/mcp-gitlab@next`를 사용하세요(운영 환경용이 아닙니다). 새 버전이 나오면 서버가 시작 시 stderr로 알려줍니다(`GITLAB_DISABLE_VERSION_CHECK=true`로 비활성화 가능).
255
+ 전역 설치를 쓰지 않으려면 `npx -y @zereight/mcp-gitlab@2.3.15`처럼 직전 안정 버전(문서가 권장하는 버전)으로 고정하세요. 항상 최신 버전을 원하면 `npx -y @zereight/mcp-gitlab@latest`를 사용하세요. `main`에 머지된 수정을 다음 안정 버전 전에 확인하려면 프리릴리스 빌드인 `npx -y @zereight/mcp-gitlab@next`를 사용하세요(운영 환경용이 아닙니다). 새 버전이 나오면 서버가 시작 시 stderr로 알려줍니다(`GITLAB_DISABLE_VERSION_CHECK=true`로 비활성화 가능).
256
256
 
257
257
  #### Claude Desktop 원클릭 설치(MCP Bundle)
258
258
 
package/README.md CHANGED
@@ -258,7 +258,7 @@ The store path is pinned by your lock file; update it with `nix flake update git
258
258
 
259
259
  The examples use `zereight-mcp-gitlab`, a less collision-prone alias for the legacy `mcp-gitlab` binary. If your MCP client cannot find it, use the absolute path from `which zereight-mcp-gitlab`.
260
260
 
261
- No global install? Pin `npx` to the previous stable release (the version these docs recommend), for example `npx -y @zereight/mcp-gitlab@2.3.14`. If you always want the newest release, use `npx -y @zereight/mcp-gitlab@latest` instead. To try a fix merged to `main` before the next stable release, use `npx -y @zereight/mcp-gitlab@next`, a pre-release build that is not meant for production. The server prints a notice to stderr on startup when a newer version is available (disable with `GITLAB_DISABLE_VERSION_CHECK=true`).
261
+ No global install? Pin `npx` to the previous stable release (the version these docs recommend), for example `npx -y @zereight/mcp-gitlab@2.3.15`. If you always want the newest release, use `npx -y @zereight/mcp-gitlab@latest` instead. To try a fix merged to `main` before the next stable release, use `npx -y @zereight/mcp-gitlab@next`, a pre-release build that is not meant for production. The server prints a notice to stderr on startup when a newer version is available (disable with `GITLAB_DISABLE_VERSION_CHECK=true`).
262
262
 
263
263
  #### Claude Desktop one-click install (MCP Bundle)
264
264
 
package/README.pt-BR.md CHANGED
@@ -252,7 +252,7 @@ O caminho no store é fixado pelo seu lock file; atualize-o com `nix flake updat
252
252
 
253
253
  Os exemplos usam `zereight-mcp-gitlab`, um alias com menor chance de conflito que o binário legado `mcp-gitlab`. Se o seu cliente MCP não o encontrar, use o caminho absoluto retornado por `which zereight-mcp-gitlab`.
254
254
 
255
- Não quer instalar globalmente? Fixe o `npx` na versão estável anterior (a versão recomendada por esta documentação), por exemplo `npx -y @zereight/mcp-gitlab@2.3.14`. Se quiser sempre a versão mais recente, use `npx -y @zereight/mcp-gitlab@latest`. Para testar uma correção já mesclada na `main` antes da próxima versão estável, use `npx -y @zereight/mcp-gitlab@next`, um build de pré-lançamento que não é indicado para produção. O servidor exibe um aviso no stderr durante a inicialização quando existe uma versão mais nova disponível (desative com `GITLAB_DISABLE_VERSION_CHECK=true`).
255
+ Não quer instalar globalmente? Fixe o `npx` na versão estável anterior (a versão recomendada por esta documentação), por exemplo `npx -y @zereight/mcp-gitlab@2.3.15`. Se quiser sempre a versão mais recente, use `npx -y @zereight/mcp-gitlab@latest`. Para testar uma correção já mesclada na `main` antes da próxima versão estável, use `npx -y @zereight/mcp-gitlab@next`, um build de pré-lançamento que não é indicado para produção. O servidor exibe um aviso no stderr durante a inicialização quando existe uma versão mais nova disponível (desative com `GITLAB_DISABLE_VERSION_CHECK=true`).
256
256
 
257
257
  #### Instalação com um clique no Claude Desktop (MCP Bundle)
258
258
 
package/README.zh-CN.md CHANGED
@@ -252,7 +252,7 @@ command = lib.getExe inputs.gitlab-mcp.packages.${system}.default;
252
252
 
253
253
  示例使用 `zereight-mcp-gitlab`,这是比旧的 `mcp-gitlab` 更不容易冲突的别名。如果 MCP 客户端找不到它,请使用 `which zereight-mcp-gitlab` 输出的绝对路径。
254
254
 
255
- 如果不想全局安装,请将 `npx` 固定到上一个稳定版本(即文档推荐的版本),例如 `npx -y @zereight/mcp-gitlab@2.3.14`。如果始终想使用最新版本,请改用 `npx -y @zereight/mcp-gitlab@latest`。如需在下一个稳定版本发布前试用已合并到 `main` 的修复,请使用 `npx -y @zereight/mcp-gitlab@next`(预发布版本,不适用于生产环境)。有新版本发布时,服务器会在启动时通过 stderr 提示(可用 `GITLAB_DISABLE_VERSION_CHECK=true` 关闭)。
255
+ 如果不想全局安装,请将 `npx` 固定到上一个稳定版本(即文档推荐的版本),例如 `npx -y @zereight/mcp-gitlab@2.3.15`。如果始终想使用最新版本,请改用 `npx -y @zereight/mcp-gitlab@latest`。如需在下一个稳定版本发布前试用已合并到 `main` 的修复,请使用 `npx -y @zereight/mcp-gitlab@next`(预发布版本,不适用于生产环境)。有新版本发布时,服务器会在启动时通过 stderr 提示(可用 `GITLAB_DISABLE_VERSION_CHECK=true` 关闭)。
256
256
 
257
257
  #### Claude Desktop 一键安装(MCP Bundle)
258
258
 
package/build/index.js CHANGED
@@ -254,7 +254,7 @@ function createServer() {
254
254
  const isPlainTextResult = toolName === "get_pipeline_job_output" ||
255
255
  toolName === "get_job_artifact_file" ||
256
256
  (toolName === "download_release_asset" && !IS_REMOTE);
257
- const summarized = applyListSummaryToToolResult(redactErrorResultUrls(result), listSummaryRequested);
257
+ const summarized = applyListSummaryToToolResult(redactErrorResultUrls(result), listSummaryRequested, toolName);
258
258
  const filtered = applyJmespathToToolResult(summarized, jmespathExpression, {
259
259
  ...completionOptions,
260
260
  maskValue: maskingEngine ? (value) => maskingEngine.maskValue(value) : undefined,
@@ -26,6 +26,30 @@ const SUMMARY_FIELDS = [
26
26
  "draft",
27
27
  "updated_at",
28
28
  ];
29
+ /**
30
+ * Extra fields a tool's summary keeps on top of SUMMARY_FIELDS: the access and
31
+ * protection fields these tools exist to answer (#942).
32
+ */
33
+ const TOOL_SUMMARY_FIELDS = {
34
+ list_branches: [
35
+ "protected",
36
+ "default",
37
+ "merged",
38
+ "can_push",
39
+ "developers_can_push",
40
+ "developers_can_merge",
41
+ ],
42
+ list_protected_branches: [
43
+ "push_access_levels",
44
+ "merge_access_levels",
45
+ "unprotect_access_levels",
46
+ "allow_force_push",
47
+ "code_owner_approval_required",
48
+ ],
49
+ list_protected_tags: ["create_access_levels"],
50
+ list_project_members: ["access_level", "expires_at"],
51
+ list_group_members: ["access_level", "expires_at"],
52
+ };
29
53
  /** Fields kept per note when a summarized item carries discussion `notes`. */
30
54
  const NOTE_SUMMARY_FIELDS = ["id", "body", "created_at", "resolved"];
31
55
  const NATIVE_SUMMARY_TOOLS = new Set(["list_webhook_events"]);
@@ -43,7 +67,7 @@ const LIST_SUMMARY_DEFAULT_EXCLUDED_TOOLS = new Set([
43
67
  "list_webhooks", // url, event flags
44
68
  "list_pipeline_triggers", // description
45
69
  "list_job_artifacts", // path, type, size
46
- "list_branches", // protected, default, merged
70
+ // Small replies whose access fields are the point; summary: true keeps them (TOOL_SUMMARY_FIELDS).
47
71
  "list_protected_branches", // *_access_levels, allow_force_push
48
72
  "list_protected_tags", // create_access_levels
49
73
  "list_project_members", // access_level, expires_at
@@ -143,12 +167,12 @@ function summarizeNote(note) {
143
167
  }
144
168
  return summarized;
145
169
  }
146
- function summarizeItem(item) {
170
+ function summarizeItem(item, extraFields = []) {
147
171
  if (!isRecord(item)) {
148
172
  return item;
149
173
  }
150
174
  const summarized = {};
151
- for (const field of SUMMARY_FIELDS) {
175
+ for (const field of [...SUMMARY_FIELDS, ...extraFields]) {
152
176
  if (field in item) {
153
177
  summarized[field] = item[field];
154
178
  }
@@ -165,19 +189,22 @@ function summarizeItem(item) {
165
189
  }
166
190
  return Object.keys(summarized).length > 0 ? summarized : item;
167
191
  }
168
- export function summarizeListPayload(data) {
192
+ /** With `toolName`, the summary also keeps that tool's TOOL_SUMMARY_FIELDS. */
193
+ export function summarizeListPayload(data, toolName) {
194
+ const extraFields = (toolName && TOOL_SUMMARY_FIELDS[toolName]) || [];
195
+ const summarize = (item) => summarizeItem(item, extraFields);
169
196
  if (Array.isArray(data)) {
170
- return data.map(summarizeItem);
197
+ return data.map(summarize);
171
198
  }
172
199
  if (isRecord(data) && Array.isArray(data.items)) {
173
- return { ...data, items: data.items.map(summarizeItem) };
200
+ return { ...data, items: data.items.map(summarize) };
174
201
  }
175
202
  return data;
176
203
  }
177
204
  function isTextContentBlock(value) {
178
205
  return typeof value === "object" && value !== null;
179
206
  }
180
- export function applyListSummaryToToolResult(result, requested) {
207
+ export function applyListSummaryToToolResult(result, requested, toolName) {
181
208
  if (!requested || result.isError) {
182
209
  return result;
183
210
  }
@@ -190,7 +217,7 @@ export function applyListSummaryToToolResult(result, requested) {
190
217
  }
191
218
  try {
192
219
  const parsed = JSON.parse(block.text);
193
- return { ...block, text: JSON.stringify(summarizeListPayload(parsed)) };
220
+ return { ...block, text: JSON.stringify(summarizeListPayload(parsed, toolName)) };
194
221
  }
195
222
  catch {
196
223
  return block;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zereight/mcp-gitlab",
3
- "version": "2.3.15",
3
+ "version": "2.3.16",
4
4
  "mcpName": "io.github.zereight/gitlab-mcp",
5
5
  "description": "GitLab MCP server for projects, merge requests, issues, pipelines, wiki, releases, and more",
6
6
  "keywords": [