mcp-gitlab 0.25.1__tar.gz → 0.26.0__tar.gz
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.
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.claude-plugin/plugin.json +1 -1
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.copier-answers.yml +1 -1
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.github/workflows/link-check.yml +1 -1
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.github/workflows/lint.yml +1 -1
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.github/workflows/publish.yml +2 -2
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.github/workflows/reconcile.yml +1 -1
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.github/workflows/release.yml +1 -1
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.github/workflows/tests.yml +1 -1
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.mcp.json +1 -1
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/AGENTS.md +21 -5
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/CHANGELOG.md +25 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/Dockerfile +1 -1
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/PKG-INFO +30 -5
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/README.md +29 -4
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/gemini-extension.json +14 -2
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/llms-full.txt +1 -1
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/llms.txt +1 -1
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/pyproject.toml +1 -1
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/server.json +31 -3
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/__init__.py +25 -1
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/servers/gitlab.py +90 -14
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/conftest.py +2 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/unit/test_tools.py +12 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/unit/test_toolsets.py +173 -3
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/uv.lock +153 -168
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.dockerignore +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.env.example +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.github/conformance-baseline.yml +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.github/conformance-env +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.github/dependabot.yml +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/.gitignore +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/LICENSE +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/assets/icon.svg +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/docs/oauth.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/docs/specs/2026-09-21-test-confidence-and-error-contract.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/evaluations/eval.xml +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/glama.json +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/ruff.toml +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/__main__.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/client.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/config.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/exceptions.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/local_auth.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/oauth.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/py.typed +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/resources/approval-workflow.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/resources/code-review.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/resources/codeowners.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/resources/conventional-commits.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/resources/git-workflow.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/resources/gitlab-ci.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/resources/mr-hygiene.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/resources/prompts/approve-mr.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/resources/prompts/diagnose-pipeline.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/resources/prompts/prepare-release.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/resources/prompts/review-mr.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/resources/prompts/setup-branch-protection.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/resources/prompts/triage-issues.md +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/servers/__init__.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/servers/_helpers.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/servers/prompts.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/src/mcp_gitlab/servers/resources.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/__init__.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/test_links.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/unit/__init__.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/unit/test_cli.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/unit/test_client.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/unit/test_config.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/unit/test_exceptions.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/unit/test_health.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/unit/test_local_auth.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/unit/test_oauth.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/unit/test_oauth_http.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/unit/test_prompts.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/unit/test_read_only_lock.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/unit/test_resources.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/unit/test_server_assembly.py +0 -0
- {mcp_gitlab-0.25.1 → mcp_gitlab-0.26.0}/tests/unit/test_tool_contract.py +0 -0
|
@@ -30,7 +30,7 @@ permissions: {}
|
|
|
30
30
|
|
|
31
31
|
jobs:
|
|
32
32
|
prepare:
|
|
33
|
-
uses: vish288/.github/.github/workflows/publish-prepare.yml@
|
|
33
|
+
uses: vish288/.github/.github/workflows/publish-prepare.yml@565176949ef5dbf6d5dbeadf6a020b2df9c393cb # v1.6.3
|
|
34
34
|
with:
|
|
35
35
|
dry_run: ${{ inputs.dry_run }}
|
|
36
36
|
permissions:
|
|
@@ -68,7 +68,7 @@ jobs:
|
|
|
68
68
|
finish:
|
|
69
69
|
needs: [prepare, pypi]
|
|
70
70
|
if: ${{ !cancelled() && !inputs.dry_run && (needs.prepare.outputs.pypi == 'done' || needs.pypi.result == 'success') }}
|
|
71
|
-
uses: vish288/.github/.github/workflows/publish-finish.yml@
|
|
71
|
+
uses: vish288/.github/.github/workflows/publish-finish.yml@565176949ef5dbf6d5dbeadf6a020b2df9c393cb # v1.6.3
|
|
72
72
|
with:
|
|
73
73
|
dry_run: ${{ inputs.dry_run }}
|
|
74
74
|
fail_at: ${{ inputs.fail_at }}
|
|
@@ -9,7 +9,7 @@ on:
|
|
|
9
9
|
workflow_dispatch:
|
|
10
10
|
jobs:
|
|
11
11
|
reconcile:
|
|
12
|
-
uses: vish288/.github/.github/workflows/reconcile.yml@
|
|
12
|
+
uses: vish288/.github/.github/workflows/reconcile.yml@565176949ef5dbf6d5dbeadf6a020b2df9c393cb # v1.6.3
|
|
13
13
|
permissions:
|
|
14
14
|
contents: read
|
|
15
15
|
actions: write
|
|
@@ -27,7 +27,7 @@ on:
|
|
|
27
27
|
default: none
|
|
28
28
|
jobs:
|
|
29
29
|
release:
|
|
30
|
-
uses: vish288/.github/.github/workflows/release.yml@
|
|
30
|
+
uses: vish288/.github/.github/workflows/release.yml@565176949ef5dbf6d5dbeadf6a020b2df9c393cb # v1.6.3
|
|
31
31
|
with:
|
|
32
32
|
bump: ${{ inputs.bump }}
|
|
33
33
|
version: ${{ inputs.version }}
|
|
@@ -5,7 +5,7 @@ permissions:
|
|
|
5
5
|
contents: read
|
|
6
6
|
jobs:
|
|
7
7
|
test:
|
|
8
|
-
uses: vish288/.github/.github/workflows/tests.yml@
|
|
8
|
+
uses: vish288/.github/.github/workflows/tests.yml@565176949ef5dbf6d5dbeadf6a020b2df9c393cb # v1.6.3
|
|
9
9
|
with:
|
|
10
10
|
coverage_min: 98
|
|
11
11
|
service: mcp-gitlab
|
|
@@ -13,7 +13,9 @@ clients. Built on FastMCP 4.x and the MCP Python SDK 2.x. Verified over `stdio`
|
|
|
13
13
|
Transports: `stdio` (default), `streamable-http` (recommended for remote), and `sse`. The
|
|
14
14
|
2026-07-28 specification deprecates `sse`, so the server prints a warning when you use it. The
|
|
15
15
|
server uses no roots, sampling, logging, elicitation, or resource subscriptions, so the
|
|
16
|
-
2026-07-28 deprecations do not affect it.
|
|
16
|
+
2026-07-28 deprecations do not affect it. The server disables `subscriptions/listen` and advertises
|
|
17
|
+
`listChanged` and `resources.subscribe` as false, because its tool, prompt, and resource lists never
|
|
18
|
+
change after startup.
|
|
17
19
|
|
|
18
20
|
Authorization: with `--auth oauth` (streamable-http only) the server is an MCP 2026-07-28 resource
|
|
19
21
|
server and OAuth proxy in front of GitLab (RFC 9728 PRM, RFC 8414 AS metadata, PKCE S256, per-user
|
|
@@ -42,7 +44,7 @@ emits OpenTelemetry spans for `tools/call` and propagates trace context by defau
|
|
|
42
44
|
- **Local sign-in**: `src/mcp_gitlab/local_auth.py` — device and PKCE flows, credentials file, refresh under lock; used when no env token is set
|
|
43
45
|
- **OAuth**: `src/mcp_gitlab/oauth.py` — `GitLabProvider` (a fastmcp `OAuthProxy` in front of GitLab) and `GitLabTokenVerifier` (validates a GitLab OAuth token via `GET /oauth/token/info`). Only used when `--auth oauth`
|
|
44
46
|
- **Exceptions**: `src/mcp_gitlab/exceptions.py` — `GitLabError` base; `GitLabApiError`, `GitLabAuthError`, `GitLabNotFoundError`, `GitLabRateLimitError` (with `retry_after`), `GitLabTimeoutError`, `GitLabConnectionError`, `GitLabWriteDisabledError`
|
|
45
|
-
- **Tests**: `tests/` — `unit/test_tools.py` (
|
|
47
|
+
- **Tests**: `tests/` — `unit/test_tools.py` (tool-level tests via the FastMCP in-memory client; the test count is whatever `uv run pytest -q` reports), plus `test_client.py`, `test_config.py`, `test_local_auth.py`, `test_exceptions.py`, `test_prompts.py`, `test_resources.py`, and `tests/test_links.py`. Shared fixtures (`config`, `client`, `mock_api` via respx) live in `tests/conftest.py`
|
|
46
48
|
|
|
47
49
|
## Development
|
|
48
50
|
|
|
@@ -110,9 +112,11 @@ sources (any locking one wins; a falsy value never unlocks and logs a WARNING; a
|
|
|
110
112
|
value fails closed), and the lifespan calls `_lock_read_only(server)`, which
|
|
111
113
|
`server.disable(tags={"write"})` so write tools and write-workflow prompts drop out of
|
|
112
114
|
`tools/list`/`prompts/list` and `tools/call` on them returns "Unknown tool". The lock is
|
|
113
|
-
computed once and never cleared; the only `enable` call in `src/` is the `MCP_TOOLSETS`
|
|
115
|
+
computed once and never cleared; the only `enable` call in `src/` is the `MCP_TOOLSETS` / `MCP_TOOLS`
|
|
114
116
|
allowlist (`_apply_toolsets`), which runs before the lock and never names the `write` tag, so
|
|
115
|
-
the lock stays the last word.
|
|
117
|
+
the lock stays the last word. `_lock_read_only` appends its `disable` on every lifespan entry
|
|
118
|
+
(only the instructions sentence is added once), so a re-entered lifespan keeps the lock after the
|
|
119
|
+
fresh allowlist. The lock is unconditional on auth mode (oauth also hides by
|
|
116
120
|
tag); the per-user `read_api` scope refusal in `_check_write` stays call-time. Every write
|
|
117
121
|
tool MUST still call `_check_write(ctx)` (via `@tool_result(write=True)`, or inline as
|
|
118
122
|
`gitlab_merge_mr_sequence` does) as defence in depth.
|
|
@@ -172,6 +176,16 @@ asserts every raw domain tag belongs to exactly one group and only those five to
|
|
|
172
176
|
`review,ci` (46) and `code,review` (40) reach or pass Cursor's 40-tool warning; every single group
|
|
173
177
|
stays under it.
|
|
174
178
|
|
|
179
|
+
`MCP_TOOLS` / `--tools` (include) and `MCP_EXCLUDE_TOOLS` / `--exclude-tools` (exclude) filter by
|
|
180
|
+
tool name, exactly as in `tools/list` (comma-separated, whitespace ignored, case-sensitive; unset
|
|
181
|
+
or empty means no filtering). Order: the `MCP_TOOLSETS` allowlist, intersected with `MCP_TOOLS`
|
|
182
|
+
(one `enable(tags=..., names=..., only=True)` carries both criteria), then `disable(names=...)` for
|
|
183
|
+
`MCP_EXCLUDE_TOOLS`, then the read-only lock. All of it lives in `_apply_toolsets`.
|
|
184
|
+
`validate_tool_selection` (CLI before `run_async`, and the lifespan) rejects an unknown name in
|
|
185
|
+
either list and a selection that leaves no tool listed, counting the read-only lock; both exit 2
|
|
186
|
+
(`ToolSelectionError`). A valid name already removed by the toolsets or read-only selection is
|
|
187
|
+
not an error. With both variables unset the server is untouched.
|
|
188
|
+
|
|
175
189
|
## Common Workflows
|
|
176
190
|
|
|
177
191
|
- **Code review**: `gitlab_list_mrs` → `gitlab_mr_changes` → `gitlab_list_mr_discussions` → `gitlab_add_mr_note` or `gitlab_create_mr_discussion` → `gitlab_resolve_discussion`
|
|
@@ -206,6 +220,8 @@ plus an assistant acknowledgment.
|
|
|
206
220
|
| `GITLAB_READ_ONLY` | no | `false` | Truthy (or unrecognised) locks the server read-only: the write tools are not listed and are refused before any API call |
|
|
207
221
|
| `MCP_READ_ONLY` | no | `false` | Same as `GITLAB_READ_ONLY`; shared name across the mcp-* servers. Either being truthy locks read-only, and nothing turns it off at runtime |
|
|
208
222
|
| `MCP_TOOLSETS` | no | all | Comma list of tool groups (`code`, `review`, `ci`, `issues`, `release`, `admin`); unset or `all` lists every tool. Validated at startup (unknown name exits 2); `MCP_READ_ONLY` applies after the selection |
|
|
223
|
+
| `MCP_TOOLS` | no | all | Comma list of tool names to keep, as in `tools/list`; narrows the `MCP_TOOLSETS` selection. Unknown name exits 2 |
|
|
224
|
+
| `MCP_EXCLUDE_TOOLS` | no | none | Comma list of tool names to drop, applied after `MCP_TOOLSETS` and `MCP_TOOLS`. Unknown name, or a selection that leaves no tools, exits 2 |
|
|
209
225
|
| `GITLAB_TIMEOUT` | no | `30` | Request timeout in seconds |
|
|
210
226
|
| `GITLAB_SSL_VERIFY` | no | `true` | `false`/`0`/`no` skips verification — self-signed certs only |
|
|
211
227
|
| `GITLAB_AUTH` | no | `token` | `token` (PAT from env) or `oauth` (OAuth 2.1 proxy to GitLab; `streamable-http` only) |
|
|
@@ -222,7 +238,7 @@ The server reads the token from the first of `GITLAB_TOKEN`, `GITLAB_PAT`,
|
|
|
222
238
|
`read_api` for read-only deployments. The server never persists an env token. Stored OAuth
|
|
223
239
|
credentials live in `~/.config/mcp-gitlab/credentials.json`.
|
|
224
240
|
|
|
225
|
-
CLI flags override env: `--gitlab-url`, `--read-only`, `--toolsets`, plus
|
|
241
|
+
CLI flags override env: `--gitlab-url`, `--read-only`, `--toolsets`, `--tools`, `--exclude-tools`, plus
|
|
226
242
|
`--transport {stdio,sse,streamable-http}` with `--host` (default `127.0.0.1`) and `--port`
|
|
227
243
|
(default `8000`); host/port apply only to non-stdio transports (`--gitlab-token` is deprecated
|
|
228
244
|
and hidden from `--help`; it still works and warns on stderr — set `GITLAB_TOKEN` instead). The
|
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.26.0] - 2026-12-02
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
- feat(config): filter tools by name with MCP_TOOLS and MCP_EXCLUDE_TOOLS (bd9feeb)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
- fix: keep the read-only lock last when the lifespan is re-entered (ad495f5)
|
|
10
|
+
|
|
11
|
+
### Documentation
|
|
12
|
+
- docs: drop hard-coded test count from AGENTS.md (80ce2b2)
|
|
13
|
+
|
|
14
|
+
### Chores
|
|
15
|
+
- chore(deps): bump cachetools to 8.0.4 (76a1212)
|
|
16
|
+
- chore(fleet): template v1.6.3 (7d5f7ad)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## [0.25.2] - 2026-11-30
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
- fix: disable subscriptions/listen so capabilities match behaviour (7dcc52e)
|
|
23
|
+
|
|
24
|
+
### Chores
|
|
25
|
+
- chore(deps): weekly patch 2026-11-29 (2b8b5bd)
|
|
26
|
+
|
|
27
|
+
|
|
3
28
|
## [0.25.1] - 2026-11-23
|
|
4
29
|
|
|
5
30
|
### Features
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
FROM python:3.13-slim
|
|
15
15
|
|
|
16
16
|
# uv provides reproducible, frozen installs from uv.lock.
|
|
17
|
-
COPY --from=ghcr.io/astral-sh/uv:0.13.
|
|
17
|
+
COPY --from=ghcr.io/astral-sh/uv:0.13.10@sha256:a3ea1357342c1a4bf9a0c53a3deb1b55379aefa037338d8113d5771efa01774f /uv /uvx /bin/
|
|
18
18
|
|
|
19
19
|
ENV UV_COMPILE_BYTECODE=1 \
|
|
20
20
|
UV_LINK_MODE=copy \
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: mcp-gitlab
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.26.0
|
|
4
4
|
Summary: GitLab MCP server for the MCP 2026-07-28 specification (MCP 2.0): projects, MRs, pipelines, CI/CD, approvals and issues for AI assistants. Runs with writes, or locked read-only via MCP_READ_ONLY
|
|
5
5
|
Project-URL: Homepage, https://github.com/vish288/mcp-gitlab
|
|
6
6
|
Project-URL: Repository, https://github.com/vish288/mcp-gitlab
|
|
@@ -170,6 +170,8 @@ Drop `MCP_READ_ONLY` to allow writes. On a shared or hosted server put it in the
|
|
|
170
170
|
| `MCP_READ_ONLY` | No | `false` | Shared name across the mcp-* servers. Any value other than `false`/`0`/`no`/`off`/empty locks the server read-only: the 57 write tools and write-workflow prompts are not listed, and nothing can turn it back off at runtime |
|
|
171
171
|
| `GITLAB_READ_ONLY` | No | `false` | Per-server alias for `MCP_READ_ONLY`; either one locks the server read-only. `--read-only` can only raise the lock |
|
|
172
172
|
| `MCP_TOOLSETS` | No | all | Comma list of tool groups to expose (see Toolsets); unset or `all` lists every tool. `MCP_READ_ONLY` still applies after the selection |
|
|
173
|
+
| `MCP_TOOLS` | No | - | Comma list of tool names to expose, as in `tools/list` (see Toolsets); applied after `MCP_TOOLSETS`. Unset lists every tool the toolsets allow |
|
|
174
|
+
| `MCP_EXCLUDE_TOOLS` | No | - | Comma list of tool names to hide, as in `tools/list` (see Toolsets); applied after `MCP_TOOLSETS` and `MCP_TOOLS` |
|
|
173
175
|
| `GITLAB_HTTP_BEARER_TOKEN` | No | - | Bearer token (min 16 chars) required to bind an HTTP transport to a non-loopback host; clients send `Authorization: Bearer <token>`; token mode only |
|
|
174
176
|
| `GITLAB_TIMEOUT` | No | `30` | Request timeout in seconds |
|
|
175
177
|
| `GITLAB_SSL_VERIFY` | No | `true` | Set to `false` to skip SSL verification |
|
|
@@ -211,6 +213,29 @@ MCP_TOOLSETS=issues,release uvx mcp-gitlab
|
|
|
211
213
|
|
|
212
214
|
Resources and prompts are unaffected by the selection.
|
|
213
215
|
|
|
216
|
+
#### Individual tools
|
|
217
|
+
|
|
218
|
+
For a finer cut, `MCP_TOOLS` (or `--tools`) keeps only the named tools and `MCP_EXCLUDE_TOOLS`
|
|
219
|
+
(or `--exclude-tools`) hides the named ones. Both take comma-separated names exactly as they
|
|
220
|
+
appear in `tools/list` (whitespace around a name is ignored; unset or empty means no filtering).
|
|
221
|
+
The steps run in this order, each narrowing the last:
|
|
222
|
+
|
|
223
|
+
1. the tools the `MCP_TOOLSETS` selection allows (all when unset);
|
|
224
|
+
2. if `MCP_TOOLS` is set, only those names;
|
|
225
|
+
3. minus every name in `MCP_EXCLUDE_TOOLS`;
|
|
226
|
+
4. `MCP_READ_ONLY` then hides the write tools whatever the lists say.
|
|
227
|
+
|
|
228
|
+
A valid name that an earlier step already removed has no effect and is not an error. An unknown
|
|
229
|
+
name in either list, or a selection that leaves no tools, exits 2 with one line naming the
|
|
230
|
+
problem.
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# Review group without the merge button: 28 tools
|
|
234
|
+
MCP_TOOLSETS=review MCP_EXCLUDE_TOOLS=gitlab_merge_mr uvx mcp-gitlab
|
|
235
|
+
# Exactly two tools
|
|
236
|
+
MCP_TOOLS=gitlab_get_mr,gitlab_list_mrs uvx mcp-gitlab
|
|
237
|
+
```
|
|
238
|
+
|
|
214
239
|
### Supported Token Types
|
|
215
240
|
|
|
216
241
|
The server checks these environment variables in order — first match wins:
|
|
@@ -342,7 +367,7 @@ mcp-gitlab implements the Model Context Protocol. It supports the 2026-07-28 spe
|
|
|
342
367
|
- **Legacy clients**: 2025-11-25 clients still work.
|
|
343
368
|
- **Built on**: FastMCP 4.x and the MCP Python SDK 2.x.
|
|
344
369
|
- **Transports**: `stdio` (default) and `streamable-http` (recommended for remote). The `sse` (HTTP+SSE) transport still works, but the 2026-07-28 specification deprecates it. The server prints a warning when you use it.
|
|
345
|
-
- **Capabilities**: tools, resources, and prompts. The server uses no roots, sampling, logging, elicitation, or resource subscriptions, so the 2026-07-28 deprecations do not affect it.
|
|
370
|
+
- **Capabilities**: tools, resources, and prompts. The server uses no roots, sampling, logging, elicitation, or resource subscriptions, so the 2026-07-28 deprecations do not affect it. The server disables `subscriptions/listen` and advertises `listChanged` and `resources.subscribe` as false, because its tool, prompt, and resource lists never change after startup.
|
|
346
371
|
- **Server identity and cache hints**: `serverInfo` reports the installed package version and the install page as `websiteUrl`, so every response names the exact release. List results carry the 2026-07-28 cache hints `ttlMs: 300000` (5-minute TTL) and `cacheScope: private` — private because `resources/read` can vary by the per-user token. Both are inert for clients that do not read them.
|
|
347
372
|
|
|
348
373
|
### Error results
|
|
@@ -709,13 +734,13 @@ user, and defaults to locked read-only (`MCP_READ_ONLY=true`); override it to al
|
|
|
709
734
|
# locked read-only (the image default) — stdio for an MCP client
|
|
710
735
|
docker run --rm -i \
|
|
711
736
|
-e GITLAB_URL=https://gitlab.example.com -e GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx \
|
|
712
|
-
ghcr.io/vish288/mcp-gitlab:0.
|
|
737
|
+
ghcr.io/vish288/mcp-gitlab:0.26.0
|
|
713
738
|
|
|
714
739
|
# allow writes: override the read-only default
|
|
715
740
|
docker run --rm -i \
|
|
716
741
|
-e MCP_READ_ONLY=false \
|
|
717
742
|
-e GITLAB_URL=https://gitlab.example.com -e GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx \
|
|
718
|
-
ghcr.io/vish288/mcp-gitlab:0.
|
|
743
|
+
ghcr.io/vish288/mcp-gitlab:0.26.0
|
|
719
744
|
```
|
|
720
745
|
|
|
721
746
|
For an HTTP transport, append `--transport streamable-http --host 0.0.0.0`; a non-loopback bind in
|
|
@@ -725,7 +750,7 @@ Verify the build provenance before you run it. The attestation is signed by the
|
|
|
725
750
|
publish workflow in `vish288/.github`, not by this repo, hence `--signer-repo`:
|
|
726
751
|
|
|
727
752
|
```bash
|
|
728
|
-
gh attestation verify oci://ghcr.io/vish288/mcp-gitlab:0.
|
|
753
|
+
gh attestation verify oci://ghcr.io/vish288/mcp-gitlab:0.26.0 -R vish288/mcp-gitlab --signer-repo vish288/.github
|
|
729
754
|
```
|
|
730
755
|
|
|
731
756
|
To build from source instead (uv, the committed `uv.lock`), run `docker build -t mcp-gitlab .` and
|
|
@@ -135,6 +135,8 @@ Drop `MCP_READ_ONLY` to allow writes. On a shared or hosted server put it in the
|
|
|
135
135
|
| `MCP_READ_ONLY` | No | `false` | Shared name across the mcp-* servers. Any value other than `false`/`0`/`no`/`off`/empty locks the server read-only: the 57 write tools and write-workflow prompts are not listed, and nothing can turn it back off at runtime |
|
|
136
136
|
| `GITLAB_READ_ONLY` | No | `false` | Per-server alias for `MCP_READ_ONLY`; either one locks the server read-only. `--read-only` can only raise the lock |
|
|
137
137
|
| `MCP_TOOLSETS` | No | all | Comma list of tool groups to expose (see Toolsets); unset or `all` lists every tool. `MCP_READ_ONLY` still applies after the selection |
|
|
138
|
+
| `MCP_TOOLS` | No | - | Comma list of tool names to expose, as in `tools/list` (see Toolsets); applied after `MCP_TOOLSETS`. Unset lists every tool the toolsets allow |
|
|
139
|
+
| `MCP_EXCLUDE_TOOLS` | No | - | Comma list of tool names to hide, as in `tools/list` (see Toolsets); applied after `MCP_TOOLSETS` and `MCP_TOOLS` |
|
|
138
140
|
| `GITLAB_HTTP_BEARER_TOKEN` | No | - | Bearer token (min 16 chars) required to bind an HTTP transport to a non-loopback host; clients send `Authorization: Bearer <token>`; token mode only |
|
|
139
141
|
| `GITLAB_TIMEOUT` | No | `30` | Request timeout in seconds |
|
|
140
142
|
| `GITLAB_SSL_VERIFY` | No | `true` | Set to `false` to skip SSL verification |
|
|
@@ -176,6 +178,29 @@ MCP_TOOLSETS=issues,release uvx mcp-gitlab
|
|
|
176
178
|
|
|
177
179
|
Resources and prompts are unaffected by the selection.
|
|
178
180
|
|
|
181
|
+
#### Individual tools
|
|
182
|
+
|
|
183
|
+
For a finer cut, `MCP_TOOLS` (or `--tools`) keeps only the named tools and `MCP_EXCLUDE_TOOLS`
|
|
184
|
+
(or `--exclude-tools`) hides the named ones. Both take comma-separated names exactly as they
|
|
185
|
+
appear in `tools/list` (whitespace around a name is ignored; unset or empty means no filtering).
|
|
186
|
+
The steps run in this order, each narrowing the last:
|
|
187
|
+
|
|
188
|
+
1. the tools the `MCP_TOOLSETS` selection allows (all when unset);
|
|
189
|
+
2. if `MCP_TOOLS` is set, only those names;
|
|
190
|
+
3. minus every name in `MCP_EXCLUDE_TOOLS`;
|
|
191
|
+
4. `MCP_READ_ONLY` then hides the write tools whatever the lists say.
|
|
192
|
+
|
|
193
|
+
A valid name that an earlier step already removed has no effect and is not an error. An unknown
|
|
194
|
+
name in either list, or a selection that leaves no tools, exits 2 with one line naming the
|
|
195
|
+
problem.
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Review group without the merge button: 28 tools
|
|
199
|
+
MCP_TOOLSETS=review MCP_EXCLUDE_TOOLS=gitlab_merge_mr uvx mcp-gitlab
|
|
200
|
+
# Exactly two tools
|
|
201
|
+
MCP_TOOLS=gitlab_get_mr,gitlab_list_mrs uvx mcp-gitlab
|
|
202
|
+
```
|
|
203
|
+
|
|
179
204
|
### Supported Token Types
|
|
180
205
|
|
|
181
206
|
The server checks these environment variables in order — first match wins:
|
|
@@ -307,7 +332,7 @@ mcp-gitlab implements the Model Context Protocol. It supports the 2026-07-28 spe
|
|
|
307
332
|
- **Legacy clients**: 2025-11-25 clients still work.
|
|
308
333
|
- **Built on**: FastMCP 4.x and the MCP Python SDK 2.x.
|
|
309
334
|
- **Transports**: `stdio` (default) and `streamable-http` (recommended for remote). The `sse` (HTTP+SSE) transport still works, but the 2026-07-28 specification deprecates it. The server prints a warning when you use it.
|
|
310
|
-
- **Capabilities**: tools, resources, and prompts. The server uses no roots, sampling, logging, elicitation, or resource subscriptions, so the 2026-07-28 deprecations do not affect it.
|
|
335
|
+
- **Capabilities**: tools, resources, and prompts. The server uses no roots, sampling, logging, elicitation, or resource subscriptions, so the 2026-07-28 deprecations do not affect it. The server disables `subscriptions/listen` and advertises `listChanged` and `resources.subscribe` as false, because its tool, prompt, and resource lists never change after startup.
|
|
311
336
|
- **Server identity and cache hints**: `serverInfo` reports the installed package version and the install page as `websiteUrl`, so every response names the exact release. List results carry the 2026-07-28 cache hints `ttlMs: 300000` (5-minute TTL) and `cacheScope: private` — private because `resources/read` can vary by the per-user token. Both are inert for clients that do not read them.
|
|
312
337
|
|
|
313
338
|
### Error results
|
|
@@ -674,13 +699,13 @@ user, and defaults to locked read-only (`MCP_READ_ONLY=true`); override it to al
|
|
|
674
699
|
# locked read-only (the image default) — stdio for an MCP client
|
|
675
700
|
docker run --rm -i \
|
|
676
701
|
-e GITLAB_URL=https://gitlab.example.com -e GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx \
|
|
677
|
-
ghcr.io/vish288/mcp-gitlab:0.
|
|
702
|
+
ghcr.io/vish288/mcp-gitlab:0.26.0
|
|
678
703
|
|
|
679
704
|
# allow writes: override the read-only default
|
|
680
705
|
docker run --rm -i \
|
|
681
706
|
-e MCP_READ_ONLY=false \
|
|
682
707
|
-e GITLAB_URL=https://gitlab.example.com -e GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx \
|
|
683
|
-
ghcr.io/vish288/mcp-gitlab:0.
|
|
708
|
+
ghcr.io/vish288/mcp-gitlab:0.26.0
|
|
684
709
|
```
|
|
685
710
|
|
|
686
711
|
For an HTTP transport, append `--transport streamable-http --host 0.0.0.0`; a non-loopback bind in
|
|
@@ -690,7 +715,7 @@ Verify the build provenance before you run it. The attestation is signed by the
|
|
|
690
715
|
publish workflow in `vish288/.github`, not by this repo, hence `--signer-repo`:
|
|
691
716
|
|
|
692
717
|
```bash
|
|
693
|
-
gh attestation verify oci://ghcr.io/vish288/mcp-gitlab:0.
|
|
718
|
+
gh attestation verify oci://ghcr.io/vish288/mcp-gitlab:0.26.0 -R vish288/mcp-gitlab --signer-repo vish288/.github
|
|
694
719
|
```
|
|
695
720
|
|
|
696
721
|
To build from source instead (uv, the committed `uv.lock`), run `docker build -t mcp-gitlab .` and
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-gitlab",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "GitLab MCP server (MCP 2026-07-28): projects, MRs, pipelines, CI/CD, issues; writes or read-only",
|
|
5
5
|
"mcpServers": {
|
|
6
6
|
"mcp-gitlab": {
|
|
7
7
|
"command": "uvx",
|
|
8
8
|
"args": [
|
|
9
|
-
"mcp-gitlab@0.
|
|
9
|
+
"mcp-gitlab@0.26.0"
|
|
10
10
|
]
|
|
11
11
|
}
|
|
12
12
|
},
|
|
@@ -41,6 +41,18 @@
|
|
|
41
41
|
"required": false,
|
|
42
42
|
"sensitive": false
|
|
43
43
|
},
|
|
44
|
+
{
|
|
45
|
+
"name": "MCP_TOOLS",
|
|
46
|
+
"description": "Comma list of tool names to expose, exactly as in tools/list (e.g. gitlab_get_mr,gitlab_list_mrs); unset lists every tool the toolsets allow. Applied after MCP_TOOLSETS; unknown names exit 2",
|
|
47
|
+
"required": false,
|
|
48
|
+
"sensitive": false
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "MCP_EXCLUDE_TOOLS",
|
|
52
|
+
"description": "Comma list of tool names to hide, exactly as in tools/list; applied after MCP_TOOLSETS and MCP_TOOLS. Unknown names, or a selection that leaves no tools, exit 2",
|
|
53
|
+
"required": false,
|
|
54
|
+
"sensitive": false
|
|
55
|
+
},
|
|
44
56
|
{
|
|
45
57
|
"name": "GITLAB_AUTH",
|
|
46
58
|
"description": "Authentication mode: token (default) or oauth (OAuth 2.1 proxy; streamable-http only)",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
MCP server that wraps the GitLab REST API. Works with GitLab.com and self-hosted instances (CE/EE). No GitLab Duo or Premium required. Built with FastMCP, httpx, and Pydantic.
|
|
6
6
|
|
|
7
7
|
- **Install**: `uvx mcp-gitlab`
|
|
8
|
-
- **Version**: 0.
|
|
8
|
+
- **Version**: 0.26.0
|
|
9
9
|
- **Python**: >=3.11
|
|
10
10
|
- **License**: MIT
|
|
11
11
|
- **Protocol**: MCP 2026-07-28 (MCP 2.0); compatible with 2025-11-25 clients; built on FastMCP 4.x
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
MCP server that wraps the GitLab REST API. Works with GitLab.com and self-hosted instances (CE/EE). No GitLab Duo or Premium required. Built with FastMCP, httpx, and Pydantic.
|
|
6
6
|
|
|
7
7
|
- **Install**: `uvx mcp-gitlab`
|
|
8
|
-
- **Version**: 0.
|
|
8
|
+
- **Version**: 0.26.0
|
|
9
9
|
- **Python**: >=3.11
|
|
10
10
|
- **License**: MIT
|
|
11
11
|
- **Protocol**: MCP 2026-07-28 (MCP 2.0); compatible with 2025-11-25 clients; built on FastMCP 4.x
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "mcp-gitlab"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.26.0"
|
|
4
4
|
description = "GitLab MCP server for the MCP 2026-07-28 specification (MCP 2.0): projects, MRs, pipelines, CI/CD, approvals and issues for AI assistants. Runs with writes, or locked read-only via MCP_READ_ONLY"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = {text = "MIT"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"url": "https://github.com/vish288/mcp-gitlab",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.
|
|
10
|
+
"version": "0.26.0",
|
|
11
11
|
"websiteUrl": "https://vish288.github.io/mcp-install?server=mcp-gitlab",
|
|
12
12
|
"icons": [
|
|
13
13
|
{
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
{
|
|
23
23
|
"registryType": "pypi",
|
|
24
24
|
"identifier": "mcp-gitlab",
|
|
25
|
-
"version": "0.
|
|
25
|
+
"version": "0.26.0",
|
|
26
26
|
"runtimeHint": "uvx",
|
|
27
27
|
"transport": {
|
|
28
28
|
"type": "stdio"
|
|
@@ -63,6 +63,20 @@
|
|
|
63
63
|
"format": "string",
|
|
64
64
|
"isSecret": false
|
|
65
65
|
},
|
|
66
|
+
{
|
|
67
|
+
"name": "MCP_TOOLS",
|
|
68
|
+
"description": "Comma list of tool names to expose, exactly as in tools/list (e.g. gitlab_get_mr,gitlab_list_mrs); unset lists every tool the toolsets allow. Applied after MCP_TOOLSETS; unknown names exit 2",
|
|
69
|
+
"isRequired": false,
|
|
70
|
+
"format": "string",
|
|
71
|
+
"isSecret": false
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "MCP_EXCLUDE_TOOLS",
|
|
75
|
+
"description": "Comma list of tool names to hide, exactly as in tools/list; applied after MCP_TOOLSETS and MCP_TOOLS. Unknown names, or a selection that leaves no tools, exit 2",
|
|
76
|
+
"isRequired": false,
|
|
77
|
+
"format": "string",
|
|
78
|
+
"isSecret": false
|
|
79
|
+
},
|
|
66
80
|
{
|
|
67
81
|
"name": "GITLAB_AUTH",
|
|
68
82
|
"description": "Authentication mode: token (default) or oauth (OAuth 2.1 proxy; streamable-http only)",
|
|
@@ -116,7 +130,7 @@
|
|
|
116
130
|
},
|
|
117
131
|
{
|
|
118
132
|
"registryType": "oci",
|
|
119
|
-
"identifier": "ghcr.io/vish288/mcp-gitlab:0.
|
|
133
|
+
"identifier": "ghcr.io/vish288/mcp-gitlab:0.26.0",
|
|
120
134
|
"transport": {
|
|
121
135
|
"type": "stdio"
|
|
122
136
|
},
|
|
@@ -156,6 +170,20 @@
|
|
|
156
170
|
"format": "string",
|
|
157
171
|
"isSecret": false
|
|
158
172
|
},
|
|
173
|
+
{
|
|
174
|
+
"name": "MCP_TOOLS",
|
|
175
|
+
"description": "Comma list of tool names to expose, exactly as in tools/list (e.g. gitlab_get_mr,gitlab_list_mrs); unset lists every tool the toolsets allow. Applied after MCP_TOOLSETS; unknown names exit 2",
|
|
176
|
+
"isRequired": false,
|
|
177
|
+
"format": "string",
|
|
178
|
+
"isSecret": false
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "MCP_EXCLUDE_TOOLS",
|
|
182
|
+
"description": "Comma list of tool names to hide, exactly as in tools/list; applied after MCP_TOOLSETS and MCP_TOOLS. Unknown names, or a selection that leaves no tools, exit 2",
|
|
183
|
+
"isRequired": false,
|
|
184
|
+
"format": "string",
|
|
185
|
+
"isSecret": false
|
|
186
|
+
},
|
|
159
187
|
{
|
|
160
188
|
"name": "GITLAB_AUTH",
|
|
161
189
|
"description": "Authentication mode: token (default) or oauth (OAuth 2.1 proxy; streamable-http only)",
|
|
@@ -107,6 +107,16 @@ def _apply_token_http_auth(mcp: Any, host: str) -> None:
|
|
|
107
107
|
help="Comma list of tool groups to expose "
|
|
108
108
|
"(code, review, ci, issues, release, admin; default: all)",
|
|
109
109
|
)
|
|
110
|
+
@click.option(
|
|
111
|
+
"--tools",
|
|
112
|
+
envvar="MCP_TOOLS",
|
|
113
|
+
help="Comma list of tool names to expose, as in tools/list (default: all the toolsets allow)",
|
|
114
|
+
)
|
|
115
|
+
@click.option(
|
|
116
|
+
"--exclude-tools",
|
|
117
|
+
envvar="MCP_EXCLUDE_TOOLS",
|
|
118
|
+
help="Comma list of tool names to hide, as in tools/list; applied after --tools",
|
|
119
|
+
)
|
|
110
120
|
@click.option(
|
|
111
121
|
"--auth",
|
|
112
122
|
type=click.Choice(["token", "oauth"]),
|
|
@@ -124,6 +134,8 @@ def main(
|
|
|
124
134
|
gitlab_token: str | None,
|
|
125
135
|
read_only: bool,
|
|
126
136
|
toolsets: str | None,
|
|
137
|
+
tools: str | None,
|
|
138
|
+
exclude_tools: str | None,
|
|
127
139
|
auth: str,
|
|
128
140
|
) -> None:
|
|
129
141
|
"""Run the GitLab MCP server. Subcommands: auth."""
|
|
@@ -147,6 +159,10 @@ def main(
|
|
|
147
159
|
# of the startup config so an unknown group is one clear line and exit 2.
|
|
148
160
|
if toolsets:
|
|
149
161
|
os.environ["MCP_TOOLSETS"] = toolsets
|
|
162
|
+
if tools:
|
|
163
|
+
os.environ["MCP_TOOLS"] = tools
|
|
164
|
+
if exclude_tools:
|
|
165
|
+
os.environ["MCP_EXCLUDE_TOOLS"] = exclude_tools
|
|
150
166
|
os.environ["GITLAB_AUTH"] = auth
|
|
151
167
|
|
|
152
168
|
if auth == "oauth" and transport != "streamable-http":
|
|
@@ -170,7 +186,7 @@ def main(
|
|
|
170
186
|
|
|
171
187
|
from .config import GitLabConfig
|
|
172
188
|
from .servers import prompts, resources # noqa: F401 — registers decorators
|
|
173
|
-
from .servers.gitlab import mcp, parse_toolsets
|
|
189
|
+
from .servers.gitlab import mcp, parse_toolsets, validate_tool_selection
|
|
174
190
|
|
|
175
191
|
# Validate configuration before run_async so a bad config is one clear
|
|
176
192
|
# `Error:` line + exit 2, not a traceback from inside the lifespan (D7).
|
|
@@ -198,6 +214,14 @@ def main(
|
|
|
198
214
|
cfg.credentials = _SIGNED_IN
|
|
199
215
|
cfg.validate()
|
|
200
216
|
parse_toolsets(os.getenv("MCP_TOOLSETS"))
|
|
217
|
+
if os.getenv("MCP_TOOLS") or os.getenv("MCP_EXCLUDE_TOOLS"):
|
|
218
|
+
validate_tool_selection(
|
|
219
|
+
asyncio.run(mcp.local_provider.list_tools()),
|
|
220
|
+
os.getenv("MCP_TOOLSETS"),
|
|
221
|
+
os.getenv("MCP_TOOLS"),
|
|
222
|
+
os.getenv("MCP_EXCLUDE_TOOLS"),
|
|
223
|
+
read_only=cfg.read_only,
|
|
224
|
+
)
|
|
201
225
|
except ValueError as e:
|
|
202
226
|
click.echo(f"Error: {e}", err=True)
|
|
203
227
|
ctx.exit(2)
|