@zereight/mcp-gitlab 2.1.69 → 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 +10 -4
- package/README.md +238 -233
- package/README.pt-BR.md +4 -4
- package/README.zh-CN.md +6 -4
- package/build/config.js +12 -4
- package/build/deprecated-env.js +47 -0
- package/build/index.js +456 -237
- 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/build/utils/url.js +15 -0
- 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/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-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-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 -812
- 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 -482
- 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 -128
- 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.pt-BR.md
CHANGED
|
@@ -17,7 +17,7 @@ Suporta PAT, OAuth, modo somente leitura, URLs de API dinâmicas e autorização
|
|
|
17
17
|
|
|
18
18
|
### Por que usar este GitLab MCP?
|
|
19
19
|
|
|
20
|
-
- **
|
|
20
|
+
- **267 ferramentas + `discover_tools`** — comece com um toolset pequeno e ative mais categorias em tempo de execução
|
|
21
21
|
- **Revisão de MR em 2 etapas** — `list_merge_request_changed_files` → `get_merge_request_file_diff` em lote
|
|
22
22
|
- **Agent Skill integrado** — orientação de workflows em `skills/gitlab-mcp/`
|
|
23
23
|
- **Autenticação flexível** — Personal Access Token, fluxo OAuth2 local no navegador, proxy MCP OAuth e autorização remota por requisição
|
|
@@ -31,7 +31,7 @@ Suporta PAT, OAuth, modo somente leitura, URLs de API dinâmicas e autorização
|
|
|
31
31
|
| | @zereight/mcp-gitlab | GitLab MCP A (comunidade, estilo CQRS) |
|
|
32
32
|
| ------------------------- | ---------------------------------------------- | --------------------------------------------------------- |
|
|
33
33
|
| **Mais indicado para** | Workflows de agentes de IA | Múltiplas instâncias corporativas / ferramentas agrupadas |
|
|
34
|
-
| **Modelo de ferramentas** | ~
|
|
34
|
+
| **Modelo de ferramentas** | ~267 ferramentas granulares + `discover_tools` | ~50–60 ferramentas agrupadas `browse_*` / `manage_*` |
|
|
35
35
|
| **Revisão de MR** | Diff em lote em 2 etapas | Varia |
|
|
36
36
|
| **Node.js** | >=18.17 | Frequentemente >=24 |
|
|
37
37
|
| **Licença** | MIT | Varia |
|
|
@@ -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
|
|
|
@@ -150,7 +150,7 @@ Os argumentos de CLI têm precedência sobre as variáveis de ambiente.
|
|
|
150
150
|
|
|
151
151
|
`zereight-mcp-gitlab auth` é um subcomando, não uma flag do servidor MCP. Ele executa o device flow do GitLab e encerra. Veja [Argumentos de CLI](./docs/getting-started/cli-arguments.md#auth).
|
|
152
152
|
|
|
153
|
-
O mesmo binário também é uma CLI do GitLab no estilo `gh` (`tool <name>` ou formas curadas como `mr list`). Use-o para ver a carga completa no terminal. As respostas do MCP permanecem no chat, a menos que você defina `GITLAB_MCP_COMPACT_RESULTS=true` (ou `--compact-results`), o que substitui respostas grandes de ferramentas por uma prévia e um comando CLI. A CLI humana nunca é compactada. Os mesmos filtros de permission mode, toolsets, denied-tools regex e tool-policy se aplicam. Ferramentas destrutivas e ferramentas com `GITLAB_TOOL_POLICY_APPROVE` exigem `--yes`. Consulte [CLI Humana](./docs/getting-started/cli-arguments.md#human-cli).
|
|
153
|
+
O mesmo binário também é uma CLI do GitLab no estilo `gh` (`tool <name>` ou formas curadas como `mr list`). **Não é necessário registrar o MCP** — defina um PAT, ou execute `auth` e defina `GITLAB_USE_OAUTH=true`: veja [CLI sem MCP](./docs/getting-started/cli-without-mcp.md). Use-o para ver a carga completa no terminal. As respostas do MCP permanecem no chat, a menos que você defina `GITLAB_MCP_COMPACT_RESULTS=true` (ou `--compact-results`), o que substitui respostas grandes de ferramentas por uma prévia e um comando CLI. A CLI humana nunca é compactada. Os mesmos filtros de permission mode, toolsets, denied-tools regex e tool-policy se aplicam. Ferramentas destrutivas e ferramentas com `GITLAB_TOOL_POLICY_APPROVE` exigem `--yes`. Consulte [CLI Humana](./docs/getting-started/cli-arguments.md#human-cli).
|
|
154
154
|
|
|
155
155
|
> **Filtragem granular de ferramentas:** use `GITLAB_PERMISSION_MODE=modify` para permitir criação/atualização enquanto
|
|
156
156
|
> bloqueia todas as ferramentas de exclusão e as ferramentas destrutivas de teardown (`cancel_pipeline`,
|
package/README.zh-CN.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
### 为什么使用这个 GitLab MCP?
|
|
19
19
|
|
|
20
|
-
- **
|
|
20
|
+
- **267 个工具 + `discover_tools`** — 从小型 toolset 开始,运行时按需激活类别
|
|
21
21
|
- **MR 两步审查** — `list_merge_request_changed_files` → 批量 `get_merge_request_file_diff`
|
|
22
22
|
- **内置 Agent Skill** — `skills/gitlab-mcp/` 工作流指南
|
|
23
23
|
- **认证灵活** — Personal Access Token、本地 OAuth2 浏览器流程、MCP OAuth 代理、按请求远程授权
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
| | @zereight/mcp-gitlab | GitLab MCP A(社区 CQRS 型) |
|
|
32
32
|
|---|----------------------|------------------------------|
|
|
33
33
|
| **更适合** | AI 代理工作流 | 企业多实例 / 分组工具 |
|
|
34
|
-
| **工具模型** | ~
|
|
34
|
+
| **工具模型** | ~267 个细粒度工具 + `discover_tools` | ~50–60 个 `browse_*` / `manage_*` 分组工具 |
|
|
35
35
|
| **MR 审查** | 两步批量 diff | 因服务器而异 |
|
|
36
36
|
| **Node.js** | >=18.17 | 通常 >=24 |
|
|
37
37
|
| **许可证** | MIT | 因服务器而异 |
|
|
@@ -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`)
|
|
@@ -150,7 +152,7 @@ CLI 参数优先于环境变量。
|
|
|
150
152
|
|
|
151
153
|
`zereight-mcp-gitlab auth` 是子命令,不是 MCP 服务器参数。它运行 GitLab device flow 后退出。参见 [CLI 参数](./docs/getting-started/cli-arguments.md#auth)。
|
|
152
154
|
|
|
153
|
-
同一二进制也是 `gh` 风格的 GitLab CLI(`tool <name>`,或 `mr list` 这类 curated
|
|
155
|
+
同一二进制也是 `gh` 风格的 GitLab CLI(`tool <name>`,或 `mr list` 这类 curated 命令)。**无需注册 MCP**——设置 PAT,或运行 `auth` 后设置 `GITLAB_USE_OAUTH=true`:参见 [无需 MCP 使用 CLI](./docs/getting-started/cli-without-mcp.md)。完整结果在终端用 CLI 查看。MCP 回复仍进入对话。设置 `GITLAB_MCP_COMPACT_RESULTS=true`(或 `--compact-results`)后,过大的工具回复会变成预览加上 CLI 命令。Human CLI 本身不会被 compact。permission mode、toolsets、denied-tools regex 和 tool-policy 与 MCP 相同。破坏性工具以及 `GITLAB_TOOL_POLICY_APPROVE` 工具需要 `--yes`。参见 [Human CLI](./docs/getting-started/cli-arguments.md#human-cli)。
|
|
154
156
|
|
|
155
157
|
> **细粒度工具过滤:**使用 `GITLAB_PERMISSION_MODE=modify` 允许创建/更新,同时阻止所有删除工具以及
|
|
156
158
|
> 破坏性的拆除(teardown)工具(`cancel_pipeline`、`cancel_pipeline_job`、`stop_environment`、
|
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
|
+
}
|