@zereight/mcp-gitlab 2.3.27-next.233 → 2.3.27
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 +1 -1
- package/README.md +1 -1
- package/README.pt-BR.md +1 -1
- package/README.zh-CN.md +1 -1
- package/build/schemas.js +11 -9
- package/build/utils/helpers.js +47 -12
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -262,7 +262,7 @@ command = lib.getExe inputs.gitlab-mcp.packages.${system}.default;
|
|
|
262
262
|
|
|
263
263
|
예시는 기존 `mcp-gitlab`보다 충돌 가능성이 낮은 `zereight-mcp-gitlab` 별칭을 사용합니다. MCP 클라이언트가 찾지 못하면 `which zereight-mcp-gitlab`의 절대 경로를 사용하세요.
|
|
264
264
|
|
|
265
|
-
전역 설치를 쓰지 않으려면 `npx -y @zereight/mcp-gitlab@2.3.
|
|
265
|
+
전역 설치를 쓰지 않으려면 `npx -y @zereight/mcp-gitlab@2.3.26`처럼 직전 안정 버전(문서가 권장하는 버전)으로 고정하세요. 항상 최신 버전을 원하면 `npx -y @zereight/mcp-gitlab@latest`를 사용하세요. `main`에 머지된 수정을 다음 안정 버전 전에 확인하려면 프리릴리스 빌드인 `npx -y @zereight/mcp-gitlab@next`를 사용하세요(운영 환경용이 아닙니다). 새 버전이 나오면 서버가 시작 시 stderr로 알려줍니다(`GITLAB_DISABLE_VERSION_CHECK=true`로 비활성화 가능).
|
|
266
266
|
|
|
267
267
|
#### Claude Desktop 원클릭 설치(MCP Bundle)
|
|
268
268
|
|
package/README.md
CHANGED
|
@@ -267,7 +267,7 @@ The store path is pinned by your lock file; update it with `nix flake update git
|
|
|
267
267
|
|
|
268
268
|
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`.
|
|
269
269
|
|
|
270
|
-
No global install? Pin `npx` to the previous stable release (the version these docs recommend), for example `npx -y @zereight/mcp-gitlab@2.3.
|
|
270
|
+
No global install? Pin `npx` to the previous stable release (the version these docs recommend), for example `npx -y @zereight/mcp-gitlab@2.3.26`. 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`).
|
|
271
271
|
|
|
272
272
|
#### Claude Desktop one-click install (MCP Bundle)
|
|
273
273
|
|
package/README.pt-BR.md
CHANGED
|
@@ -262,7 +262,7 @@ O caminho no store é fixado pelo seu lock file; atualize-o com `nix flake updat
|
|
|
262
262
|
|
|
263
263
|
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`.
|
|
264
264
|
|
|
265
|
-
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.
|
|
265
|
+
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.26`. 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`).
|
|
266
266
|
|
|
267
267
|
#### Instalação com um clique no Claude Desktop (MCP Bundle)
|
|
268
268
|
|
package/README.zh-CN.md
CHANGED
|
@@ -262,7 +262,7 @@ command = lib.getExe inputs.gitlab-mcp.packages.${system}.default;
|
|
|
262
262
|
|
|
263
263
|
示例使用 `zereight-mcp-gitlab`,这是比旧的 `mcp-gitlab` 更不容易冲突的别名。如果 MCP 客户端找不到它,请使用 `which zereight-mcp-gitlab` 输出的绝对路径。
|
|
264
264
|
|
|
265
|
-
如果不想全局安装,请将 `npx` 固定到上一个稳定版本(即文档推荐的版本),例如 `npx -y @zereight/mcp-gitlab@2.3.
|
|
265
|
+
如果不想全局安装,请将 `npx` 固定到上一个稳定版本(即文档推荐的版本),例如 `npx -y @zereight/mcp-gitlab@2.3.26`。如果始终想使用最新版本,请改用 `npx -y @zereight/mcp-gitlab@latest`。如需在下一个稳定版本发布前试用已合并到 `main` 的修复,请使用 `npx -y @zereight/mcp-gitlab@next`(预发布版本,不适用于生产环境)。有新版本发布时,服务器会在启动时通过 stderr 提示(可用 `GITLAB_DISABLE_VERSION_CHECK=true` 关闭)。
|
|
266
266
|
|
|
267
267
|
#### Claude Desktop 一键安装(MCP Bundle)
|
|
268
268
|
|
package/build/schemas.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { EXCLUDED_FILE_PATTERN_MAX_COUNT, EXCLUDED_FILE_PATTERN_MAX_LENGTH, } from "./utils/helpers.js";
|
|
2
3
|
import { omitIncompleteMergeRequestPosition } from "./utils/merge-request-position.js";
|
|
3
4
|
// Helper: coerce a JSON-stringified array to an actual array.
|
|
4
5
|
// LLMs sometimes send '["a", "b"]' (string) instead of ["a", "b"] (array).
|
|
@@ -2242,16 +2243,19 @@ export const GitLabBranchSchema = z.object({
|
|
|
2242
2243
|
default: z.boolean(),
|
|
2243
2244
|
web_url: z.string().optional(),
|
|
2244
2245
|
});
|
|
2246
|
+
const excludedFilePatternsSchema = z
|
|
2247
|
+
.array(z.string().max(EXCLUDED_FILE_PATTERN_MAX_LENGTH))
|
|
2248
|
+
.max(EXCLUDED_FILE_PATTERN_MAX_COUNT);
|
|
2249
|
+
const EXCLUDED_DIFF_PATTERNS_DESCRIPTION = 'Array of regex patterns to exclude files from the diff results. Each pattern is an RE2 regular expression that matches file paths to ignore. RE2 runs in linear time but does not support lookahead, lookbehind, or backreferences. At most 50 patterns of at most 200 characters each. Examples: ["^vendor/", "^test/mocks/", "\\.spec\\.ts$", "package-lock\\.json"]';
|
|
2245
2250
|
export const GetBranchDiffsSchema = ProjectParamsSchema.extend({
|
|
2246
2251
|
from: z.string().describe("The base branch or commit SHA to compare from"),
|
|
2247
2252
|
to: z.string().describe("The target branch or commit SHA to compare to"),
|
|
2248
2253
|
straight: coerceBooleanString
|
|
2249
2254
|
.optional()
|
|
2250
2255
|
.describe("Comparison method: false for '...' (default), true for '--'"),
|
|
2251
|
-
excluded_file_patterns:
|
|
2252
|
-
.array(z.string())
|
|
2256
|
+
excluded_file_patterns: excludedFilePatternsSchema
|
|
2253
2257
|
.optional()
|
|
2254
|
-
.describe(
|
|
2258
|
+
.describe(EXCLUDED_DIFF_PATTERNS_DESCRIPTION),
|
|
2255
2259
|
});
|
|
2256
2260
|
const flexibleBooleanOptional = z.preprocess(val => {
|
|
2257
2261
|
if (typeof val !== "string")
|
|
@@ -2425,10 +2429,9 @@ export const ListMergeRequestPipelinesSchema = ProjectParamsSchema.extend({
|
|
|
2425
2429
|
}).merge(PaginationOptionsSchema);
|
|
2426
2430
|
export const GetMergeRequestDiffsSchema = MergeRequestParamsSchema.extend({
|
|
2427
2431
|
view: z.enum(["inline", "parallel"]).optional().describe("Diff view type"),
|
|
2428
|
-
excluded_file_patterns:
|
|
2429
|
-
.array(z.string())
|
|
2432
|
+
excluded_file_patterns: excludedFilePatternsSchema
|
|
2430
2433
|
.optional()
|
|
2431
|
-
.describe(
|
|
2434
|
+
.describe(EXCLUDED_DIFF_PATTERNS_DESCRIPTION),
|
|
2432
2435
|
});
|
|
2433
2436
|
export const ListMergeRequestDiffsSchema = MergeRequestParamsSchema.extend({
|
|
2434
2437
|
page: z.coerce.number().optional().describe("Page number for pagination (default: 1)"),
|
|
@@ -2441,10 +2444,9 @@ export const ListMergeRequestDiffsSchema = MergeRequestParamsSchema.extend({
|
|
|
2441
2444
|
.describe("Present diffs in the unified diff format. Default is false. Introduced in GitLab 16.5."),
|
|
2442
2445
|
});
|
|
2443
2446
|
export const ListMergeRequestChangedFilesSchema = MergeRequestParamsSchema.extend({
|
|
2444
|
-
excluded_file_patterns:
|
|
2445
|
-
.array(z.string())
|
|
2447
|
+
excluded_file_patterns: excludedFilePatternsSchema
|
|
2446
2448
|
.optional()
|
|
2447
|
-
.describe('Array of regex patterns to exclude files. Examples: ["^vendor/", "\\.pb\\.go$"]'),
|
|
2449
|
+
.describe('Array of regex patterns to exclude files. Each pattern is an RE2 regular expression (linear time; no lookahead, lookbehind, or backreferences). At most 50 patterns of at most 200 characters each. Examples: ["^vendor/", "\\.pb\\.go$"]'),
|
|
2448
2450
|
});
|
|
2449
2451
|
export const GetMergeRequestFileDiffSchema = MergeRequestParamsSchema.extend({
|
|
2450
2452
|
file_paths: z
|
package/build/utils/helpers.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { RE2JS } from "re2js";
|
|
4
|
+
/**
|
|
5
|
+
* Limits on excluded_file_patterns. The tool schemas reject input over these
|
|
6
|
+
* limits, and filterDiffsByPatterns ignores anything over them.
|
|
7
|
+
*/
|
|
8
|
+
export const EXCLUDED_FILE_PATTERN_MAX_LENGTH = 200;
|
|
9
|
+
export const EXCLUDED_FILE_PATTERN_MAX_COUNT = 50;
|
|
10
|
+
// Matching cost per character grows with the compiled program. A counted
|
|
11
|
+
// repeat such as .{1000} repeated many times produces a large program.
|
|
12
|
+
export const EXCLUDED_FILE_PATTERN_MAX_PROGRAM_SIZE = 1000;
|
|
3
13
|
/**
|
|
4
14
|
* Reject absolute paths and directory-traversal sequences for user-supplied
|
|
5
15
|
* local filesystem paths (e.g. local_path / file_path tool arguments).
|
|
@@ -289,27 +299,52 @@ export function summarizeWebhookEvents(events) {
|
|
|
289
299
|
execution_duration: event.execution_duration,
|
|
290
300
|
}));
|
|
291
301
|
}
|
|
302
|
+
/**
|
|
303
|
+
* Compile excluded_file_patterns with RE2, which matches in time linear in the
|
|
304
|
+
* path length. A pattern RE2 cannot compile (lookaround, backreferences, or
|
|
305
|
+
* \uXXXX escapes, for example) is skipped with a warning, so it excludes no files.
|
|
306
|
+
*/
|
|
307
|
+
function compileExcludedFilePatterns(patterns) {
|
|
308
|
+
if (patterns.length > EXCLUDED_FILE_PATTERN_MAX_COUNT) {
|
|
309
|
+
console.warn(`Excluded file patterns after the first ${EXCLUDED_FILE_PATTERN_MAX_COUNT} ignored (${patterns.length} given).`);
|
|
310
|
+
}
|
|
311
|
+
const compiled = [];
|
|
312
|
+
for (const pattern of patterns.slice(0, EXCLUDED_FILE_PATTERN_MAX_COUNT)) {
|
|
313
|
+
if (pattern.length > EXCLUDED_FILE_PATTERN_MAX_LENGTH) {
|
|
314
|
+
console.warn(`Excluded file pattern ignored: ${pattern.length} characters exceeds ${EXCLUDED_FILE_PATTERN_MAX_LENGTH}.`);
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
let regex;
|
|
318
|
+
try {
|
|
319
|
+
regex = RE2JS.compile(pattern);
|
|
320
|
+
}
|
|
321
|
+
catch {
|
|
322
|
+
console.warn(`Invalid regex pattern ignored: ${pattern} (RE2 rejects lookaround, backreferences, and \\uXXXX escapes)`);
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
const programSize = regex.programSize();
|
|
326
|
+
if (programSize > EXCLUDED_FILE_PATTERN_MAX_PROGRAM_SIZE) {
|
|
327
|
+
console.warn(`Excluded file pattern ignored: compiled size ${programSize} exceeds ${EXCLUDED_FILE_PATTERN_MAX_PROGRAM_SIZE}: ${pattern}`);
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
compiled.push(regex);
|
|
331
|
+
}
|
|
332
|
+
return compiled;
|
|
333
|
+
}
|
|
292
334
|
/**
|
|
293
335
|
* Filter MR diffs by excluding files matching regex patterns.
|
|
294
336
|
*
|
|
337
|
+
* Patterns use RE2 syntax (see compileExcludedFilePatterns), so matching cannot
|
|
338
|
+
* backtrack catastrophically on a long path.
|
|
339
|
+
*
|
|
295
340
|
* @param diffs - Array of diff objects with new_path property
|
|
296
|
-
* @param excludedFilePatterns - Array of regex patterns to exclude
|
|
341
|
+
* @param excludedFilePatterns - Array of RE2 regex patterns to exclude
|
|
297
342
|
* @returns Filtered array of diffs
|
|
298
343
|
*/
|
|
299
344
|
export function filterDiffsByPatterns(diffs, excludedFilePatterns) {
|
|
300
345
|
if (!excludedFilePatterns?.length)
|
|
301
346
|
return diffs;
|
|
302
|
-
const regexPatterns = excludedFilePatterns
|
|
303
|
-
.map(pattern => {
|
|
304
|
-
try {
|
|
305
|
-
return new RegExp(pattern);
|
|
306
|
-
}
|
|
307
|
-
catch {
|
|
308
|
-
console.warn(`Invalid regex pattern ignored: ${pattern}`);
|
|
309
|
-
return null;
|
|
310
|
-
}
|
|
311
|
-
})
|
|
312
|
-
.filter((regex) => regex !== null);
|
|
347
|
+
const regexPatterns = compileExcludedFilePatterns(excludedFilePatterns);
|
|
313
348
|
if (regexPatterns.length === 0)
|
|
314
349
|
return diffs;
|
|
315
350
|
const matchesAnyPattern = (path) => {
|
package/package.json
CHANGED