@zereight/mcp-gitlab 2.1.70 → 2.2.0
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 +3 -1
- package/README.md +6 -2
- package/README.pt-BR.md +1 -1
- package/README.zh-CN.md +3 -1
- package/build/config.js +12 -4
- package/build/deprecated-env.js +47 -0
- package/build/index.js +369 -184
- package/build/oauth-device-flow.js +80 -0
- package/build/oauth.js +135 -18
- package/build/schemas.js +1 -1
- package/build/server/remote-http-stack.js +39 -0
- package/build/tools/discover-activation.js +38 -0
- package/build/tools/exposed-tools.js +35 -0
- package/build/tools/listed-tools.js +76 -0
- package/build/tools/registry.js +226 -57
- package/build/tools/tool-profile.js +66 -0
- package/build/utils/compact-tool-allowlist.js +14 -0
- package/build/utils/logger.js +34 -12
- package/package.json +3 -3
- package/build/scripts/check-skill-sync.js +0 -143
- package/build/scripts/generate-server-card.js +0 -39
- package/build/scripts/generate-tool-coverage.js +0 -58
- package/build/scripts/generate-tool-docs.js +0 -430
- package/build/scripts/tool-coverage/coverage.js +0 -341
- package/build/scripts/tool-coverage/coverage.test.js +0 -142
- package/build/test/callback-proxy-tests.js +0 -321
- package/build/test/cli/args.test.js +0 -175
- package/build/test/cli/boolean-flags.test.js +0 -106
- package/build/test/cli/compact-mcp-result.test.js +0 -93
- package/build/test/cli/credentials.test.js +0 -153
- package/build/test/cli/exposure.test.js +0 -104
- package/build/test/cli/load-config-snapshot.js +0 -5
- package/build/test/cli/output.test.js +0 -74
- package/build/test/cli/replay-command.test.js +0 -37
- package/build/test/cli/router.test.js +0 -183
- package/build/test/client-pool-test.js +0 -109
- package/build/test/clients/client.js +0 -34
- package/build/test/clients/custom-header-client.js +0 -122
- package/build/test/clients/sse-client.js +0 -95
- package/build/test/clients/stdio-client.js +0 -113
- package/build/test/clients/streamable-http-client.js +0 -95
- package/build/test/config-allowed-groups.test.js +0 -97
- package/build/test/create-commit-actions.test.js +0 -102
- package/build/test/draft-note-schema.test.js +0 -44
- package/build/test/dynamic-api-url-allowlist.test.js +0 -121
- package/build/test/dynamic-api-url-test.js +0 -304
- package/build/test/dynamic-routing-tests.js +0 -495
- package/build/test/get-merge-request-discussion-schema.test.js +0 -30
- package/build/test/gitlab-api-tool-errors.test.js +0 -112
- package/build/test/gitlab-artifact-entry-schema.test.js +0 -44
- package/build/test/gitlab-diff-schema.test.js +0 -36
- package/build/test/gitlab-pipeline-schedule-schema.test.js +0 -32
- package/build/test/gitlab-tag-schema.test.js +0 -51
- package/build/test/group-milestone-schema.test.js +0 -45
- package/build/test/mcp-oauth-tests.js +0 -905
- package/build/test/mcp-server-name.test.js +0 -87
- package/build/test/merge-merge-request-schema.test.js +0 -75
- package/build/test/multi-server-test.js +0 -190
- package/build/test/no-proxy-integration-test.js +0 -183
- package/build/test/no-proxy-test.js +0 -149
- package/build/test/nullable-gitlab-response-fields.test.js +0 -37
- package/build/test/nullish-tool-arguments-schema.test.js +0 -118
- package/build/test/oauth-device-flow-tests.js +0 -450
- package/build/test/oauth-download-url.test.js +0 -157
- package/build/test/oauth-startup.test.js +0 -204
- package/build/test/oauth-tests.js +0 -428
- package/build/test/path-segment-encoding.test.js +0 -98
- package/build/test/remote-auth-simple-test.js +0 -277
- package/build/test/remote-auth-tests.js +0 -314
- package/build/test/response-masking.test.js +0 -445
- package/build/test/schema-tests.js +0 -1679
- package/build/test/server/metrics.test.js +0 -47
- package/build/test/server/request-helpers.test.js +0 -48
- package/build/test/server/version.test.js +0 -13
- package/build/test/sse-auth-guard.test.js +0 -96
- package/build/test/sse-session-limits.test.js +0 -273
- package/build/test/stateless/callback-proxy.test.js +0 -510
- package/build/test/stateless/client-id.test.js +0 -177
- package/build/test/stateless/codec.test.js +0 -328
- package/build/test/stateless/config-ttl.test.js +0 -149
- package/build/test/stateless/consumed-proxy-code-cache.test.js +0 -150
- package/build/test/stateless/session-id-integration.test.js +0 -675
- package/build/test/stateless/session-id.test.js +0 -157
- package/build/test/streamable-http-concurrent-session.test.js +0 -171
- package/build/test/streamable-http-dns-rebinding.test.js +0 -185
- package/build/test/streamable-http-sse-stream.test.js +0 -350
- package/build/test/streamable-http-static-token-auth.test.js +0 -157
- package/build/test/streamable-http-unauthenticated-discovery.test.js +0 -207
- package/build/test/test-all-transport-server.js +0 -255
- package/build/test/test-auth-retry.js +0 -195
- package/build/test/test-blank-filters.js +0 -156
- package/build/test/test-ci-catalog.js +0 -177
- package/build/test/test-ci-lint.js +0 -191
- package/build/test/test-ci-variables.js +0 -309
- package/build/test/test-create-repository.js +0 -120
- package/build/test/test-dependency-proxy.js +0 -195
- package/build/test/test-deployment-tools.js +0 -463
- package/build/test/test-download-attachment.js +0 -190
- package/build/test/test-dynamic-project-scope.js +0 -524
- package/build/test/test-empty-toolsets.js +0 -535
- package/build/test/test-get-file-blame.js +0 -145
- package/build/test/test-get-file-contents.js +0 -128
- package/build/test/test-geteffectiveprojectid.js +0 -804
- package/build/test/test-health-check.js +0 -115
- package/build/test/test-issue-description-patch.js +0 -256
- package/build/test/test-job-artifacts.js +0 -275
- package/build/test/test-json-schema.js +0 -166
- package/build/test/test-list-group-members.js +0 -150
- package/build/test/test-list-group-merge-requests.js +0 -165
- package/build/test/test-list-issues.js +0 -170
- package/build/test/test-list-merge-requests.js +0 -201
- package/build/test/test-list-milestones.js +0 -145
- package/build/test/test-list-project-members.js +0 -132
- package/build/test/test-merge-request-approval-state-tools.js +0 -213
- package/build/test/test-merge-request-approvals.js +0 -187
- package/build/test/test-merge-request-pipelines.js +0 -106
- package/build/test/test-mr-diffs-filter.js +0 -132
- package/build/test/test-mr-file-diffs.js +0 -251
- package/build/test/test-oauth-proxy-rate-limit.js +0 -133
- package/build/test/test-orbit.js +0 -155
- package/build/test/test-permission-mode.js +0 -424
- package/build/test/test-pipeline-schedules.js +0 -484
- package/build/test/test-protected-branches.js +0 -174
- package/build/test/test-remote-downloads.js +0 -510
- package/build/test/test-search-code.js +0 -275
- package/build/test/test-snippets.js +0 -735
- package/build/test/test-tags.js +0 -220
- package/build/test/test-todos.js +0 -195
- package/build/test/test-token-optimizations.js +0 -691
- package/build/test/test-toolset-filtering.js +0 -499
- package/build/test/test-update-issue-slim.js +0 -141
- package/build/test/test-update-project.js +0 -112
- package/build/test/test-upload-markdown.js +0 -206
- package/build/test/test-vulnerabilities.js +0 -399
- package/build/test/test-webhooks.js +0 -218
- package/build/test/tool-description-quality.test.js +0 -50
- package/build/test/utils/bulk-publish-options.test.js +0 -32
- package/build/test/utils/download-token.test.js +0 -35
- package/build/test/utils/forwarded-public-base-url.test.js +0 -46
- package/build/test/utils/gitlab-instance-version.test.js +0 -32
- package/build/test/utils/gitlab-version-gate.test.js +0 -74
- package/build/test/utils/graphql-query.test.js +0 -168
- package/build/test/utils/helpers-path.test.js +0 -104
- package/build/test/utils/jmespath-tool-result.test.js +0 -91
- package/build/test/utils/masking.test.js +0 -384
- package/build/test/utils/merge-request-position.test.js +0 -57
- package/build/test/utils/mock-gitlab-server.js +0 -614
- package/build/test/utils/proxy-client-ip.test.js +0 -28
- package/build/test/utils/redact-sensitive.test.js +0 -32
- package/build/test/utils/safe-redirect-fetch.test.js +0 -463
- package/build/test/utils/server-launcher.js +0 -231
- package/build/test/utils/tool-args.test.js +0 -210
- package/build/test/utils/url.test.js +0 -141
- package/build/test/utils/version-check.test.js +0 -239
- package/build/test/utils/wiki-title.test.js +0 -21
- package/build/test-note.js +0 -54
- package/build/test-resolve-issue-note.js +0 -127
package/README.ko.md
CHANGED
|
@@ -111,7 +111,7 @@ command = lib.getExe inputs.gitlab-mcp.packages.${system}.default;
|
|
|
111
111
|
|
|
112
112
|
예시는 기존 `mcp-gitlab`보다 충돌 가능성이 낮은 `zereight-mcp-gitlab` 별칭을 사용합니다. MCP 클라이언트가 찾지 못하면 `which zereight-mcp-gitlab`의 절대 경로를 사용하세요.
|
|
113
113
|
|
|
114
|
-
전역 설치를 쓰지 않으려면 `npx -y @zereight/mcp-gitlab@2.1.
|
|
114
|
+
전역 설치를 쓰지 않으려면 `npx -y @zereight/mcp-gitlab@2.1.70`처럼 직전 안정 버전(문서가 권장하는 버전)으로 고정하세요. 항상 최신 버전을 원하면 `npx -y @zereight/mcp-gitlab@latest`를 사용하세요. 새 버전이 나오면 서버가 시작 시 stderr로 알려줍니다(`GITLAB_DISABLE_VERSION_CHECK=true`로 비활성화 가능).
|
|
115
115
|
|
|
116
116
|
#### CLI 인자 사용하기(환경 변수 문제가 있는 클라이언트용)
|
|
117
117
|
|
|
@@ -135,6 +135,8 @@ command = lib.getExe inputs.gitlab-mcp.packages.${system}.default;
|
|
|
135
135
|
- `--api-url` - GitLab API URL (`GITLAB_API_URL` 대체)
|
|
136
136
|
- `--read-only=true` - 읽기 전용 모드 활성화 (`GITLAB_READ_ONLY_MODE` 대체, deprecated — `--permission-mode=readonly` 권장)
|
|
137
137
|
- `--permission-mode` - 권한 수준: `readonly`, `modify`(삭제/중단 도구 비활성), `full` (`GITLAB_PERMISSION_MODE` 대체, 기본값 `full`)
|
|
138
|
+
- `--toolsets=all` - 지정한 툴셋 활성화 (`GITLAB_TOOLSETS` 대체, 미설정 시 lean `core` 기본값 사용)
|
|
139
|
+
- `--tools=list_issues` - 개별 도구 추가 (`GITLAB_TOOLS` 대체)
|
|
138
140
|
- `--use-wiki=true` - 위키 API 활성화 (`USE_GITLAB_WIKI` 대체, 레거시 — `GITLAB_TOOLSETS=wiki` 권장)
|
|
139
141
|
- `--use-milestone=true` - 마일스톤 API 활성화 (`USE_MILESTONE` 대체, 레거시 — `GITLAB_TOOLSETS=milestones` 권장)
|
|
140
142
|
- `--use-pipeline=true` - 파이프라인 API 활성화 (`USE_PIPELINE` 대체, 레거시 — `GITLAB_TOOLSETS=pipelines` 권장)
|
package/README.md
CHANGED
|
@@ -116,7 +116,7 @@ The store path is pinned by your lock file; update it with `nix flake update git
|
|
|
116
116
|
|
|
117
117
|
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`.
|
|
118
118
|
|
|
119
|
-
No global install? Pin `npx` to the previous stable release (the version these docs recommend), for example `npx -y @zereight/mcp-gitlab@2.1.
|
|
119
|
+
No global install? Pin `npx` to the previous stable release (the version these docs recommend), for example `npx -y @zereight/mcp-gitlab@2.1.70`. If you always want the newest release, use `npx -y @zereight/mcp-gitlab@latest` instead. The server prints a notice to stderr on startup when a newer version is available (disable with `GITLAB_DISABLE_VERSION_CHECK=true`).
|
|
120
120
|
|
|
121
121
|
#### Using CLI Arguments (for clients with env var issues)
|
|
122
122
|
|
|
@@ -140,6 +140,8 @@ Some MCP clients (like GitHub Copilot CLI) have issues with environment variable
|
|
|
140
140
|
- `--api-url` - GitLab API URL (replaces `GITLAB_API_URL`)
|
|
141
141
|
- `--read-only=true` - Enable read-only mode (replaces `GITLAB_READ_ONLY_MODE`, deprecated — prefer `--permission-mode=readonly`)
|
|
142
142
|
- `--permission-mode` - Permission level: `readonly`, `modify` (no delete or teardown tools), or `full` (replaces `GITLAB_PERMISSION_MODE`, default `full`)
|
|
143
|
+
- `--toolsets=all` - Enable named toolsets (replaces `GITLAB_TOOLSETS`; unset uses the lean `core` default)
|
|
144
|
+
- `--tools=list_issues` - Add individual tools (replaces `GITLAB_TOOLS`)
|
|
143
145
|
- `--use-wiki=true` - Enable wiki API (replaces `USE_GITLAB_WIKI`, legacy — prefer `GITLAB_TOOLSETS=wiki`)
|
|
144
146
|
- `--use-milestone=true` - Enable milestone API (replaces `USE_MILESTONE`, legacy — prefer `GITLAB_TOOLSETS=milestones`)
|
|
145
147
|
- `--use-pipeline=true` - Enable pipeline API (replaces `USE_PIPELINE`, legacy — prefer `GITLAB_TOOLSETS=pipelines`)
|
|
@@ -150,6 +152,8 @@ Some MCP clients (like GitHub Copilot CLI) have issues with environment variable
|
|
|
150
152
|
- `--masking-workspace-dir` - Directory used to resolve masking files (replaces `GITLAB_MASKING_WORKSPACE_DIR`)
|
|
151
153
|
- `--compact-results=true` - Truncate oversized MCP tool replies and attach a CLI command for the full payload (replaces `GITLAB_MCP_COMPACT_RESULTS`; default off)
|
|
152
154
|
- `--compact-result-chars` - Character threshold for compacting (replaces `GITLAB_MCP_COMPACT_RESULT_CHARS`; default `4000`)
|
|
155
|
+
- `--compact-tools` - Comma-separated tool names to compact when oversized, without turning global compact on (replaces `GITLAB_MCP_COMPACT_TOOLS`)
|
|
156
|
+
- `--tool-profile` - `full` (default) or `slim`. `slim` drops draft notes, emoji reactions, labels, CI catalog tools, and `create_group` from the initial list. Ignored when `GITLAB_TOOLSETS` is set (replaces `GITLAB_TOOL_PROFILE`)
|
|
153
157
|
|
|
154
158
|
CLI arguments take precedence over environment variables.
|
|
155
159
|
|
|
@@ -675,7 +679,7 @@ Register the skill directory in your AI client to get optimal tool usage guidanc
|
|
|
675
679
|
68. `delete_issue_note_emoji_reaction` - Remove an emoji reaction from an issue note. Pass discussion_id for discussion thread replies.
|
|
676
680
|
69. `list_issues` - List issues (default: created by current user; use scope='all' for all)
|
|
677
681
|
70. `my_issues` - List issues assigned to the authenticated user
|
|
678
|
-
71. `get_issue` - Get details of a specific issue. Returns a slim milestone by default; set full_response=true for the complete milestone object
|
|
682
|
+
71. `get_issue` - Get details of a specific issue. Returns the issue with a slim nested milestone by default; set full_response=true for the complete milestone object
|
|
679
683
|
72. `update_issue` - Update an issue. Returns a slim confirmation by default; set full_response=true for the complete updated issue object
|
|
680
684
|
73. `update_issue_description_patch` - Apply a patch (search/replace or unified diff) to an issue description. Reduces token usage by allowing small changes without sending the full description. Supports dry_run to preview changes and create_note to summarize updates.
|
|
681
685
|
74. `delete_issue` - Delete an issue
|
package/README.pt-BR.md
CHANGED
|
@@ -111,7 +111,7 @@ O caminho no store é fixado pelo seu lock file; atualize-o com `nix flake updat
|
|
|
111
111
|
|
|
112
112
|
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`.
|
|
113
113
|
|
|
114
|
-
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.1.
|
|
114
|
+
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.1.70`. Se quiser sempre a versão mais recente, use `npx -y @zereight/mcp-gitlab@latest`. 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`).
|
|
115
115
|
|
|
116
116
|
#### Usando argumentos de CLI (para clientes com problemas com variáveis de ambiente)
|
|
117
117
|
|
package/README.zh-CN.md
CHANGED
|
@@ -111,7 +111,7 @@ command = lib.getExe inputs.gitlab-mcp.packages.${system}.default;
|
|
|
111
111
|
|
|
112
112
|
示例使用 `zereight-mcp-gitlab`,这是比旧的 `mcp-gitlab` 更不容易冲突的别名。如果 MCP 客户端找不到它,请使用 `which zereight-mcp-gitlab` 输出的绝对路径。
|
|
113
113
|
|
|
114
|
-
如果不想全局安装,请将 `npx` 固定到上一个稳定版本(即文档推荐的版本),例如 `npx -y @zereight/mcp-gitlab@2.1.
|
|
114
|
+
如果不想全局安装,请将 `npx` 固定到上一个稳定版本(即文档推荐的版本),例如 `npx -y @zereight/mcp-gitlab@2.1.70`。如果始终想使用最新版本,请改用 `npx -y @zereight/mcp-gitlab@latest`。有新版本发布时,服务器会在启动时通过 stderr 提示(可用 `GITLAB_DISABLE_VERSION_CHECK=true` 关闭)。
|
|
115
115
|
|
|
116
116
|
#### 使用 CLI 参数(适用于环境变量有问题的客户端)
|
|
117
117
|
|
|
@@ -135,6 +135,8 @@ command = lib.getExe inputs.gitlab-mcp.packages.${system}.default;
|
|
|
135
135
|
- `--api-url` - GitLab API URL(替代 `GITLAB_API_URL`)
|
|
136
136
|
- `--read-only=true` - 启用只读模式(替代 `GITLAB_READ_ONLY_MODE`,已弃用 — 推荐 `--permission-mode=readonly`)
|
|
137
137
|
- `--permission-mode` - 权限级别:`readonly`、`modify`(禁用删除/拆除工具)或 `full`(替代 `GITLAB_PERMISSION_MODE`,默认 `full`)
|
|
138
|
+
- `--toolsets=all` - 启用指定工具集(替代 `GITLAB_TOOLSETS`;未设置时使用精简 `core` 默认值)
|
|
139
|
+
- `--tools=list_issues` - 添加单个工具(替代 `GITLAB_TOOLS`)
|
|
138
140
|
- `--use-wiki=true` - 启用 Wiki API(替代 `USE_GITLAB_WIKI`,旧版 — 推荐 `GITLAB_TOOLSETS=wiki`)
|
|
139
141
|
- `--use-milestone=true` - 启用里程碑 API(替代 `USE_MILESTONE`,旧版 — 推荐 `GITLAB_TOOLSETS=milestones`)
|
|
140
142
|
- `--use-pipeline=true` - 启用流水线 API(替代 `USE_PIPELINE`,旧版 — 推荐 `GITLAB_TOOLSETS=pipelines`)
|
package/build/config.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { BOOLEAN_CLI_FLAG_NAMES, nextBooleanFlagValue } from "./cli-boolean-flags.js";
|
|
2
|
+
import { parseToolProfile } from "./tools/tool-profile.js";
|
|
3
|
+
import { parseCompactToolAllowlist } from "./utils/compact-tool-allowlist.js";
|
|
2
4
|
// Parse CLI arguments before anything else
|
|
3
5
|
const args = process.argv.slice(2);
|
|
4
6
|
export const cliArgs = {};
|
|
@@ -51,8 +53,9 @@ export const GITLAB_MASKING_CONFIG = getConfig("masking-config", "GITLAB_MASKING
|
|
|
51
53
|
export const GITLAB_MASKING_POLICY_FILE = getConfig("masking-policy-file", "GITLAB_MASKING_POLICY_FILE");
|
|
52
54
|
export const GITLAB_MASKING_WORKSPACE_DIR = getConfig("masking-workspace-dir", "GITLAB_MASKING_WORKSPACE_DIR");
|
|
53
55
|
const PERMISSION_MODES = ["readonly", "modify", "full"];
|
|
56
|
+
export const GITLAB_PERMISSION_MODE_RAW = getConfig("permission-mode", "GITLAB_PERMISSION_MODE");
|
|
54
57
|
export const GITLAB_PERMISSION_MODE = (() => {
|
|
55
|
-
const raw =
|
|
58
|
+
const raw = GITLAB_PERMISSION_MODE_RAW;
|
|
56
59
|
if (raw !== undefined && !PERMISSION_MODES.includes(raw)) {
|
|
57
60
|
throw new Error(`Invalid GITLAB_PERMISSION_MODE: "${raw}". Expected one of: ${PERMISSION_MODES.join(", ")}`);
|
|
58
61
|
}
|
|
@@ -62,15 +65,19 @@ export const GITLAB_PERMISSION_MODE = (() => {
|
|
|
62
65
|
}
|
|
63
66
|
return raw ?? "full";
|
|
64
67
|
})();
|
|
65
|
-
export const
|
|
66
|
-
export const
|
|
67
|
-
export const
|
|
68
|
+
export const USE_GITLAB_WIKI_RAW = getConfig("use-wiki", "USE_GITLAB_WIKI");
|
|
69
|
+
export const USE_GITLAB_WIKI = USE_GITLAB_WIKI_RAW === "true";
|
|
70
|
+
export const USE_MILESTONE_RAW = getConfig("use-milestone", "USE_MILESTONE");
|
|
71
|
+
export const USE_MILESTONE = USE_MILESTONE_RAW === "true";
|
|
72
|
+
export const USE_PIPELINE_RAW = getConfig("use-pipeline", "USE_PIPELINE");
|
|
73
|
+
export const USE_PIPELINE = USE_PIPELINE_RAW === "true";
|
|
68
74
|
export const GITLAB_DISABLE_VERSION_CHECK = getConfig("disable-version-check", "GITLAB_DISABLE_VERSION_CHECK") === "true";
|
|
69
75
|
// ---------------------------------------------------------------------------
|
|
70
76
|
// Tool filtering
|
|
71
77
|
// ---------------------------------------------------------------------------
|
|
72
78
|
export const GITLAB_TOOLSETS_RAW = getConfig("toolsets", "GITLAB_TOOLSETS");
|
|
73
79
|
export const GITLAB_TOOLS_RAW = getConfig("tools", "GITLAB_TOOLS");
|
|
80
|
+
export const GITLAB_TOOL_PROFILE = parseToolProfile(getConfig("tool-profile", "GITLAB_TOOL_PROFILE"));
|
|
74
81
|
// Tool policy: comma-separated tool names
|
|
75
82
|
// approve = exposed but requires confirmation; hidden = not exposed at all
|
|
76
83
|
export const GITLAB_TOOL_POLICY_APPROVE_RAW = getConfig("tool-policy-approve", "GITLAB_TOOL_POLICY_APPROVE");
|
|
@@ -185,6 +192,7 @@ const _PORT_DEFAULT = 3002;
|
|
|
185
192
|
export const PORT = _intEnv("PORT", "port", _PORT_DEFAULT);
|
|
186
193
|
/** When true, oversized MCP tool replies are replaced with a preview plus a CLI replay command. */
|
|
187
194
|
export const GITLAB_MCP_COMPACT_RESULTS = getConfig("compact-results", "GITLAB_MCP_COMPACT_RESULTS") === "true";
|
|
195
|
+
export const GITLAB_MCP_COMPACT_TOOL_NAMES = parseCompactToolAllowlist(getConfig("compact-tools", "GITLAB_MCP_COMPACT_TOOLS"));
|
|
188
196
|
export const GITLAB_MCP_COMPACT_RESULT_CHARS = _intEnv("GITLAB_MCP_COMPACT_RESULT_CHARS", "compact-result-chars", 4000);
|
|
189
197
|
// ---------------------------------------------------------------------------
|
|
190
198
|
// Proxy configuration
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
function shownEnvValue(rawValue) {
|
|
2
|
+
const singleLine = rawValue.replace(/[\r\n]/g, " ");
|
|
3
|
+
if (singleLine.length <= 80) {
|
|
4
|
+
return singleLine;
|
|
5
|
+
}
|
|
6
|
+
return `${singleLine.slice(0, 77)}...`;
|
|
7
|
+
}
|
|
8
|
+
function legacyToolsetWarning(envName, rawValue, toolset) {
|
|
9
|
+
if (rawValue === "true") {
|
|
10
|
+
return (`${envName} is deprecated and will be removed in the next major version. ` +
|
|
11
|
+
`Use GITLAB_TOOLSETS=${toolset} instead.`);
|
|
12
|
+
}
|
|
13
|
+
const shown = shownEnvValue(rawValue);
|
|
14
|
+
return (`${envName} is set to "${shown}" and is deprecated. ` +
|
|
15
|
+
`This value does not enable the ${toolset} toolset. Remove it. ` +
|
|
16
|
+
`Set GITLAB_TOOLSETS=${toolset} only if you want those tools enabled.`);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Builds startup warnings for deprecated env vars / CLI flags.
|
|
20
|
+
* Pure function so the messages and conflict detection are unit-testable.
|
|
21
|
+
*/
|
|
22
|
+
export function getDeprecatedEnvWarnings(input) {
|
|
23
|
+
const warnings = [];
|
|
24
|
+
if (input.readOnlyMode) {
|
|
25
|
+
const conflict = input.permissionModeRaw !== undefined && input.permissionModeRaw !== "readonly"
|
|
26
|
+
? ` It OVERRIDES the configured permission mode "${input.permissionModeRaw}"; the server runs as "readonly".`
|
|
27
|
+
: "";
|
|
28
|
+
warnings.push("GITLAB_READ_ONLY_MODE is deprecated and will be removed in the next major version. " +
|
|
29
|
+
`Use GITLAB_PERMISSION_MODE=readonly or --permission-mode=readonly instead.${conflict}`);
|
|
30
|
+
}
|
|
31
|
+
if (input.allowedGroupsRaw) {
|
|
32
|
+
warnings.push(input.oauthAllowedGroupsRaw
|
|
33
|
+
? "GITLAB_ALLOWED_GROUPS is deprecated and ignored because GITLAB_OAUTH_ALLOWED_GROUPS is set. Remove it."
|
|
34
|
+
: "GITLAB_ALLOWED_GROUPS is deprecated and will be removed in the next major version. Use GITLAB_OAUTH_ALLOWED_GROUPS instead.");
|
|
35
|
+
}
|
|
36
|
+
const legacyToolsetFlags = [
|
|
37
|
+
[input.useWikiRaw, "USE_GITLAB_WIKI", "wiki"],
|
|
38
|
+
[input.useMilestoneRaw, "USE_MILESTONE", "milestones"],
|
|
39
|
+
[input.usePipelineRaw, "USE_PIPELINE", "pipelines"],
|
|
40
|
+
];
|
|
41
|
+
for (const [rawValue, envName, toolset] of legacyToolsetFlags) {
|
|
42
|
+
if (rawValue !== undefined) {
|
|
43
|
+
warnings.push(legacyToolsetWarning(envName, rawValue, toolset));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return warnings;
|
|
47
|
+
}
|