Fix MCP experimental flag passed to wrong CLI command#5114
Fix MCP experimental flag passed to wrong CLI command#5114nikolay-1986 wants to merge 1 commit intomainfrom
Conversation
The `--experimental` flag was being passed to `gk mcp config` (the configuration query command) instead of being appended to the MCP server's runtime args. The CLI's `mcp config` subcommand does not support `--experimental` (warns "unknown flag") and never includes it in the returned args, so the MCP server was always started without experimental features regardless of the setting. Moves `--experimental` injection from the config query args to the returned `config.args` array, so the MCP server itself receives the flag at startup — matching the behavior of manual mcp.json configuration. Also registers the `gitlens.gitkraken.mcp.experimental.enabled` setting in package.json so VS Code recognizes it as a valid configuration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🤖 Augment PR SummarySummary: Fixes the GitKraken MCP experimental setting by ensuring the 🤖 Was this summary useful? React with 👍 or 👎 |
| "tags": [ | ||
| "experimental" | ||
| ] | ||
| }, |
There was a problem hiding this comment.
We're explicitly leaving this out of the package.json/contributions.json so it doesn't show in the settings UI.
| // Append --experimental to the MCP server args (not the config command) | ||
| // so the server itself runs with experimental features enabled |
There was a problem hiding this comment.
This comment explains the fix, but doesn't really feel necessary or make sense out of context. It should probably just be removed.
- Validates getMcpConfig() returns correct server config (name, type, command, args) - Verifies mcp subcommand is present in config args - Tests --experimental flag injection with withSettings() for enabled/disabled states (expected to fail until PR #5114 registers the setting in package.json) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
I'm closing current PR, because the reason of the issue is on the CLI side when responding to the MCP config request https://github.com/gitkraken/gkcli/issues/722; the setting may also be hidden. |
- Validates getMcpConfig() returns correct server config (name, type, command, args) - Verifies mcp subcommand is present in config args - Tests --experimental flag injection with withSettings() for enabled/disabled states (expected to fail until PR #5114 registers the setting in package.json) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CLI v3.1.55 supports --experimental in `gk mcp config` — the flag is correctly passed through to server args. PR #5114 is closed as resolved. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Fixes the
--experimentalflag for the GitKraken MCP server not taking effect when enabled viagitlens.gitkraken.mcp.experimental.enabledsetting.Root cause
Commit e4abb9b ("Adds JSON-only setting for GK CLI --experimental flag") introduced the
gitkraken.mcp.experimental.enabledsetting and added code to pass--experimentalto the CLI. However, the flag was appended to thegk mcp configcommand (the configuration query), not to the MCP server's runtime args.The two-stage flow works like this:
gk mcp config vscode --source=gitlens --scheme=vscodeto get the server definitioncommandandargsfrom the config responseThe
mcp configsubcommand does not recognize--experimental— it warns "unknown flag" and ignores it. Even if it did, the flag would only affect the config query, not the actual MCP server process. The returnedargsarray never included--experimental, so the MCP server always started without experimental features.Verified against CLI versions:
gk.exev3.1.55-rc.2 (bundled) —Warning: unknown flag: --experimentalgk-insiders.exev3.1.55-rc.3 —Warning: unknown flag: --experimentalFix
--experimentalinjection from the config query args to the returnedconfig.argsarray, so the MCP server itself receives the flag at startup!config.args.includes('--experimental')) to avoid duplication if a future CLI version starts including it in the config responsegitlens.gitkraken.mcp.experimental.enabledinpackage.jsonso VS Code recognizes it as a valid setting (was only defined insrc/config.tsTypeScript types)Before (broken)
After (fixed)
Test plan
"gitlens.gitkraken.mcp.experimental.enabled": truein settings.json--experimentalflaggit_status) appear in VS Code Copilot chat via@gitkrakenfalse(default),--experimentalis NOT appended🤖 Generated with Claude Code