@codingame/monaco-vscode-mcp-service-override 28.4.0 → 29.0.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/package.json +2 -2
- package/vscode/src/vs/base/common/jsonRpcProtocol.d.ts +13 -1
- package/vscode/src/vs/base/common/jsonRpcProtocol.js +26 -13
- package/vscode/src/vs/platform/mcp/common/allowedMcpServersService.js +1 -1
- package/vscode/src/vs/platform/mcp/common/mcpGalleryManifestService.js +2 -1
- package/vscode/src/vs/platform/mcp/common/mcpGalleryService.js +8 -5
- package/vscode/src/vs/platform/mcp/common/mcpGateway.d.ts +49 -18
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.js +81 -67
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +267 -50
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpGatewayService.js +17 -3
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +24 -21
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpMigration.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess.js +8 -8
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +18 -18
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +37 -9
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/pluginMcpDiscovery.js +11 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpGatewayToolBrokerChannel.d.ts +8 -9
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpGatewayToolBrokerChannel.js +147 -132
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.js +10 -6
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +14 -14
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js +11 -11
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSandboxService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSandboxService.js +15 -8
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +7 -22
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.js +16 -4
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +9 -9
- package/vscode/src/vs/workbench/services/mcp/browser/mcpGalleryManifestService.js +2 -2
|
@@ -74,7 +74,7 @@ let McpResourcePickHelper = class McpResourcePickHelper extends Disposable {
|
|
|
74
74
|
id: resource.template.template,
|
|
75
75
|
label: resource.title || resource.name,
|
|
76
76
|
description: resource.description,
|
|
77
|
-
detail: ( localize(
|
|
77
|
+
detail: ( localize(10519, "Resource template: {0}", resource.template.template)),
|
|
78
78
|
iconPath
|
|
79
79
|
};
|
|
80
80
|
}
|
|
@@ -221,7 +221,7 @@ let McpResourcePickHelper = class McpResourcePickHelper extends Disposable {
|
|
|
221
221
|
return uri;
|
|
222
222
|
}
|
|
223
223
|
this._notificationService.warn(( localize(
|
|
224
|
-
|
|
224
|
+
10520,
|
|
225
225
|
"The resource {0} was not found.",
|
|
226
226
|
(McpResourceURI.toServer(uri).resourceURL.toString())
|
|
227
227
|
)));
|
|
@@ -266,13 +266,13 @@ let McpResourcePickHelper = class McpResourcePickHelper extends Disposable {
|
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
let placeholder = ( localize(
|
|
269
|
-
|
|
269
|
+
10521,
|
|
270
270
|
"Value for ${0} in {1}",
|
|
271
271
|
variable.name.toUpperCase(),
|
|
272
272
|
rt.template.resolve(variablesWithPlaceholders).replaceAll("%24", "$")
|
|
273
273
|
));
|
|
274
274
|
if (variable.optional) {
|
|
275
|
-
placeholder += " (" + ( localize(
|
|
275
|
+
placeholder += " (" + ( localize(10522, "Optional")) + ")";
|
|
276
276
|
}
|
|
277
277
|
input.placeholder = placeholder;
|
|
278
278
|
input.value = "";
|
|
@@ -292,7 +292,7 @@ let McpResourcePickHelper = class McpResourcePickHelper extends Disposable {
|
|
|
292
292
|
} else if (variable.optional) {
|
|
293
293
|
items.unshift({
|
|
294
294
|
id: currentID,
|
|
295
|
-
label: ( localize(
|
|
295
|
+
label: ( localize(10523, "<Empty>"))
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
298
|
input.items = items;
|
|
@@ -463,7 +463,7 @@ let AbstractMcpResourceAccessPick = class AbstractMcpResourceAccessPick {
|
|
|
463
463
|
picker.keepScrollPosition = true;
|
|
464
464
|
const store = ( new DisposableStore());
|
|
465
465
|
const goBackId = "_goback_";
|
|
466
|
-
const attachButton = ( localize(
|
|
466
|
+
const attachButton = ( localize(10524, "Attach to chat"));
|
|
467
467
|
const helper = store.add(this._instantiationService.createInstance(McpResourcePickHelper));
|
|
468
468
|
if (this._scopeTo) {
|
|
469
469
|
helper.explicitServers = [this._scopeTo];
|
|
@@ -491,7 +491,7 @@ let AbstractMcpResourceAccessPick = class AbstractMcpResourceAccessPick {
|
|
|
491
491
|
if (helper.checkIfNestedResources()) {
|
|
492
492
|
const goBackItem = {
|
|
493
493
|
id: goBackId,
|
|
494
|
-
label: ( localize(
|
|
494
|
+
label: ( localize(10525, "Go back ↩")),
|
|
495
495
|
alwaysShow: true
|
|
496
496
|
};
|
|
497
497
|
items.push(goBackItem);
|
|
@@ -573,7 +573,7 @@ let McpResourceQuickPick = class McpResourceQuickPick extends AbstractMcpResourc
|
|
|
573
573
|
const qp = store.add(this._quickInputService.createQuickPick({
|
|
574
574
|
useSeparators: true
|
|
575
575
|
}));
|
|
576
|
-
qp.placeholder = ( localize(
|
|
576
|
+
qp.placeholder = ( localize(10526, "Search for resources"));
|
|
577
577
|
store.add(this.applyToPick(qp, token));
|
|
578
578
|
store.add(qp.onDidHide(() => store.dispose()));
|
|
579
579
|
qp.show();
|
|
@@ -142,7 +142,7 @@ let McpServersListView = class McpServersListView extends AbstractExtensionsList
|
|
|
142
142
|
return mcpServer?.label ?? "";
|
|
143
143
|
},
|
|
144
144
|
getWidgetAriaLabel() {
|
|
145
|
-
return localize(
|
|
145
|
+
return localize(10604, "MCP Servers");
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
148
|
overrideStyles: getLocationBasedViewColors(this.viewDescriptorService.getViewLocationById(this.id)).listOverrideStyles,
|
|
@@ -251,43 +251,43 @@ let McpServersListView = class McpServersListView extends AbstractExtensionsList
|
|
|
251
251
|
const iconElement = append(iconContainer, $("span"));
|
|
252
252
|
iconElement.className = ThemeIcon.asClassName(mcpServerIcon);
|
|
253
253
|
const title = append(welcomeContent, $(".mcp-welcome-title"));
|
|
254
|
-
title.textContent = ( localize(
|
|
254
|
+
title.textContent = ( localize(10605, "MCP Servers"));
|
|
255
255
|
const settingsCommandLink = ( createMarkdownCommandLink({
|
|
256
256
|
id: "workbench.action.openSettings",
|
|
257
257
|
arguments: [`@id:${mcpGalleryServiceEnablementConfig}`],
|
|
258
|
-
|
|
259
|
-
tooltip: ( localize(
|
|
258
|
+
text: mcpGalleryServiceEnablementConfig,
|
|
259
|
+
tooltip: ( localize(10606, "Open Settings"))
|
|
260
260
|
}).toString());
|
|
261
261
|
const description = append(welcomeContent, $(".mcp-welcome-description"));
|
|
262
262
|
const markdownResult = this._register(this.markdownRendererService.render(( new MarkdownString(( localize(
|
|
263
|
-
|
|
263
|
+
10607,
|
|
264
264
|
"Browse and install [Model Context Protocol (MCP) servers](https://code.visualstudio.com/docs/copilot/customization/mcp-servers) directly from VS Code to extend agent mode with extra tools for connecting to databases, invoking APIs and performing specialized tasks."
|
|
265
265
|
)), {
|
|
266
266
|
isTrusted: {
|
|
267
267
|
enabledCommands: ["workbench.action.openSettings"]
|
|
268
268
|
}
|
|
269
269
|
})).appendMarkdown("\n\n").appendMarkdown(( localize(
|
|
270
|
-
|
|
270
|
+
10608,
|
|
271
271
|
"This feature is currently in preview. You can disable it anytime using the setting {0}.",
|
|
272
272
|
settingsCommandLink
|
|
273
273
|
)))));
|
|
274
274
|
description.appendChild(markdownResult.element);
|
|
275
275
|
const buttonContainer = append(welcomeContent, $(".mcp-welcome-button-container"));
|
|
276
276
|
const button = this._register(( new Button(buttonContainer, {
|
|
277
|
-
title: ( localize(
|
|
277
|
+
title: ( localize(10609, "Enable MCP Servers Marketplace")),
|
|
278
278
|
...defaultButtonStyles
|
|
279
279
|
})));
|
|
280
|
-
button.label = ( localize(
|
|
280
|
+
button.label = ( localize(10609, "Enable MCP Servers Marketplace"));
|
|
281
281
|
this._register(button.onDidClick(async () => {
|
|
282
282
|
const {
|
|
283
283
|
result
|
|
284
284
|
} = await this.dialogService.prompt({
|
|
285
285
|
type: "info",
|
|
286
|
-
message: ( localize(
|
|
286
|
+
message: ( localize(10610, "Enable MCP Servers Marketplace?")),
|
|
287
287
|
custom: {
|
|
288
288
|
markdownDetails: [{
|
|
289
289
|
markdown: ( new MarkdownString(( localize(
|
|
290
|
-
|
|
290
|
+
10608,
|
|
291
291
|
"This feature is currently in preview. You can disable it anytime using the setting {0}.",
|
|
292
292
|
settingsCommandLink
|
|
293
293
|
)), {
|
|
@@ -296,10 +296,10 @@ let McpServersListView = class McpServersListView extends AbstractExtensionsList
|
|
|
296
296
|
}]
|
|
297
297
|
},
|
|
298
298
|
buttons: [{
|
|
299
|
-
label: ( localize(
|
|
299
|
+
label: ( localize(10611, "Enable")),
|
|
300
300
|
run: () => true
|
|
301
301
|
}, {
|
|
302
|
-
label: ( localize(
|
|
302
|
+
label: ( localize(10612, "Cancel")),
|
|
303
303
|
run: () => false
|
|
304
304
|
}]
|
|
305
305
|
});
|
|
@@ -319,7 +319,7 @@ let McpServersListView = class McpServersListView extends AbstractExtensionsList
|
|
|
319
319
|
this.bodyTemplate.messageBox.textContent = message.text;
|
|
320
320
|
} else if (count === 0) {
|
|
321
321
|
this.bodyTemplate.messageSeverityIcon.className = "";
|
|
322
|
-
this.bodyTemplate.messageBox.textContent = ( localize(
|
|
322
|
+
this.bodyTemplate.messageBox.textContent = ( localize(10613, "No MCP Servers found."));
|
|
323
323
|
}
|
|
324
324
|
if (this.bodyTemplate.messageBox.textContent) {
|
|
325
325
|
alert(this.bodyTemplate.messageBox.textContent);
|
|
@@ -533,7 +533,7 @@ class McpServersViewsContribution extends Disposable {
|
|
|
533
533
|
super();
|
|
534
534
|
( Registry.as(Extensions.ViewsRegistry)).registerViews([{
|
|
535
535
|
id: InstalledMcpServersViewId,
|
|
536
|
-
name: ( localize2(
|
|
536
|
+
name: ( localize2(10614, "MCP Servers - Installed")),
|
|
537
537
|
ctorDescriptor: ( new SyncDescriptor(McpServersListView, [{}])),
|
|
538
538
|
when: ( ContextKeyExpr.and(DefaultViewsContext, HasInstalledMcpServersContext, ( ChatContextKeys.Setup.hidden.negate()))),
|
|
539
539
|
weight: 40,
|
|
@@ -541,7 +541,7 @@ class McpServersViewsContribution extends Disposable {
|
|
|
541
541
|
canToggleVisibility: true
|
|
542
542
|
}, {
|
|
543
543
|
id: "workbench.views.mcp.default.marketplace",
|
|
544
|
-
name: ( localize2(
|
|
544
|
+
name: ( localize2(10615, "MCP Servers")),
|
|
545
545
|
ctorDescriptor: ( new SyncDescriptor(DefaultBrowseMcpServersView, [{}])),
|
|
546
546
|
when: ( ContextKeyExpr.and(DefaultViewsContext, ( HasInstalledMcpServersContext.toNegated()), ( ChatContextKeys.Setup.hidden.negate()), ( McpServersGalleryStatusContext.isEqualTo(McpGalleryManifestStatus.Available)), ( ContextKeyExpr.or(( ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceUrlConfig}`)), ( ProductQualityContext.notEqualsTo("stable")), ( ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceEnablementConfig}`)))))),
|
|
547
547
|
weight: 40,
|
|
@@ -549,12 +549,12 @@ class McpServersViewsContribution extends Disposable {
|
|
|
549
549
|
canToggleVisibility: true
|
|
550
550
|
}, {
|
|
551
551
|
id: "workbench.views.mcp.marketplace",
|
|
552
|
-
name: ( localize2(
|
|
552
|
+
name: ( localize2(10615, "MCP Servers")),
|
|
553
553
|
ctorDescriptor: ( new SyncDescriptor(McpServersListView, [{}])),
|
|
554
554
|
when: ( ContextKeyExpr.and(SearchMcpServersContext, ( ChatContextKeys.Setup.hidden.negate()), ( McpServersGalleryStatusContext.isEqualTo(McpGalleryManifestStatus.Available)), ( ContextKeyExpr.or(( ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceUrlConfig}`)), ( ProductQualityContext.notEqualsTo("stable")), ( ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceEnablementConfig}`))))))
|
|
555
555
|
}, {
|
|
556
556
|
id: "workbench.views.mcp.default.welcomeView",
|
|
557
|
-
name: ( localize2(
|
|
557
|
+
name: ( localize2(10615, "MCP Servers")),
|
|
558
558
|
ctorDescriptor: ( new SyncDescriptor(DefaultBrowseMcpServersView, [{
|
|
559
559
|
showWelcome: true
|
|
560
560
|
}])),
|
|
@@ -564,7 +564,7 @@ class McpServersViewsContribution extends Disposable {
|
|
|
564
564
|
canToggleVisibility: true
|
|
565
565
|
}, {
|
|
566
566
|
id: "workbench.views.mcp.welcomeView",
|
|
567
|
-
name: ( localize2(
|
|
567
|
+
name: ( localize2(10615, "MCP Servers")),
|
|
568
568
|
ctorDescriptor: ( new SyncDescriptor(McpServersListView, [{
|
|
569
569
|
showWelcome: true
|
|
570
570
|
}])),
|
|
@@ -34,6 +34,7 @@ import { IRemoteAgentService } from '@codingame/monaco-vscode-api/vscode/vs/work
|
|
|
34
34
|
import { mcpConfigurationSection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
|
|
35
35
|
import { McpServerEnablementState, McpCollectionSortOrder, McpServerInstallState, McpServersGalleryStatusContext, HasInstalledMcpServersContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
|
|
36
36
|
import { IMcpService, IMcpWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
|
|
37
|
+
import { ContributionEnablementState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/enablement';
|
|
37
38
|
import { McpServerEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/browser/mcpServerEditorInput';
|
|
38
39
|
import { IMcpGalleryManifestService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpGalleryManifest.service';
|
|
39
40
|
import { IExtensionsWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions.service';
|
|
@@ -41,6 +42,7 @@ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/in
|
|
|
41
42
|
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
42
43
|
import { Queue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
43
44
|
import { runOnChange } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils/runOnChange';
|
|
45
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
44
46
|
|
|
45
47
|
let McpWorkbenchServer = class McpWorkbenchServer {
|
|
46
48
|
constructor(
|
|
@@ -216,6 +218,12 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
216
218
|
this._local = this.sort(this._local);
|
|
217
219
|
this._onChange.fire(undefined);
|
|
218
220
|
}));
|
|
221
|
+
this._register(autorun(reader => {
|
|
222
|
+
for (const server of mcpService.servers.read(reader)) {
|
|
223
|
+
server.enablement.read(reader);
|
|
224
|
+
}
|
|
225
|
+
this._onChange.fire(undefined);
|
|
226
|
+
}));
|
|
219
227
|
}
|
|
220
228
|
async onDidChangeProfile() {
|
|
221
229
|
await this.queryLocal();
|
|
@@ -442,7 +450,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
442
450
|
const existing = result.get(server.name);
|
|
443
451
|
if (existing) {
|
|
444
452
|
this.logService.warn(( localize(
|
|
445
|
-
|
|
453
|
+
10616,
|
|
446
454
|
"Overwriting mcp server '{0}' from {1} with {2}.",
|
|
447
455
|
server.name,
|
|
448
456
|
server.mcpResource.path,
|
|
@@ -455,7 +463,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
455
463
|
const existing = result.get(server.name);
|
|
456
464
|
if (existing) {
|
|
457
465
|
this.logService.warn(( localize(
|
|
458
|
-
|
|
466
|
+
10616,
|
|
459
467
|
"Overwriting mcp server '{0}' from {1} with {2}.",
|
|
460
468
|
server.name,
|
|
461
469
|
server.mcpResource.path,
|
|
@@ -468,7 +476,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
468
476
|
}
|
|
469
477
|
canInstall(mcpServer) {
|
|
470
478
|
if (!(mcpServer instanceof McpWorkbenchServer)) {
|
|
471
|
-
return ( new MarkdownString()).appendText(( localize(
|
|
479
|
+
return ( new MarkdownString()).appendText(( localize(10617, "The provided object is not an mcp server.")));
|
|
472
480
|
}
|
|
473
481
|
if (mcpServer.gallery) {
|
|
474
482
|
const result = this.mcpManagementService.canInstall(mcpServer.gallery);
|
|
@@ -485,7 +493,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
485
493
|
return result;
|
|
486
494
|
}
|
|
487
495
|
return ( new MarkdownString()).appendText(( localize(
|
|
488
|
-
|
|
496
|
+
10618,
|
|
489
497
|
"Cannot install the '{0}' MCP Server because it is not available in this setup.",
|
|
490
498
|
mcpServer.label
|
|
491
499
|
)));
|
|
@@ -592,7 +600,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
592
600
|
id: USER_CONFIG_ID,
|
|
593
601
|
key: "userLocalValue",
|
|
594
602
|
target: ConfigurationTarget.USER_LOCAL,
|
|
595
|
-
label: ( localize(
|
|
603
|
+
label: ( localize(10619, "Global in {0}", this.productService.nameShort)),
|
|
596
604
|
scope: StorageScope.PROFILE,
|
|
597
605
|
order: McpCollectionSortOrder.User,
|
|
598
606
|
uri: mcpResource,
|
|
@@ -769,11 +777,31 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
769
777
|
if (enablementStatus) {
|
|
770
778
|
return enablementStatus;
|
|
771
779
|
}
|
|
772
|
-
|
|
780
|
+
const server = this.mcpService.servers.get().find(s => s.definition.id === mcpServer.id);
|
|
781
|
+
if (!server) {
|
|
773
782
|
return {
|
|
774
783
|
state: McpServerEnablementState.Disabled
|
|
775
784
|
};
|
|
776
785
|
}
|
|
786
|
+
const enablement = server.enablement.get();
|
|
787
|
+
if (enablement === ContributionEnablementState.DisabledProfile) {
|
|
788
|
+
return {
|
|
789
|
+
state: McpServerEnablementState.DisabledProfile,
|
|
790
|
+
message: {
|
|
791
|
+
severity: Severity.Info,
|
|
792
|
+
text: ( new MarkdownString(( localize(10620, "This MCP server is disabled."))))
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
if (enablement === ContributionEnablementState.DisabledWorkspace) {
|
|
797
|
+
return {
|
|
798
|
+
state: McpServerEnablementState.DisabledWorkspace,
|
|
799
|
+
message: {
|
|
800
|
+
severity: Severity.Info,
|
|
801
|
+
text: ( new MarkdownString(( localize(10621, "This MCP server is disabled for this workspace."))))
|
|
802
|
+
}
|
|
803
|
+
};
|
|
804
|
+
}
|
|
777
805
|
return undefined;
|
|
778
806
|
}
|
|
779
807
|
getEnablementStatus(mcpServer) {
|
|
@@ -790,7 +818,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
790
818
|
message: {
|
|
791
819
|
severity: Severity.Warning,
|
|
792
820
|
text: ( new MarkdownString(( localize(
|
|
793
|
-
|
|
821
|
+
10622,
|
|
794
822
|
"This MCP Server is disabled because MCP servers are configured to be disabled in the Editor. Please check your [settings]({0}).",
|
|
795
823
|
settingsCommandLink
|
|
796
824
|
))))
|
|
@@ -804,7 +832,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
804
832
|
message: {
|
|
805
833
|
severity: Severity.Warning,
|
|
806
834
|
text: ( new MarkdownString(( localize(
|
|
807
|
-
|
|
835
|
+
10623,
|
|
808
836
|
"This MCP Server is disabled because it is configured to be disabled in the Editor. Please check your [settings]({0}).",
|
|
809
837
|
settingsCommandLink
|
|
810
838
|
))))
|
|
@@ -818,7 +846,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
818
846
|
message: {
|
|
819
847
|
severity: Severity.Warning,
|
|
820
848
|
text: ( new MarkdownString(( localize(
|
|
821
|
-
|
|
849
|
+
10623,
|
|
822
850
|
"This MCP Server is disabled because it is configured to be disabled in the Editor. Please check your [settings]({0}).",
|
|
823
851
|
settingsCommandLink
|
|
824
852
|
))))
|
|
@@ -141,20 +141,20 @@ let ExtensionMcpDiscovery = ExtensionMcpDiscovery_1 = class ExtensionMcpDiscover
|
|
|
141
141
|
}
|
|
142
142
|
static _validate(user) {
|
|
143
143
|
if (!Array.isArray(user.value)) {
|
|
144
|
-
user.collector.error(( localize(
|
|
144
|
+
user.collector.error(( localize(10624, "Expected an array of MCP collections")));
|
|
145
145
|
return false;
|
|
146
146
|
}
|
|
147
147
|
for (const contribution of user.value) {
|
|
148
148
|
if (typeof contribution.id !== "string" || isFalsyOrWhitespace(contribution.id)) {
|
|
149
|
-
user.collector.error(( localize(
|
|
149
|
+
user.collector.error(( localize(10625, "Expected 'id' to be a non-empty string.")));
|
|
150
150
|
return false;
|
|
151
151
|
}
|
|
152
152
|
if (typeof contribution.label !== "string" || isFalsyOrWhitespace(contribution.label)) {
|
|
153
|
-
user.collector.error(( localize(
|
|
153
|
+
user.collector.error(( localize(10626, "Expected 'label' to be a non-empty string.")));
|
|
154
154
|
return false;
|
|
155
155
|
}
|
|
156
156
|
if (contribution.when !== undefined && (typeof contribution.when !== "string" || isFalsyOrWhitespace(contribution.when))) {
|
|
157
|
-
user.collector.error(( localize(
|
|
157
|
+
user.collector.error(( localize(10627, "Expected 'when' to be a non-empty string.")));
|
|
158
158
|
return false;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
@@ -86,7 +86,7 @@ let NativeFilesystemMcpDiscovery = class NativeFilesystemMcpDiscovery extends Fi
|
|
|
86
86
|
this.suffix = "";
|
|
87
87
|
if (remoteAuthority) {
|
|
88
88
|
this.suffix = " " + ( localize(
|
|
89
|
-
|
|
89
|
+
10628,
|
|
90
90
|
" on {0}",
|
|
91
91
|
labelService.getHostLabel(Schemas.vscodeRemote, remoteAuthority)
|
|
92
92
|
));
|
|
@@ -11,6 +11,7 @@ import { ConfigurationTarget } from '@codingame/monaco-vscode-api/vscode/vs/plat
|
|
|
11
11
|
import { McpServerType } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpPlatformTypes';
|
|
12
12
|
import { StorageScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
13
13
|
import { IAgentPluginService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginService.service';
|
|
14
|
+
import { isContributionEnabled } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/enablement';
|
|
14
15
|
import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
|
|
15
16
|
import { McpCollectionSortOrder, McpServerTrust, McpServerTransportType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
|
|
16
17
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
@@ -28,10 +29,17 @@ let PluginMcpDiscovery = class PluginMcpDiscovery extends Disposable {
|
|
|
28
29
|
const plugins = this._agentPluginService.plugins.read(reader);
|
|
29
30
|
const seen = ( new ResourceSet());
|
|
30
31
|
for (const plugin of plugins) {
|
|
32
|
+
if (!isContributionEnabled(plugin.enablement.read(reader))) {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const servers = plugin.mcpServerDefinitions.read(reader);
|
|
36
|
+
if (servers.length === 0) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
31
39
|
seen.add(plugin.uri);
|
|
32
40
|
let collectionState = this._collections.get(plugin.uri);
|
|
33
41
|
if (!collectionState) {
|
|
34
|
-
collectionState = this.createCollectionState(plugin);
|
|
42
|
+
collectionState = this.createCollectionState(plugin, servers[0].uri);
|
|
35
43
|
this._collections.set(plugin.uri, collectionState);
|
|
36
44
|
}
|
|
37
45
|
}
|
|
@@ -42,7 +50,7 @@ let PluginMcpDiscovery = class PluginMcpDiscovery extends Disposable {
|
|
|
42
50
|
}
|
|
43
51
|
}));
|
|
44
52
|
}
|
|
45
|
-
createCollectionState(plugin) {
|
|
53
|
+
createCollectionState(plugin, manifestURI) {
|
|
46
54
|
const collectionId = `plugin.${plugin.uri}`;
|
|
47
55
|
return this._mcpRegistry.registerCollection({
|
|
48
56
|
id: collectionId,
|
|
@@ -53,7 +61,7 @@ let PluginMcpDiscovery = class PluginMcpDiscovery extends Disposable {
|
|
|
53
61
|
trustBehavior: McpServerTrust.Kind.Trusted,
|
|
54
62
|
serverDefinitions: ( plugin.mcpServerDefinitions.map(defs => ( defs.map(d => this._toServerDefinition(collectionId, d))).filter(isDefined))),
|
|
55
63
|
presentation: {
|
|
56
|
-
origin:
|
|
64
|
+
origin: manifestURI,
|
|
57
65
|
order: McpCollectionSortOrder.Plugin
|
|
58
66
|
}
|
|
59
67
|
});
|
|
@@ -14,19 +14,19 @@ var McpContextKeys;
|
|
|
14
14
|
(function(McpContextKeys) {
|
|
15
15
|
McpContextKeys.serverCount = ( new RawContextKey("mcp.serverCount", undefined, {
|
|
16
16
|
type: "number",
|
|
17
|
-
description: ( localize(
|
|
17
|
+
description: ( localize(10669, "Context key that has the number of registered MCP servers"))
|
|
18
18
|
}));
|
|
19
19
|
McpContextKeys.hasUnknownTools = ( new RawContextKey("mcp.hasUnknownTools", undefined, {
|
|
20
20
|
type: "boolean",
|
|
21
|
-
description: ( localize(
|
|
21
|
+
description: ( localize(10670, "Indicates whether there are MCP servers with unknown tools."))
|
|
22
22
|
}));
|
|
23
23
|
McpContextKeys.hasServersWithErrors = ( new RawContextKey("mcp.hasServersWithErrors", undefined, {
|
|
24
24
|
type: "boolean",
|
|
25
|
-
description: ( localize(
|
|
25
|
+
description: ( localize(10671, "Indicates whether there are any MCP servers with errors."))
|
|
26
26
|
}));
|
|
27
27
|
McpContextKeys.toolsCount = ( new RawContextKey("mcp.toolsCount", undefined, {
|
|
28
28
|
type: "number",
|
|
29
|
-
description: ( localize(
|
|
29
|
+
description: ( localize(10672, "Context key that has the number of registered MCP tools"))
|
|
30
30
|
}));
|
|
31
31
|
})(McpContextKeys || (McpContextKeys = {}));
|
|
32
32
|
let McpContextKeysController = class McpContextKeysController extends Disposable {
|
|
@@ -10,8 +10,7 @@ export declare class McpGatewayToolBrokerChannel extends Disposable implements I
|
|
|
10
10
|
private readonly _startupGracePeriodMs;
|
|
11
11
|
private readonly _onDidChangeTools;
|
|
12
12
|
private readonly _onDidChangeResources;
|
|
13
|
-
private readonly
|
|
14
|
-
private _nextServerIndex;
|
|
13
|
+
private readonly _onDidChangeServers;
|
|
15
14
|
/**
|
|
16
15
|
* Per-server promise that races server startup against the grace period timeout.
|
|
17
16
|
* Once set for a server, subsequent list calls await the already-resolved promise
|
|
@@ -24,16 +23,16 @@ export declare class McpGatewayToolBrokerChannel extends Disposable implements I
|
|
|
24
23
|
*/
|
|
25
24
|
private readonly _startupGrace;
|
|
26
25
|
constructor(_mcpService: IMcpService, _logService: ILogService, _startupGracePeriodMs?: number);
|
|
27
|
-
private
|
|
28
|
-
private _getServerByIndex;
|
|
26
|
+
private _getServerById;
|
|
29
27
|
private _waitForStartup;
|
|
30
28
|
private _shouldUseCachedData;
|
|
31
29
|
listen<T>(_ctx: unknown, event: string): Event<T>;
|
|
32
30
|
call<T>(_ctx: unknown, command: string, arg?: unknown, cancellationToken?: CancellationToken): Promise<T>;
|
|
33
|
-
private
|
|
34
|
-
private
|
|
35
|
-
private
|
|
36
|
-
private
|
|
37
|
-
private
|
|
31
|
+
private _listServers;
|
|
32
|
+
private _listToolsForServer;
|
|
33
|
+
private _callToolForServer;
|
|
34
|
+
private _listResourcesForServer;
|
|
35
|
+
private _readResourceForServer;
|
|
36
|
+
private _listResourceTemplatesForServer;
|
|
38
37
|
private _ensureServerReady;
|
|
39
38
|
}
|