Skip to content

Commit 8c93170

Browse files
authored
* Cherry pick cd11fae * bump version
1 parent 0870c2a commit 8c93170

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "code-oss-dev",
3-
"version": "1.110.0",
3+
"version": "1.110.1",
44
"distro": "d89d49b77ba5f8bdfdfe3b039067e7da38e25640",
55
"author": {
66
"name": "Microsoft Corporation"

src/vs/workbench/contrib/mcp/common/mcpRegistry.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { observableConfigValue } from '../../../../platform/observable/common/pl
2626
import { IQuickInputButton, IQuickInputService, IQuickPickItem } from '../../../../platform/quickinput/common/quickInput.js';
2727
import { StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js';
2828
import { IWorkspaceFolderData } from '../../../../platform/workspace/common/workspace.js';
29+
import { IWorkspaceTrustManagementService, IWorkspaceTrustRequestService } from '../../../../platform/workspace/common/workspaceTrust.js';
2930
import { IConfigurationResolverService } from '../../../services/configurationResolver/common/configurationResolver.js';
3031
import { ConfigurationResolverExpression, IResolvedValue } from '../../../services/configurationResolver/common/configurationResolverExpression.js';
3132
import { AUX_WINDOW_GROUP, IEditorService } from '../../../services/editor/common/editorService.js';
@@ -87,6 +88,8 @@ export class McpRegistry extends Disposable implements IMcpRegistry {
8788
@ILabelService private readonly _labelService: ILabelService,
8889
@ILogService private readonly _logService: ILogService,
8990
@IMcpSandboxService private readonly _mcpSandboxService: IMcpSandboxService,
91+
@IWorkspaceTrustManagementService private readonly _workspaceTrustManagementService: IWorkspaceTrustManagementService,
92+
@IWorkspaceTrustRequestService private readonly _workspaceTrustRequestService: IWorkspaceTrustRequestService,
9093
) {
9194
super();
9295
this._mcpAccessValue = observableConfigValue(mcpAccessConfig, McpAccessValue.All, configurationService);
@@ -215,6 +218,14 @@ export class McpRegistry extends Disposable implements IMcpRegistry {
215218
autoTrustChanges = false,
216219
errorOnUserInteraction = false,
217220
}: IMcpResolveConnectionOptions) {
221+
if (collection.scope === StorageScope.WORKSPACE && !this._workspaceTrustManagementService.isWorkspaceTrusted()) {
222+
if (errorOnUserInteraction) {
223+
throw new UserInteractionRequiredError('workspaceTrust');
224+
} else if (!await this._workspaceTrustRequestService.requestWorkspaceTrust({ message: localize('runTrust', "This MCP server definition is defined in your workspace files.") })) {
225+
return false;
226+
}
227+
}
228+
218229
if (collection.trustBehavior === McpServerTrust.Kind.Trusted) {
219230
this._logService.trace(`MCP server ${definition.id} is trusted, no trust prompt needed`);
220231
return true;

0 commit comments

Comments
 (0)