Skip to content

Commit a5db271

Browse files
committed
Changes MCP autoInstall.enabled setting to autoEnabled
- now also controls extension-based MCP registration
1 parent 82496a1 commit a5db271

File tree

5 files changed

+8
-14
lines changed

5 files changed

+8
-14
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4111,10 +4111,10 @@
41114111
"experimental"
41124112
]
41134113
},
4114-
"gitlens.gitkraken.mcp.autoInstall.enabled": {
4114+
"gitlens.gitkraken.mcp.autoEnabled": {
41154115
"type": "boolean",
41164116
"default": true,
4117-
"markdownDescription": "Specifies whether to automatically install the GitKraken MCP",
4117+
"markdownDescription": "Specifies whether to automatically install and enable the GitKraken MCP. This only applies to VS Code 1.101 and later.",
41184118
"scope": "window",
41194119
"order": 40
41204120
},

src/config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,7 @@ interface GitKrakenCliConfig {
399399
}
400400

401401
interface GitKrakenMcpConfig {
402-
readonly autoInstall: {
403-
readonly enabled: boolean;
404-
};
402+
readonly autoEnabled: boolean;
405403
}
406404

407405
export interface GraphConfig {

src/env/node/gk/cli/integration.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ import { version as codeVersion, Disposable, env, ProgressLocation, Uri, window,
44
import type { Source, Sources } from '../../../../constants.telemetry';
55
import type { Container } from '../../../../container';
66
import type { SubscriptionChangeEvent } from '../../../../plus/gk/subscriptionService';
7-
import {
8-
mcpExtensionRegistrationAllowed,
9-
supportsMcpExtensionRegistration,
10-
} from '../../../../plus/gk/utils/-webview/mcp.utils';
7+
import { mcpExtensionRegistrationAllowed } from '../../../../plus/gk/utils/-webview/mcp.utils';
118
import { registerCommand } from '../../../../system/-webview/command';
129
import { configuration } from '../../../../system/-webview/configuration';
1310
import { setContext } from '../../../../system/-webview/context';
@@ -230,7 +227,7 @@ export class GkCliIntegrationProvider implements Disposable {
230227
}
231228

232229
// If MCP extension registration is supported, don't proceed with manual setup
233-
if (supportsMcpExtensionRegistration()) {
230+
if (mcpExtensionRegistrationAllowed()) {
234231
setLogScopeExit(scope, 'supports provider-based MCP registration');
235232
return;
236233
}

src/env/node/providers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Container } from '../../container';
33
import type { GitCommandOptions } from '../../git/commandOptions';
44
import type { GitProvider } from '../../git/gitProvider';
55
import type { RepositoryLocationProvider } from '../../git/location/repositorylocationProvider';
6-
import { supportsMcpExtensionRegistration } from '../../plus/gk/utils/-webview/mcp.utils';
6+
import { mcpExtensionRegistrationAllowed } from '../../plus/gk/utils/-webview/mcp.utils';
77
import type { SharedGkStorageLocationProvider } from '../../plus/repos/sharedGkStorageLocationProvider';
88
import type { GkWorkspacesSharedStorageProvider } from '../../plus/workspaces/workspacesSharedStorageProvider';
99
import { configuration } from '../../system/-webview/configuration';
@@ -77,7 +77,7 @@ export function getGkCliIntegrationProvider(container: Container): GkCliIntegrat
7777
export async function getMcpProviders(
7878
container: Container,
7979
): Promise<(McpServerDefinitionProvider & Disposable)[] | undefined> {
80-
if (!supportsMcpExtensionRegistration()) return undefined;
80+
if (!mcpExtensionRegistrationAllowed()) return undefined;
8181

8282
// Older versions of VS Code do not support the classes used in the MCP integration, so we need to dynamically import
8383
const mcpModule = await import(/* webpackChunkName: "mcp" */ './gk/mcp/integration');

src/plus/gk/utils/-webview/mcp.utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ export function supportsMcpExtensionRegistration(): boolean {
2222
}
2323

2424
export function mcpExtensionRegistrationAllowed(): boolean {
25-
// TODO: Remove experimental setting for production release
2625
return (
2726
configuration.get('ai.enabled') &&
28-
configuration.get('gitkraken.mcp.autoInstall.enabled') &&
27+
configuration.get('gitkraken.mcp.autoEnabled') &&
2928
supportsMcpExtensionRegistration()
3029
);
3130
}

0 commit comments

Comments
 (0)