@codingame/monaco-vscode-mcp-service-override 37.2.0 → 37.3.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/common.d.ts +2 -0
- package/common.js +56 -0
- package/index.d.ts +1 -2
- package/index.js +1 -52
- package/package.json +10 -2
- package/session.d.ts +1 -0
- package/session.js +2 -0
- package/vscode/src/vs/platform/mcp/common/allowedMcpServersService.js +3 -3
- package/vscode/src/vs/platform/mcp/common/mcpGalleryService.js +8 -8
- package/vscode/src/vs/platform/mcp/common/mcpResourceScannerService.js +7 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +18 -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 +108 -108
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +47 -47
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpGatewayService.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +37 -37
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpMigration.js +20 -16
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess.js +52 -50
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +45 -43
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +18 -18
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +14 -14
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +8 -6
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +13 -13
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpGatewayToolBrokerChannel.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +25 -25
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpResourceFilesystem.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js +28 -24
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSandboxService.js +6 -6
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.js +13 -11
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +13 -18
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpUsageService.js +3 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.service.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.service.js +0 -6
|
@@ -167,7 +167,7 @@ let PublisherWidget = class PublisherWidget extends McpServerWidget {
|
|
|
167
167
|
this.element.setAttribute("role", "button");
|
|
168
168
|
this.element.tabIndex = 0;
|
|
169
169
|
this.containerHover = this.disposables.add(
|
|
170
|
-
this.hoverService.setupManagedHover(getDefaultHoverDelegate("mouse"), this.element, ( localize(
|
|
170
|
+
this.hoverService.setupManagedHover(getDefaultHoverDelegate("mouse"), this.element, ( localize(16171, "Publisher ({0})", this.mcpServer.publisherDisplayName)))
|
|
171
171
|
);
|
|
172
172
|
append(this.element, publisherDisplayName);
|
|
173
173
|
if (this.mcpServer.gallery?.publisherDomain?.verified) {
|
|
@@ -176,7 +176,7 @@ let PublisherWidget = class PublisherWidget extends McpServerWidget {
|
|
|
176
176
|
verifiedPublisher.tabIndex = 0;
|
|
177
177
|
verifiedPublisher.setAttribute("role", "button");
|
|
178
178
|
this.containerHover.update(( localize(
|
|
179
|
-
|
|
179
|
+
16172,
|
|
180
180
|
"This publisher has verified ownership of {0}",
|
|
181
181
|
this.mcpServer.gallery?.publisherDomain.link
|
|
182
182
|
)));
|
|
@@ -325,12 +325,12 @@ let McpServerHoverWidget = class McpServerHoverWidget extends McpServerWidget {
|
|
|
325
325
|
let addSeparator = false;
|
|
326
326
|
if (this.mcpServer.local?.scope === LocalMcpServerScope.Workspace) {
|
|
327
327
|
markdown.appendMarkdown(`$(${mcpServerWorkspaceIcon.id}) `);
|
|
328
|
-
markdown.appendMarkdown(( localize(
|
|
328
|
+
markdown.appendMarkdown(( localize(16173, "Workspace MCP Server")));
|
|
329
329
|
addSeparator = true;
|
|
330
330
|
}
|
|
331
331
|
if (this.mcpServer.local?.scope === LocalMcpServerScope.RemoteUser) {
|
|
332
332
|
markdown.appendMarkdown(`$(${mcpServerRemoteIcon.id}) `);
|
|
333
|
-
markdown.appendMarkdown(( localize(
|
|
333
|
+
markdown.appendMarkdown(( localize(16174, "Remote MCP Server")));
|
|
334
334
|
addSeparator = true;
|
|
335
335
|
}
|
|
336
336
|
if (this.mcpServer.installState === McpServerInstallState.Installed) {
|
|
@@ -448,7 +448,7 @@ const mcpStarredIconColor = registerColor("mcpIcon.starForeground", {
|
|
|
448
448
|
dark: "#FF8E00",
|
|
449
449
|
hcDark: "#FF8E00",
|
|
450
450
|
hcLight: textLinkForeground
|
|
451
|
-
}, ( localize(
|
|
451
|
+
}, ( localize(16175, "The icon color for mcp starred.")), false);
|
|
452
452
|
registerThemingParticipant((theme, collector) => {
|
|
453
453
|
const mcpStarredIconColorValue = theme.getColor(mcpStarredIconColor);
|
|
454
454
|
if (mcpStarredIconColorValue) {
|
|
@@ -53,7 +53,7 @@ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log
|
|
|
53
53
|
import { buildModalNavigationForPagedList } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/browser/extensionsViewer';
|
|
54
54
|
|
|
55
55
|
var McpServerRenderer_1;
|
|
56
|
-
registerCss(mcpServersView);
|
|
56
|
+
registerCss(mcpServersView, 1);
|
|
57
57
|
let McpServersListView = class McpServersListView extends AbstractExtensionsListView {
|
|
58
58
|
constructor(
|
|
59
59
|
mpcViewOptions,
|
|
@@ -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(16176, "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(16177, "MCP Servers"));
|
|
255
255
|
const settingsCommandLink = ( createMarkdownCommandLink({
|
|
256
256
|
id: "workbench.action.openSettings",
|
|
257
257
|
arguments: [`@id:${mcpGalleryServiceEnablementConfig}`],
|
|
258
258
|
text: mcpGalleryServiceEnablementConfig,
|
|
259
|
-
tooltip: ( localize(
|
|
259
|
+
tooltip: ( localize(16178, "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
|
+
16179,
|
|
264
264
|
"Browse and install [Model Context Protocol (MCP) servers](https://code.visualstudio.com/docs/agent-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
|
+
16180,
|
|
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(16181, "Enable MCP Servers Marketplace")),
|
|
278
278
|
...defaultButtonStyles
|
|
279
279
|
})));
|
|
280
|
-
button.label = ( localize(
|
|
280
|
+
button.label = ( localize(16181, "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(16182, "Enable MCP Servers Marketplace?")),
|
|
287
287
|
custom: {
|
|
288
288
|
markdownDetails: [{
|
|
289
289
|
markdown: ( new MarkdownString(( localize(
|
|
290
|
-
|
|
290
|
+
16180,
|
|
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(16183, "Enable")),
|
|
300
300
|
run: () => true
|
|
301
301
|
}, {
|
|
302
|
-
label: ( localize(
|
|
302
|
+
label: ( localize(16184, "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(16185, "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(16186, "MCP Servers - Installed")),
|
|
537
537
|
ctorDescriptor: ( new SyncDescriptor(McpServersListView, [{}])),
|
|
538
538
|
when: ( ContextKeyExpr.and(DefaultViewsContext, HasInstalledMcpServersContext, ( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabledInWorkspace.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(16187, "MCP Servers")),
|
|
545
545
|
ctorDescriptor: ( new SyncDescriptor(DefaultBrowseMcpServersView, [{}])),
|
|
546
546
|
when: ( ContextKeyExpr.and(DefaultViewsContext, ( HasInstalledMcpServersContext.toNegated()), ( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabledInWorkspace.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(16187, "MCP Servers")),
|
|
553
553
|
ctorDescriptor: ( new SyncDescriptor(McpServersListView, [{}])),
|
|
554
554
|
when: ( ContextKeyExpr.and(SearchMcpServersContext, ( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabledInWorkspace.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(16187, "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(16187, "MCP Servers")),
|
|
568
568
|
ctorDescriptor: ( new SyncDescriptor(McpServersListView, [{
|
|
569
569
|
showWelcome: true
|
|
570
570
|
}])),
|
|
@@ -567,7 +567,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
567
567
|
const registryGeneration = this.registryGeneration;
|
|
568
568
|
const pager = await this.mcpGalleryService.query(options, token);
|
|
569
569
|
const mapPage = page => ({
|
|
570
|
-
items:
|
|
570
|
+
items: page.items.map(
|
|
571
571
|
gallery => this.fromGallery(gallery, registryGeneration) ?? this.instantiationService.createInstance(
|
|
572
572
|
McpWorkbenchServer,
|
|
573
573
|
e => this.getInstallState(e),
|
|
@@ -576,7 +576,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
576
576
|
gallery,
|
|
577
577
|
undefined
|
|
578
578
|
)
|
|
579
|
-
)
|
|
579
|
+
),
|
|
580
580
|
hasMore: page.hasMore
|
|
581
581
|
});
|
|
582
582
|
return {
|
|
@@ -596,7 +596,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
596
596
|
if (generation !== this.localQueryGeneration) {
|
|
597
597
|
return false;
|
|
598
598
|
}
|
|
599
|
-
this._local = this.sort(
|
|
599
|
+
this._local = this.sort(installed.map(i => {
|
|
600
600
|
const existing = this._local.find(local => local.id === i.id);
|
|
601
601
|
const local = existing ?? this.instantiationService.createInstance(
|
|
602
602
|
McpWorkbenchServer,
|
|
@@ -608,7 +608,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
608
608
|
);
|
|
609
609
|
local.local = i;
|
|
610
610
|
return local;
|
|
611
|
-
}))
|
|
611
|
+
}));
|
|
612
612
|
this._onChange.fire(undefined);
|
|
613
613
|
return true;
|
|
614
614
|
}
|
|
@@ -658,7 +658,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
658
658
|
const existing = result.get(server.name);
|
|
659
659
|
if (existing) {
|
|
660
660
|
this.logService.warn(( localize(
|
|
661
|
-
|
|
661
|
+
16189,
|
|
662
662
|
"Overwriting mcp server '{0}' from {1} with {2}.",
|
|
663
663
|
server.name,
|
|
664
664
|
server.mcpResource.path,
|
|
@@ -671,7 +671,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
671
671
|
const existing = result.get(server.name);
|
|
672
672
|
if (existing) {
|
|
673
673
|
this.logService.warn(( localize(
|
|
674
|
-
|
|
674
|
+
16189,
|
|
675
675
|
"Overwriting mcp server '{0}' from {1} with {2}.",
|
|
676
676
|
server.name,
|
|
677
677
|
server.mcpResource.path,
|
|
@@ -684,7 +684,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
684
684
|
}
|
|
685
685
|
canInstall(mcpServer) {
|
|
686
686
|
if (!(mcpServer instanceof McpWorkbenchServer)) {
|
|
687
|
-
return ( new MarkdownString()).appendText(( localize(
|
|
687
|
+
return ( new MarkdownString()).appendText(( localize(16190, "The provided object is not an mcp server.")));
|
|
688
688
|
}
|
|
689
689
|
if (mcpServer.gallery) {
|
|
690
690
|
const result = this.mcpManagementService.canInstall(mcpServer.gallery);
|
|
@@ -701,7 +701,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
701
701
|
return result;
|
|
702
702
|
}
|
|
703
703
|
return ( new MarkdownString()).appendText(( localize(
|
|
704
|
-
|
|
704
|
+
16191,
|
|
705
705
|
"Cannot install the '{0}' MCP Server because it is not available in this setup.",
|
|
706
706
|
mcpServer.label
|
|
707
707
|
)));
|
|
@@ -808,7 +808,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
808
808
|
id: USER_CONFIG_ID,
|
|
809
809
|
key: "userLocalValue",
|
|
810
810
|
target: ConfigurationTarget.USER_LOCAL,
|
|
811
|
-
label: ( localize(
|
|
811
|
+
label: ( localize(16192, "Global in {0}", this.productService.nameShort)),
|
|
812
812
|
scope: StorageScope.PROFILE,
|
|
813
813
|
order: McpCollectionSortOrder.User,
|
|
814
814
|
uri: mcpResource,
|
|
@@ -1019,7 +1019,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
1019
1019
|
state: McpServerEnablementState.DisabledProfile,
|
|
1020
1020
|
message: {
|
|
1021
1021
|
severity: Severity.Info,
|
|
1022
|
-
text: ( new MarkdownString(( localize(
|
|
1022
|
+
text: ( new MarkdownString(( localize(16193, "This MCP server is disabled."))))
|
|
1023
1023
|
}
|
|
1024
1024
|
};
|
|
1025
1025
|
}
|
|
@@ -1028,7 +1028,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
1028
1028
|
state: McpServerEnablementState.DisabledWorkspace,
|
|
1029
1029
|
message: {
|
|
1030
1030
|
severity: Severity.Info,
|
|
1031
|
-
text: ( new MarkdownString(( localize(
|
|
1031
|
+
text: ( new MarkdownString(( localize(16194, "This MCP server is disabled for this workspace."))))
|
|
1032
1032
|
}
|
|
1033
1033
|
};
|
|
1034
1034
|
}
|
|
@@ -1048,7 +1048,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
1048
1048
|
message: {
|
|
1049
1049
|
severity: Severity.Warning,
|
|
1050
1050
|
text: ( new MarkdownString(( localize(
|
|
1051
|
-
|
|
1051
|
+
16195,
|
|
1052
1052
|
"This MCP Server is disabled because MCP servers are configured to be disabled in the Editor. Please check your [settings]({0}).",
|
|
1053
1053
|
settingsCommandLink
|
|
1054
1054
|
))))
|
|
@@ -1062,7 +1062,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
1062
1062
|
message: {
|
|
1063
1063
|
severity: Severity.Warning,
|
|
1064
1064
|
text: ( new MarkdownString(( localize(
|
|
1065
|
-
|
|
1065
|
+
16196,
|
|
1066
1066
|
"This MCP Server is disabled because it is configured to be disabled in the Editor. Please check your [settings]({0}).",
|
|
1067
1067
|
settingsCommandLink
|
|
1068
1068
|
))))
|
|
@@ -1076,7 +1076,7 @@ let McpWorkbenchService = class McpWorkbenchService extends Disposable {
|
|
|
1076
1076
|
message: {
|
|
1077
1077
|
severity: Severity.Warning,
|
|
1078
1078
|
text: ( new MarkdownString(( localize(
|
|
1079
|
-
|
|
1079
|
+
16196,
|
|
1080
1080
|
"This MCP Server is disabled because it is configured to be disabled in the Editor. Please check your [settings]({0}).",
|
|
1081
1081
|
settingsCommandLink
|
|
1082
1082
|
))))
|
|
@@ -49,7 +49,7 @@ let ExtensionMcpDiscovery = ExtensionMcpDiscovery_1 = class ExtensionMcpDiscover
|
|
|
49
49
|
if (defs) {
|
|
50
50
|
updated = true;
|
|
51
51
|
this.cachedServers[collectionId] = {
|
|
52
|
-
servers:
|
|
52
|
+
servers: defs.map(McpServerDefinition.toSerialized)
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -139,24 +139,26 @@ let ExtensionMcpDiscovery = ExtensionMcpDiscovery_1 = class ExtensionMcpDiscover
|
|
|
139
139
|
}
|
|
140
140
|
async _activateExtensionServers(collectionId) {
|
|
141
141
|
await this._extensionService.activateByEvent(mcpActivationEvent(collectionId));
|
|
142
|
-
await Promise.all(
|
|
142
|
+
await Promise.all(
|
|
143
|
+
this._mcpRegistry.delegates.get().map(r => r.waitForInitialProviderPromises())
|
|
144
|
+
);
|
|
143
145
|
}
|
|
144
146
|
static _validate(user) {
|
|
145
147
|
if (!Array.isArray(user.value)) {
|
|
146
|
-
user.collector.error(( localize(
|
|
148
|
+
user.collector.error(( localize(16197, "Expected an array of MCP collections")));
|
|
147
149
|
return false;
|
|
148
150
|
}
|
|
149
151
|
for (const contribution of user.value) {
|
|
150
152
|
if (typeof contribution.id !== "string" || isFalsyOrWhitespace(contribution.id)) {
|
|
151
|
-
user.collector.error(( localize(
|
|
153
|
+
user.collector.error(( localize(16198, "Expected 'id' to be a non-empty string.")));
|
|
152
154
|
return false;
|
|
153
155
|
}
|
|
154
156
|
if (typeof contribution.label !== "string" || isFalsyOrWhitespace(contribution.label)) {
|
|
155
|
-
user.collector.error(( localize(
|
|
157
|
+
user.collector.error(( localize(16199, "Expected 'label' to be a non-empty string.")));
|
|
156
158
|
return false;
|
|
157
159
|
}
|
|
158
160
|
if (contribution.when !== undefined && (typeof contribution.when !== "string" || isFalsyOrWhitespace(contribution.when))) {
|
|
159
|
-
user.collector.error(( localize(
|
|
161
|
+
user.collector.error(( localize(16200, "Expected 'when' to be a non-empty string.")));
|
|
160
162
|
return false;
|
|
161
163
|
}
|
|
162
164
|
}
|
|
@@ -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
|
+
16201,
|
|
90
90
|
" on {0}",
|
|
91
91
|
labelService.getHostLabel(Schemas.vscodeRemote, remoteAuthority)
|
|
92
92
|
));
|
|
@@ -11,7 +11,7 @@ async function claudeConfigToServerDefinition(idPrefix, contents, options) {
|
|
|
11
11
|
} catch {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
return Promise.all(
|
|
14
|
+
return Promise.all(Object.entries(parsed.mcpServers).map(async ([name, server]) => {
|
|
15
15
|
const launch = server.url ? {
|
|
16
16
|
type: McpServerTransportType.HTTP,
|
|
17
17
|
uri: ( URI.parse(server.url)),
|
|
@@ -37,7 +37,7 @@ async function claudeConfigToServerDefinition(idPrefix, contents, options) {
|
|
|
37
37
|
defaultCwd,
|
|
38
38
|
cacheNonce: await McpServerLaunch.hash(nonceLaunch)
|
|
39
39
|
};
|
|
40
|
-
}))
|
|
40
|
+
}));
|
|
41
41
|
}
|
|
42
42
|
class ClaudeDesktopMpcDiscoveryAdapter {
|
|
43
43
|
constructor(remoteAuthority) {
|
|
@@ -12,22 +12,22 @@ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/obse
|
|
|
12
12
|
|
|
13
13
|
var McpContextKeys;
|
|
14
14
|
(function(McpContextKeys) {
|
|
15
|
-
McpContextKeys.serverCount =
|
|
15
|
+
McpContextKeys.serverCount = new RawContextKey("mcp.serverCount", undefined, {
|
|
16
16
|
type: "number",
|
|
17
|
-
description: ( localize(
|
|
18
|
-
})
|
|
19
|
-
McpContextKeys.hasUnknownTools =
|
|
17
|
+
description: ( localize(16247, "Context key that has the number of registered MCP servers"))
|
|
18
|
+
});
|
|
19
|
+
McpContextKeys.hasUnknownTools = new RawContextKey("mcp.hasUnknownTools", undefined, {
|
|
20
20
|
type: "boolean",
|
|
21
|
-
description: ( localize(
|
|
22
|
-
})
|
|
23
|
-
McpContextKeys.hasServersWithErrors =
|
|
21
|
+
description: ( localize(16248, "Indicates whether there are MCP servers with unknown tools."))
|
|
22
|
+
});
|
|
23
|
+
McpContextKeys.hasServersWithErrors = new RawContextKey("mcp.hasServersWithErrors", undefined, {
|
|
24
24
|
type: "boolean",
|
|
25
|
-
description: ( localize(
|
|
26
|
-
})
|
|
27
|
-
McpContextKeys.toolsCount =
|
|
25
|
+
description: ( localize(16249, "Indicates whether there are any MCP servers with errors."))
|
|
26
|
+
});
|
|
27
|
+
McpContextKeys.toolsCount = new RawContextKey("mcp.toolsCount", undefined, {
|
|
28
28
|
type: "number",
|
|
29
|
-
description: ( localize(
|
|
30
|
-
})
|
|
29
|
+
description: ( localize(16250, "Context key that has the number of registered MCP tools"))
|
|
30
|
+
});
|
|
31
31
|
})(McpContextKeys || (McpContextKeys = {}));
|
|
32
32
|
let McpContextKeysController = class McpContextKeysController extends Disposable {
|
|
33
33
|
static {
|
|
@@ -45,7 +45,7 @@ let McpContextKeysController = class McpContextKeysController extends Disposable
|
|
|
45
45
|
));
|
|
46
46
|
this._store.add(autorun(r => {
|
|
47
47
|
const servers = mcpService.servers.read(r);
|
|
48
|
-
const serverTools =
|
|
48
|
+
const serverTools = servers.map(s => s.tools.read(r));
|
|
49
49
|
ctxServerCount.set(servers.length);
|
|
50
50
|
ctxToolsCount.set(serverTools.reduce((count, tools) => count + tools.length, 0));
|
|
51
51
|
ctxHasUnknownTools.set(
|
|
@@ -49,10 +49,10 @@ class McpGatewayToolBrokerChannel extends Disposable {
|
|
|
49
49
|
const servers = this._mcpService.servers.read(reader);
|
|
50
50
|
if (serversInitialized) {
|
|
51
51
|
this._logService.debug("[McpGateway][ToolBroker] Servers changed, firing onDidChangeServers");
|
|
52
|
-
this._onDidChangeServers.fire(
|
|
52
|
+
this._onDidChangeServers.fire(servers.map(s => ({
|
|
53
53
|
id: s.definition.id,
|
|
54
54
|
label: s.definition.label
|
|
55
|
-
})))
|
|
55
|
+
})));
|
|
56
56
|
} else {
|
|
57
57
|
serversInitialized = true;
|
|
58
58
|
}
|
|
@@ -172,7 +172,7 @@ class McpGatewayToolBrokerChannel extends Disposable {
|
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
this._logService.debug(
|
|
175
|
-
`[McpGateway][ToolBroker] listServers result: ${result.length} server(s): [${
|
|
175
|
+
`[McpGateway][ToolBroker] listServers result: ${result.length} server(s): [${result.map(s => s.label).join(", ")}]`
|
|
176
176
|
);
|
|
177
177
|
return result;
|
|
178
178
|
}
|
|
@@ -190,7 +190,7 @@ class McpGatewayToolBrokerChannel extends Disposable {
|
|
|
190
190
|
);
|
|
191
191
|
return [];
|
|
192
192
|
}
|
|
193
|
-
const tools =
|
|
193
|
+
const tools = server.tools.get().filter(t => t.visibility & McpToolVisibility.Model).map(t => t.definition);
|
|
194
194
|
this._logService.debug(
|
|
195
195
|
`[McpGateway][ToolBroker] listToolsForServer '${serverId}': ${tools.length} tool(s)`
|
|
196
196
|
);
|
|
@@ -71,7 +71,7 @@ let McpLanguageModelToolContribution = class McpLanguageModelToolContribution ex
|
|
|
71
71
|
const toolSet = store.add(
|
|
72
72
|
this._toolsService.createToolSet(source, server.definition.id, referenceName, {
|
|
73
73
|
icon: Codicon.mcp,
|
|
74
|
-
description: ( localize(
|
|
74
|
+
description: ( localize(16253, "{0}: All Tools", server.definition.label)),
|
|
75
75
|
deprecated: true
|
|
76
76
|
})
|
|
77
77
|
);
|
|
@@ -90,7 +90,7 @@ let McpLanguageModelToolContribution = class McpLanguageModelToolContribution ex
|
|
|
90
90
|
}
|
|
91
91
|
_syncTools(server, collectionData, store) {
|
|
92
92
|
const tools = ( new Map());
|
|
93
|
-
const collectionObservable =
|
|
93
|
+
const collectionObservable = this._mcpRegistry.collections.map(collections => collections.find(c => c.id === server.collection.id));
|
|
94
94
|
store.add(autorun(reader => {
|
|
95
95
|
const toDelete = ( new Set(( tools.keys())));
|
|
96
96
|
const toRegister = [];
|
|
@@ -192,7 +192,7 @@ let McpToolImplementation = class McpToolImplementation {
|
|
|
192
192
|
});
|
|
193
193
|
const isSandboxedServer = sandboxEnabled === true;
|
|
194
194
|
const mcpToolWarning = ( localize(
|
|
195
|
-
|
|
195
|
+
16254,
|
|
196
196
|
"Note that MCP servers or malicious conversation content may attempt to misuse '{0}' through tools.",
|
|
197
197
|
this._productService.nameShort
|
|
198
198
|
));
|
|
@@ -201,7 +201,7 @@ let McpToolImplementation = class McpToolImplementation {
|
|
|
201
201
|
if (!isSandboxedServer) {
|
|
202
202
|
confirm = {};
|
|
203
203
|
if (!tool.definition.annotations?.readOnlyHint) {
|
|
204
|
-
confirm.title = ( new MarkdownString(( localize(
|
|
204
|
+
confirm.title = ( new MarkdownString(( localize(16255, "Run {0}", title))));
|
|
205
205
|
confirm.message = ( new MarkdownString(tool.definition.description, {
|
|
206
206
|
supportThemeIcons: true
|
|
207
207
|
}));
|
|
@@ -215,9 +215,9 @@ let McpToolImplementation = class McpToolImplementation {
|
|
|
215
215
|
const mcpUiEnabled = this._configurationService.getValue(mcpAppsEnabledConfig);
|
|
216
216
|
return {
|
|
217
217
|
confirmationMessages: confirm,
|
|
218
|
-
invocationMessage: ( new MarkdownString(( localize(
|
|
219
|
-
pastTenseMessage: ( new MarkdownString(( localize(
|
|
220
|
-
originMessage: ( localize(
|
|
218
|
+
invocationMessage: ( new MarkdownString(( localize(16256, "Running {0}", title)))),
|
|
219
|
+
pastTenseMessage: ( new MarkdownString(( localize(16257, "Ran {0} ", title)))),
|
|
220
|
+
originMessage: ( localize(16258, "{0} (MCP Server)", server.definition.label)),
|
|
221
221
|
toolSpecificData: {
|
|
222
222
|
kind: "input",
|
|
223
223
|
rawInput: context.parameters,
|