@codingame/monaco-vscode-mcp-service-override 31.0.1 → 32.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/platform/mcp/common/allowedMcpServersService.js +1 -1
- package/vscode/src/vs/platform/mcp/common/mcpGalleryService.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js +7 -11
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.js +80 -80
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +25 -25
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +47 -25
- 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/mcpServerEditor.d.ts +72 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +1023 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +49 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.js +12 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.d.ts +88 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +372 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +11 -11
- package/vscode/src/vs/workbench/contrib/mcp/browser/media/mcpServerEditor.css +98 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +6 -5
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/installedMcpServersDiscovery.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/pluginMcpDiscovery.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceDotMcpDiscovery.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceDotMcpDiscovery.js +92 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceMcpDiscoveryAdapter.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.js +10 -8
- 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.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.d.ts +28 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.js +88 -3
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +9 -9
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.d.ts +0 -59
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +0 -576
- package/vscode/src/vs/workbench/contrib/mcp/browser/media/mcpServersView.css +0 -53
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-mcp-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "32.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - mcp service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "32.0.0"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -27,7 +27,7 @@ let AllowedMcpServersService = class AllowedMcpServersService extends Disposable
|
|
|
27
27
|
query: `@id:${mcpAccessConfig}`
|
|
28
28
|
}).toString());
|
|
29
29
|
return (new MarkdownString(localize(
|
|
30
|
-
|
|
30
|
+
2054,
|
|
31
31
|
"Model Context Protocol servers are disabled in the Editor. Please check your [settings]({0}).",
|
|
32
32
|
settingsCommandLink
|
|
33
33
|
)));
|
|
@@ -456,7 +456,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
456
456
|
async getReadme(gallery, token) {
|
|
457
457
|
const readmeUrl = gallery.readmeUrl;
|
|
458
458
|
if (!readmeUrl) {
|
|
459
|
-
return Promise.resolve(( localize(
|
|
459
|
+
return Promise.resolve(( localize(2055, "No README available")));
|
|
460
460
|
}
|
|
461
461
|
const uri = ( URI.parse(readmeUrl));
|
|
462
462
|
if (uri.scheme === Schemas.file) {
|
|
@@ -468,7 +468,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
470
|
if (uri.authority !== "raw.githubusercontent.com") {
|
|
471
|
-
return ( new MarkdownString(( localize(
|
|
471
|
+
return ( new MarkdownString(( localize(2056, "You can find information about this server [here]({0})", readmeUrl)))).value;
|
|
472
472
|
}
|
|
473
473
|
const context = await this.requestService.request({
|
|
474
474
|
type: "GET",
|
|
@@ -19,6 +19,7 @@ import { mcpDiscoveryRegistry } from '../common/discovery/mcpDiscovery.js';
|
|
|
19
19
|
import { RemoteNativeMpcDiscovery } from '../common/discovery/nativeMcpRemoteDiscovery.js';
|
|
20
20
|
import { PluginMcpDiscovery } from '../common/discovery/pluginMcpDiscovery.js';
|
|
21
21
|
import { CursorWorkspaceMcpDiscoveryAdapter } from '../common/discovery/workspaceMcpDiscoveryAdapter.js';
|
|
22
|
+
import { WorkspaceDotMcpDiscovery } from '../common/discovery/workspaceDotMcpDiscovery.js';
|
|
22
23
|
import { McpCommandIds } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpCommandIds';
|
|
23
24
|
import { mcpServerSchema } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
|
|
24
25
|
import { McpContextKeysController } from '../common/mcpContextKeys.js';
|
|
@@ -39,15 +40,15 @@ import './mcpElicitationService.js';
|
|
|
39
40
|
import { McpLanguageFeatures } from './mcpLanguageFeatures.js';
|
|
40
41
|
import { McpConfigMigrationContribution } from './mcpMigration.js';
|
|
41
42
|
import { McpResourceQuickAccess } from './mcpResourceQuickAccess.js';
|
|
42
|
-
import { McpServerEditor } from '
|
|
43
|
-
import { McpServerEditorInput } from '
|
|
44
|
-
import { McpServersViewsContribution } from './mcpServersView.js';
|
|
43
|
+
import { McpServerEditor } from './mcpServerEditor.js';
|
|
44
|
+
import { McpServerEditorInput } from './mcpServerEditorInput.js';
|
|
45
45
|
import { MCPContextsInitialisation } from './mcpWorkbenchService.js';
|
|
46
46
|
|
|
47
47
|
mcpDiscoveryRegistry.register(( new SyncDescriptor(RemoteNativeMpcDiscovery)));
|
|
48
48
|
mcpDiscoveryRegistry.register(( new SyncDescriptor(InstalledMcpServersDiscovery)));
|
|
49
49
|
mcpDiscoveryRegistry.register(( new SyncDescriptor(ExtensionMcpDiscovery)));
|
|
50
50
|
mcpDiscoveryRegistry.register(( new SyncDescriptor(CursorWorkspaceMcpDiscoveryAdapter)));
|
|
51
|
+
mcpDiscoveryRegistry.register(( new SyncDescriptor(WorkspaceDotMcpDiscovery)));
|
|
51
52
|
mcpDiscoveryRegistry.register(( new SyncDescriptor(PluginMcpDiscovery)));
|
|
52
53
|
registerWorkbenchContribution2("mcpDiscovery", McpDiscovery, WorkbenchPhase.AfterRestored);
|
|
53
54
|
registerWorkbenchContribution2("mcpContextKeys", McpContextKeysController, WorkbenchPhase.BlockRestore);
|
|
@@ -107,24 +108,19 @@ registerWorkbenchContribution2(
|
|
|
107
108
|
McpConfigMigrationContribution,
|
|
108
109
|
WorkbenchPhase.Eventually
|
|
109
110
|
);
|
|
110
|
-
registerWorkbenchContribution2(
|
|
111
|
-
McpServersViewsContribution.ID,
|
|
112
|
-
McpServersViewsContribution,
|
|
113
|
-
WorkbenchPhase.AfterRestored
|
|
114
|
-
);
|
|
115
111
|
const jsonRegistry = ( Registry.as(Extensions.JSONContribution));
|
|
116
112
|
jsonRegistry.registerSchema(mcpSchemaId, mcpServerSchema);
|
|
117
113
|
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(
|
|
118
|
-
EditorPaneDescriptor.create(McpServerEditor, McpServerEditor.ID, ( localize(
|
|
114
|
+
EditorPaneDescriptor.create(McpServerEditor, McpServerEditor.ID, ( localize(10836, "MCP Server"))),
|
|
119
115
|
[( new SyncDescriptor(McpServerEditorInput))]
|
|
120
116
|
);
|
|
121
117
|
( Registry.as(Extensions$1.Quickaccess)).registerQuickAccessProvider({
|
|
122
118
|
ctor: McpResourceQuickAccess,
|
|
123
119
|
prefix: McpResourceQuickAccess.PREFIX,
|
|
124
120
|
when: ChatContextKeys.enabled,
|
|
125
|
-
placeholder: ( localize(
|
|
121
|
+
placeholder: ( localize(10837, "Filter to an MCP resource")),
|
|
126
122
|
helpEntries: [{
|
|
127
|
-
description: ( localize(
|
|
123
|
+
description: ( localize(10838, "MCP Server Resources")),
|
|
128
124
|
commandId: McpCommandIds.AddConfiguration
|
|
129
125
|
}]
|
|
130
126
|
});
|
|
@@ -43,7 +43,7 @@ let McpAddContextContribution = class McpAddContextContribution extends Disposab
|
|
|
43
43
|
_registerAddContextMenu() {
|
|
44
44
|
this._addContextMenu.value = this._chatContextPickService.registerChatContextItem({
|
|
45
45
|
type: "pickerPick",
|
|
46
|
-
label: ( localize(
|
|
46
|
+
label: ( localize(10839, "MCP Resources...")),
|
|
47
47
|
icon: Codicon.mcp,
|
|
48
48
|
isEnabled(widget) {
|
|
49
49
|
return !!widget.attachmentCapabilities.supportsMCPAttachments;
|
|
@@ -51,7 +51,7 @@ let McpAddContextContribution = class McpAddContextContribution extends Disposab
|
|
|
51
51
|
asPicker: () => {
|
|
52
52
|
const helper = this._instantiationService.createInstance(McpResourcePickHelper);
|
|
53
53
|
return {
|
|
54
|
-
placeholder: ( localize(
|
|
54
|
+
placeholder: ( localize(10840, "Select MCP Resource...")),
|
|
55
55
|
picks: (_query, token) => this._getResourcePicks(token, helper),
|
|
56
56
|
goBack: () => {
|
|
57
57
|
return helper.navigateBack();
|
|
@@ -48,21 +48,20 @@ import { ChatViewId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/con
|
|
|
48
48
|
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
49
49
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
|
|
50
50
|
import { ChatModeKind, ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
51
|
+
import { isContributionDisabled, ContributionEnablementState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/enablement';
|
|
51
52
|
import { ILanguageModelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service';
|
|
52
53
|
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service';
|
|
53
|
-
import {
|
|
54
|
-
import { extensionsFilterSubMenu } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions';
|
|
54
|
+
import { extensionsFilterSubMenu, VIEWLET_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions';
|
|
55
55
|
import { IExtensionsWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions.service';
|
|
56
56
|
import { TEXT_FILE_EDITOR_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/files/common/files';
|
|
57
57
|
import { McpCommandIds } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpCommandIds';
|
|
58
58
|
import { McpContextKeys } from '../common/mcpContextKeys.js';
|
|
59
59
|
import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
|
|
60
60
|
import { McpConnectionState, McpCapability, McpServerCacheState, LazyCollectionState, McpStartServerInteraction, InstalledMcpServersViewId, HasInstalledMcpServersContext, mcpPromptPrefix } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
|
|
61
|
-
import { IMcpService,
|
|
61
|
+
import { IMcpService, IMcpSamplingService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
|
|
62
|
+
import { startServerAndWaitForLiveTools } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypesUtils';
|
|
62
63
|
import { McpAddConfigurationCommand, McpInstallFromManifestCommand } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/browser/mcpCommandsAddConfiguration';
|
|
63
64
|
import { McpResourceQuickPick, McpResourceQuickAccess } from './mcpResourceQuickAccess.js';
|
|
64
|
-
import { startServerAndWaitForLiveTools } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypesUtils';
|
|
65
|
-
import { isContributionDisabled } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/enablement';
|
|
66
65
|
import * as mcpServerAction from './media/mcpServerAction.css';
|
|
67
66
|
import { openPanelChatAndGetWidget } from './openPanelChatAndGetWidget.js';
|
|
68
67
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
@@ -79,7 +78,7 @@ class ListMcpServerCommand extends Action2 {
|
|
|
79
78
|
constructor() {
|
|
80
79
|
super({
|
|
81
80
|
id: McpCommandIds.ListServer,
|
|
82
|
-
title: ( localize2(
|
|
81
|
+
title: ( localize2(10841, "List Servers")),
|
|
83
82
|
icon: Codicon.server,
|
|
84
83
|
category,
|
|
85
84
|
f1: true,
|
|
@@ -96,23 +95,23 @@ class ListMcpServerCommand extends Action2 {
|
|
|
96
95
|
const mcpService = accessor.get(IMcpService);
|
|
97
96
|
const commandService = accessor.get(ICommandService);
|
|
98
97
|
const quickInput = accessor.get(IQuickInputService);
|
|
99
|
-
const mcpWorkbenchService = accessor.get(IMcpWorkbenchService);
|
|
100
98
|
const store = ( new DisposableStore());
|
|
101
99
|
const pick = quickInput.createQuickPick({
|
|
102
100
|
useSeparators: true
|
|
103
101
|
});
|
|
104
|
-
pick.placeholder = ( localize(
|
|
102
|
+
pick.placeholder = ( localize(10842, "Select an MCP Server"));
|
|
105
103
|
mcpService.activateCollections();
|
|
106
104
|
store.add(pick);
|
|
107
105
|
store.add(autorun(reader => {
|
|
108
|
-
const servers = groupBy(
|
|
109
|
-
(a, b) =>
|
|
110
|
-
|
|
106
|
+
const servers = groupBy(
|
|
107
|
+
mcpService.servers.read(reader).slice().sort((a, b) => a.collection.order - b.collection.order),
|
|
108
|
+
s => s.collection.id
|
|
109
|
+
);
|
|
111
110
|
const firstRun = pick.items.length === 0;
|
|
112
111
|
pick.items = [{
|
|
113
112
|
id: "$add",
|
|
114
|
-
label: ( localize(
|
|
115
|
-
description: ( localize(
|
|
113
|
+
label: ( localize(10843, "Add Server")),
|
|
114
|
+
description: ( localize(10844, "Add a new server configuration")),
|
|
116
115
|
alwaysShow: true,
|
|
117
116
|
iconClass: ThemeIcon.asClassName(Codicon.add)
|
|
118
117
|
}, ...( Object.values(servers)).filter(s => s.length).flatMap(servers => [{
|
|
@@ -124,7 +123,7 @@ class ListMcpServerCommand extends Action2 {
|
|
|
124
123
|
return {
|
|
125
124
|
id: server.definition.id,
|
|
126
125
|
label: server.definition.label,
|
|
127
|
-
description: disabled ? ( localize(
|
|
126
|
+
description: disabled ? ( localize(10845, "Disabled")) : ( McpConnectionState.toString(server.connectionState.read(reader)))
|
|
128
127
|
};
|
|
129
128
|
}))])];
|
|
130
129
|
if (firstRun && pick.items.length > 3) {
|
|
@@ -145,15 +144,7 @@ class ListMcpServerCommand extends Action2 {
|
|
|
145
144
|
; else if (picked.id === "$add") {
|
|
146
145
|
commandService.executeCommand(McpCommandIds.AddConfiguration);
|
|
147
146
|
} else {
|
|
148
|
-
|
|
149
|
-
if (server && isContributionDisabled(server.enablement.get())) {
|
|
150
|
-
const workbenchServer = mcpWorkbenchService.local.find(s => s.id === picked.id);
|
|
151
|
-
if (workbenchServer) {
|
|
152
|
-
mcpWorkbenchService.open(workbenchServer);
|
|
153
|
-
}
|
|
154
|
-
} else {
|
|
155
|
-
commandService.executeCommand(McpCommandIds.ServerOptions, picked.id);
|
|
156
|
-
}
|
|
147
|
+
commandService.executeCommand(McpCommandIds.ServerOptions, picked.id);
|
|
157
148
|
}
|
|
158
149
|
}
|
|
159
150
|
}
|
|
@@ -161,7 +152,7 @@ class McpConfirmationServerOptionsCommand extends Action2 {
|
|
|
161
152
|
constructor() {
|
|
162
153
|
super({
|
|
163
154
|
id: McpCommandIds.ServerOptionsInConfirmation,
|
|
164
|
-
title: ( localize2(
|
|
155
|
+
title: ( localize2(10846, "Server Options")),
|
|
165
156
|
category,
|
|
166
157
|
icon: Codicon.settingsGear,
|
|
167
158
|
f1: false,
|
|
@@ -192,7 +183,7 @@ class McpServerOptionsCommand extends Action2 {
|
|
|
192
183
|
constructor() {
|
|
193
184
|
super({
|
|
194
185
|
id: McpCommandIds.ServerOptions,
|
|
195
|
-
title: ( localize2(
|
|
186
|
+
title: ( localize2(10846, "Server Options")),
|
|
196
187
|
category,
|
|
197
188
|
f1: false
|
|
198
189
|
});
|
|
@@ -214,22 +205,28 @@ class McpServerOptionsCommand extends Action2 {
|
|
|
214
205
|
const serverDefinition = collection?.serverDefinitions.get().find(s => s.id === server.definition.id);
|
|
215
206
|
const items = [];
|
|
216
207
|
const serverState = server.connectionState.get();
|
|
208
|
+
const disabled = isContributionDisabled(server.enablement.get());
|
|
217
209
|
items.push({
|
|
218
210
|
type: "separator",
|
|
219
|
-
label: ( localize(
|
|
211
|
+
label: ( localize(10847, "Status"))
|
|
220
212
|
});
|
|
221
|
-
if (
|
|
213
|
+
if (disabled) {
|
|
214
|
+
items.push({
|
|
215
|
+
label: ( localize(10848, "Enable Server (Workspace)")),
|
|
216
|
+
action: "enable"
|
|
217
|
+
});
|
|
218
|
+
} else if (McpConnectionState.canBeStarted(serverState.state)) {
|
|
222
219
|
items.push({
|
|
223
|
-
label: ( localize(
|
|
220
|
+
label: ( localize(10849, "Start Server")),
|
|
224
221
|
action: "start"
|
|
225
222
|
});
|
|
226
223
|
} else {
|
|
227
224
|
items.push({
|
|
228
|
-
label: ( localize(
|
|
225
|
+
label: ( localize(10850, "Stop Server")),
|
|
229
226
|
action: "stop"
|
|
230
227
|
});
|
|
231
228
|
items.push({
|
|
232
|
-
label: ( localize(
|
|
229
|
+
label: ( localize(10851, "Restart Server")),
|
|
233
230
|
action: "restart"
|
|
234
231
|
});
|
|
235
232
|
}
|
|
@@ -237,26 +234,26 @@ class McpServerOptionsCommand extends Action2 {
|
|
|
237
234
|
const configTarget = serverDefinition?.presentation?.origin || collection?.presentation?.origin;
|
|
238
235
|
if (configTarget) {
|
|
239
236
|
items.push({
|
|
240
|
-
label: ( localize(
|
|
237
|
+
label: ( localize(10852, "Show Configuration")),
|
|
241
238
|
action: "config"
|
|
242
239
|
});
|
|
243
240
|
}
|
|
244
241
|
items.push({
|
|
245
|
-
label: ( localize(
|
|
242
|
+
label: ( localize(10853, "Show Output")),
|
|
246
243
|
action: "showOutput"
|
|
247
244
|
});
|
|
248
245
|
items.push({
|
|
249
246
|
type: "separator",
|
|
250
|
-
label: ( localize(
|
|
247
|
+
label: ( localize(10854, "Sampling"))
|
|
251
248
|
}, {
|
|
252
|
-
label: ( localize(
|
|
253
|
-
description: ( localize(
|
|
249
|
+
label: ( localize(10855, "Configure Model Access")),
|
|
250
|
+
description: ( localize(10856, "Set the models the server can use via MCP sampling")),
|
|
254
251
|
action: "configSampling"
|
|
255
252
|
});
|
|
256
253
|
if (samplingService.hasLogs(server)) {
|
|
257
254
|
items.push({
|
|
258
|
-
label: ( localize(
|
|
259
|
-
description: ( localize(
|
|
255
|
+
label: ( localize(10857, "Show Sampling Requests")),
|
|
256
|
+
description: ( localize(10858, "Show the sampling requests for this server")),
|
|
260
257
|
action: "samplingLog"
|
|
261
258
|
});
|
|
262
259
|
}
|
|
@@ -264,20 +261,23 @@ class McpServerOptionsCommand extends Action2 {
|
|
|
264
261
|
if (capabilities === undefined || (capabilities & McpCapability.Resources)) {
|
|
265
262
|
items.push({
|
|
266
263
|
type: "separator",
|
|
267
|
-
label: ( localize(
|
|
264
|
+
label: ( localize(10859, "Resources"))
|
|
268
265
|
});
|
|
269
266
|
items.push({
|
|
270
|
-
label: ( localize(
|
|
267
|
+
label: ( localize(10860, "Browse Resources")),
|
|
271
268
|
action: "resources"
|
|
272
269
|
});
|
|
273
270
|
}
|
|
274
271
|
const pick = await quickInputService.pick(items, {
|
|
275
|
-
placeHolder: ( localize(
|
|
272
|
+
placeHolder: ( localize(10861, "Select action for '{0}'", server.definition.label))
|
|
276
273
|
});
|
|
277
274
|
if (!pick) {
|
|
278
275
|
return;
|
|
279
276
|
}
|
|
280
277
|
switch (pick.action) {
|
|
278
|
+
case "enable":
|
|
279
|
+
mcpService.enablementModel.setEnabled(server.definition.id, ContributionEnablementState.EnabledWorkspace);
|
|
280
|
+
break;
|
|
281
281
|
case "start":
|
|
282
282
|
await server.start({
|
|
283
283
|
promptType: "all-untrusted"
|
|
@@ -320,7 +320,7 @@ class McpServerOptionsCommand extends Action2 {
|
|
|
320
320
|
editorService.openEditor({
|
|
321
321
|
resource: undefined,
|
|
322
322
|
contents: samplingService.getLogText(server),
|
|
323
|
-
label: ( localize(
|
|
323
|
+
label: ( localize(10862, "MCP Sampling: {0}", server.definition.label))
|
|
324
324
|
});
|
|
325
325
|
break;
|
|
326
326
|
default:
|
|
@@ -337,14 +337,14 @@ class McpServerOptionsCommand extends Action2 {
|
|
|
337
337
|
if (accountQuery.entities().getEntityCount().total > 1) {
|
|
338
338
|
result.push({
|
|
339
339
|
action: "disconnect",
|
|
340
|
-
label: ( localize(
|
|
340
|
+
label: ( localize(10863, "Disconnect Account")),
|
|
341
341
|
description: `(${accountName})`,
|
|
342
342
|
accountQuery
|
|
343
343
|
});
|
|
344
344
|
} else {
|
|
345
345
|
result.push({
|
|
346
346
|
action: "signout",
|
|
347
|
-
label: ( localize(
|
|
347
|
+
label: ( localize(10864, "Sign Out")),
|
|
348
348
|
description: `(${accountName})`,
|
|
349
349
|
accountQuery
|
|
350
350
|
});
|
|
@@ -513,24 +513,24 @@ let MCPServerActionRendering = class MCPServerActionRendering extends Disposable
|
|
|
513
513
|
text: s.definition.label,
|
|
514
514
|
id: McpCommandIds.ServerOptions,
|
|
515
515
|
arguments: [s.definition.id],
|
|
516
|
-
tooltip: ( localize(
|
|
516
|
+
tooltip: ( localize(10865, "Show server options for {0}", s.definition.label))
|
|
517
517
|
});
|
|
518
518
|
const single = servers.length === 1;
|
|
519
519
|
const names = ( ( servers.map(s => isServer(s) ? link(s) : "`" + s.label + "`")).map(l => single ? l : `- ${l}`)).join("\n");
|
|
520
520
|
let markdown;
|
|
521
521
|
if (state === DisplayedState.NewTools) {
|
|
522
522
|
markdown = ( new MarkdownString(single ? ( localize(
|
|
523
|
-
|
|
523
|
+
10866,
|
|
524
524
|
"MCP server {0} has been updated and may have new tools available.",
|
|
525
525
|
names
|
|
526
526
|
)) : ( localize(
|
|
527
|
-
|
|
527
|
+
10867,
|
|
528
528
|
"MCP servers have been updated and may have new tools available:\n\n{0}",
|
|
529
529
|
names
|
|
530
530
|
))));
|
|
531
531
|
} else if (state === DisplayedState.Error) {
|
|
532
|
-
markdown = ( new MarkdownString(single ? ( localize(
|
|
533
|
-
|
|
532
|
+
markdown = ( new MarkdownString(single ? ( localize(10868, "MCP server {0} was unable to start successfully.", names)) : ( localize(
|
|
533
|
+
10869,
|
|
534
534
|
"Multiple MCP servers were unable to start successfully:\n\n{0}",
|
|
535
535
|
names
|
|
536
536
|
))));
|
|
@@ -557,7 +557,7 @@ let MCPServerActionRendering = class MCPServerActionRendering extends Disposable
|
|
|
557
557
|
const divider = $("hr.mcp-hover-divider");
|
|
558
558
|
container.appendChild(divider);
|
|
559
559
|
const checkboxContainer = $("div.mcp-hover-setting");
|
|
560
|
-
const settingLabelStr = ( localize(
|
|
560
|
+
const settingLabelStr = ( localize(10870, "Automatically start MCP servers when sending a chat message"));
|
|
561
561
|
const checkbox = store.add(( new Checkbox(settingLabelStr, config.get() !== McpAutoStartValue.Never, {
|
|
562
562
|
...defaultCheckboxStyles
|
|
563
563
|
})));
|
|
@@ -585,11 +585,11 @@ let MCPServerActionRendering = class MCPServerActionRendering extends Disposable
|
|
|
585
585
|
} = displayedStateCurrent.get()
|
|
586
586
|
) {
|
|
587
587
|
if (state === DisplayedState.NewTools) {
|
|
588
|
-
return localize(
|
|
588
|
+
return localize(10871, "New tools available ({0})", servers.length || 1);
|
|
589
589
|
} else if (state === DisplayedState.Error) {
|
|
590
|
-
return localize(
|
|
590
|
+
return localize(10872, "Error loading {0} tool(s)", servers.length || 1);
|
|
591
591
|
} else if (state === DisplayedState.Refreshing) {
|
|
592
|
-
return localize(
|
|
592
|
+
return localize(10873, "Discovering tools...");
|
|
593
593
|
} else {
|
|
594
594
|
return null;
|
|
595
595
|
}
|
|
@@ -607,7 +607,7 @@ class ResetMcpTrustCommand extends Action2 {
|
|
|
607
607
|
constructor() {
|
|
608
608
|
super({
|
|
609
609
|
id: McpCommandIds.ResetTrust,
|
|
610
|
-
title: ( localize2(
|
|
610
|
+
title: ( localize2(10874, "Reset Trust")),
|
|
611
611
|
category,
|
|
612
612
|
f1: true,
|
|
613
613
|
precondition: ( ContextKeyExpr.and(McpContextKeys.toolsCount.greater(0), ( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabledInWorkspace.negate())))
|
|
@@ -622,7 +622,7 @@ class ResetMcpCachedTools extends Action2 {
|
|
|
622
622
|
constructor() {
|
|
623
623
|
super({
|
|
624
624
|
id: McpCommandIds.ResetCachedTools,
|
|
625
|
-
title: ( localize2(
|
|
625
|
+
title: ( localize2(10875, "Reset Cached Tools")),
|
|
626
626
|
category,
|
|
627
627
|
f1: true,
|
|
628
628
|
precondition: ( ContextKeyExpr.and(McpContextKeys.toolsCount.greater(0), ( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabledInWorkspace.negate())))
|
|
@@ -637,9 +637,9 @@ class AddConfigurationAction extends Action2 {
|
|
|
637
637
|
constructor() {
|
|
638
638
|
super({
|
|
639
639
|
id: McpCommandIds.AddConfiguration,
|
|
640
|
-
title: ( localize2(
|
|
640
|
+
title: ( localize2(10876, "Add Server...")),
|
|
641
641
|
metadata: {
|
|
642
|
-
description: ( localize2(
|
|
642
|
+
description: ( localize2(10877, "Installs a new Model Context protocol to the mcp.json settings"))
|
|
643
643
|
},
|
|
644
644
|
category,
|
|
645
645
|
f1: true,
|
|
@@ -661,9 +661,9 @@ class InstallFromManifestAction extends Action2 {
|
|
|
661
661
|
constructor() {
|
|
662
662
|
super({
|
|
663
663
|
id: McpCommandIds.InstallFromManifest,
|
|
664
|
-
title: ( localize2(
|
|
664
|
+
title: ( localize2(10878, "Install Server from Manifest...")),
|
|
665
665
|
metadata: {
|
|
666
|
-
description: ( localize2(
|
|
666
|
+
description: ( localize2(10879, "Install an MCP server from a JSON manifest file"))
|
|
667
667
|
},
|
|
668
668
|
category,
|
|
669
669
|
f1: true,
|
|
@@ -679,7 +679,7 @@ class RemoveStoredInput extends Action2 {
|
|
|
679
679
|
constructor() {
|
|
680
680
|
super({
|
|
681
681
|
id: McpCommandIds.RemoveStoredInput,
|
|
682
|
-
title: ( localize2(
|
|
682
|
+
title: ( localize2(10875, "Reset Cached Tools")),
|
|
683
683
|
category,
|
|
684
684
|
f1: false
|
|
685
685
|
});
|
|
@@ -692,7 +692,7 @@ class EditStoredInput extends Action2 {
|
|
|
692
692
|
constructor() {
|
|
693
693
|
super({
|
|
694
694
|
id: McpCommandIds.EditStoredInput,
|
|
695
|
-
title: ( localize2(
|
|
695
|
+
title: ( localize2(10880, "Edit Stored Input")),
|
|
696
696
|
category,
|
|
697
697
|
f1: false
|
|
698
698
|
});
|
|
@@ -706,7 +706,7 @@ class ShowConfiguration extends Action2 {
|
|
|
706
706
|
constructor() {
|
|
707
707
|
super({
|
|
708
708
|
id: McpCommandIds.ShowConfiguration,
|
|
709
|
-
title: ( localize2(
|
|
709
|
+
title: ( localize2(10881, "Show Configuration")),
|
|
710
710
|
category,
|
|
711
711
|
f1: false
|
|
712
712
|
});
|
|
@@ -736,7 +736,7 @@ class ShowOutput extends Action2 {
|
|
|
736
736
|
constructor() {
|
|
737
737
|
super({
|
|
738
738
|
id: McpCommandIds.ShowOutput,
|
|
739
|
-
title: ( localize2(
|
|
739
|
+
title: ( localize2(10882, "Show Output")),
|
|
740
740
|
category,
|
|
741
741
|
f1: false
|
|
742
742
|
});
|
|
@@ -749,7 +749,7 @@ class RestartServer extends Action2 {
|
|
|
749
749
|
constructor() {
|
|
750
750
|
super({
|
|
751
751
|
id: McpCommandIds.RestartServer,
|
|
752
|
-
title: ( localize2(
|
|
752
|
+
title: ( localize2(10883, "Restart Server")),
|
|
753
753
|
category,
|
|
754
754
|
f1: false
|
|
755
755
|
});
|
|
@@ -768,7 +768,7 @@ class StartServer extends Action2 {
|
|
|
768
768
|
constructor() {
|
|
769
769
|
super({
|
|
770
770
|
id: McpCommandIds.StartServer,
|
|
771
|
-
title: ( localize2(
|
|
771
|
+
title: ( localize2(10884, "Start Server")),
|
|
772
772
|
category,
|
|
773
773
|
f1: false
|
|
774
774
|
});
|
|
@@ -793,7 +793,7 @@ class StopServer extends Action2 {
|
|
|
793
793
|
constructor() {
|
|
794
794
|
super({
|
|
795
795
|
id: McpCommandIds.StopServer,
|
|
796
|
-
title: ( localize2(
|
|
796
|
+
title: ( localize2(10885, "Stop Server")),
|
|
797
797
|
category,
|
|
798
798
|
f1: false
|
|
799
799
|
});
|
|
@@ -807,8 +807,8 @@ class McpBrowseCommand extends Action2 {
|
|
|
807
807
|
constructor() {
|
|
808
808
|
super({
|
|
809
809
|
id: McpCommandIds.Browse,
|
|
810
|
-
title: ( localize2(
|
|
811
|
-
tooltip: ( localize2(
|
|
810
|
+
title: ( localize2(10886, "MCP Servers")),
|
|
811
|
+
tooltip: ( localize2(10887, "Browse MCP Servers")),
|
|
812
812
|
category,
|
|
813
813
|
icon: Codicon.search,
|
|
814
814
|
precondition: ( ContextKeyExpr.and(( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabledInWorkspace.negate()))),
|
|
@@ -831,7 +831,7 @@ class McpBrowseCommand extends Action2 {
|
|
|
831
831
|
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
832
832
|
command: {
|
|
833
833
|
id: McpCommandIds.Browse,
|
|
834
|
-
title: ( localize2(
|
|
834
|
+
title: ( localize2(10888, "Browse MCP Servers")),
|
|
835
835
|
category,
|
|
836
836
|
precondition: ( ContextKeyExpr.and(( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabledInWorkspace.negate())))
|
|
837
837
|
}
|
|
@@ -840,7 +840,7 @@ class ShowInstalledMcpServersCommand extends Action2 {
|
|
|
840
840
|
constructor() {
|
|
841
841
|
super({
|
|
842
842
|
id: McpCommandIds.ShowInstalled,
|
|
843
|
-
title: ( localize2(
|
|
843
|
+
title: ( localize2(10889, "Show Installed Servers")),
|
|
844
844
|
category,
|
|
845
845
|
precondition: ( ContextKeyExpr.and(HasInstalledMcpServersContext, ( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabledInWorkspace.negate()))),
|
|
846
846
|
f1: true
|
|
@@ -850,7 +850,7 @@ class ShowInstalledMcpServersCommand extends Action2 {
|
|
|
850
850
|
const viewsService = accessor.get(IViewsService);
|
|
851
851
|
const view = await viewsService.openView(InstalledMcpServersViewId, true);
|
|
852
852
|
if (!view) {
|
|
853
|
-
await viewsService.openViewContainer(
|
|
853
|
+
await viewsService.openViewContainer(VIEWLET_ID);
|
|
854
854
|
await viewsService.openView(InstalledMcpServersViewId, true);
|
|
855
855
|
}
|
|
856
856
|
}
|
|
@@ -858,7 +858,7 @@ class ShowInstalledMcpServersCommand extends Action2 {
|
|
|
858
858
|
MenuRegistry.appendMenuItem(CHAT_CONFIG_MENU_ID, {
|
|
859
859
|
command: {
|
|
860
860
|
id: McpCommandIds.ShowInstalled,
|
|
861
|
-
title: ( localize2(
|
|
861
|
+
title: ( localize2(10890, "MCP Servers"))
|
|
862
862
|
},
|
|
863
863
|
when: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ContextKeyExpr.equals("view", ChatViewId)))),
|
|
864
864
|
order: 10,
|
|
@@ -883,7 +883,7 @@ class OpenUserMcpResourceCommand extends OpenMcpResourceCommand {
|
|
|
883
883
|
constructor() {
|
|
884
884
|
super({
|
|
885
885
|
id: McpCommandIds.OpenUserMcp,
|
|
886
|
-
title: ( localize2(
|
|
886
|
+
title: ( localize2(10891, "Open User Configuration")),
|
|
887
887
|
category,
|
|
888
888
|
f1: true,
|
|
889
889
|
precondition: ( ContextKeyExpr.and(( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabledInWorkspace.negate())))
|
|
@@ -898,7 +898,7 @@ class OpenRemoteUserMcpResourceCommand extends OpenMcpResourceCommand {
|
|
|
898
898
|
constructor() {
|
|
899
899
|
super({
|
|
900
900
|
id: McpCommandIds.OpenRemoteUserMcp,
|
|
901
|
-
title: ( localize2(
|
|
901
|
+
title: ( localize2(10892, "Open Remote User Configuration")),
|
|
902
902
|
category,
|
|
903
903
|
f1: true,
|
|
904
904
|
precondition: ( ContextKeyExpr.and(( ContextKeyExpr.and(( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabledInWorkspace.negate()))), ( RemoteNameContext.notEqualsTo(""))))
|
|
@@ -915,7 +915,7 @@ class OpenWorkspaceFolderMcpResourceCommand extends Action2 {
|
|
|
915
915
|
constructor() {
|
|
916
916
|
super({
|
|
917
917
|
id: McpCommandIds.OpenWorkspaceFolderMcp,
|
|
918
|
-
title: ( localize2(
|
|
918
|
+
title: ( localize2(10893, "Open Workspace Folder MCP Configuration")),
|
|
919
919
|
category,
|
|
920
920
|
f1: true,
|
|
921
921
|
precondition: ( ContextKeyExpr.and(( ContextKeyExpr.and(( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabledInWorkspace.negate()))), ( WorkspaceFolderCountContext.notEqualsTo(0))))
|
|
@@ -938,7 +938,7 @@ class OpenWorkspaceMcpResourceCommand extends Action2 {
|
|
|
938
938
|
constructor() {
|
|
939
939
|
super({
|
|
940
940
|
id: McpCommandIds.OpenWorkspaceMcp,
|
|
941
|
-
title: ( localize2(
|
|
941
|
+
title: ( localize2(10894, "Open Workspace MCP Configuration")),
|
|
942
942
|
category,
|
|
943
943
|
f1: true,
|
|
944
944
|
precondition: ( ContextKeyExpr.and(( ContextKeyExpr.and(( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabledInWorkspace.negate()))), ( WorkbenchStateContext.isEqualTo("workspace"))))
|
|
@@ -959,7 +959,7 @@ class McpBrowseResourcesCommand extends Action2 {
|
|
|
959
959
|
constructor() {
|
|
960
960
|
super({
|
|
961
961
|
id: McpCommandIds.BrowseResources,
|
|
962
|
-
title: ( localize2(
|
|
962
|
+
title: ( localize2(10895, "Browse Resources...")),
|
|
963
963
|
category,
|
|
964
964
|
precondition: ( ContextKeyExpr.and(McpContextKeys.serverCount.greater(0), ( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabledInWorkspace.negate()))),
|
|
965
965
|
f1: true
|
|
@@ -977,7 +977,7 @@ class McpConfigureSamplingModels extends Action2 {
|
|
|
977
977
|
constructor() {
|
|
978
978
|
super({
|
|
979
979
|
id: McpCommandIds.ConfigureSamplingModels,
|
|
980
|
-
title: ( localize2(
|
|
980
|
+
title: ( localize2(10896, "Configure SamplingModel")),
|
|
981
981
|
category
|
|
982
982
|
});
|
|
983
983
|
}
|
|
@@ -1003,7 +1003,7 @@ class McpConfigureSamplingModels extends Action2 {
|
|
|
1003
1003
|
);
|
|
1004
1004
|
const picked = await quickInputService.pick(allItems, {
|
|
1005
1005
|
placeHolder: ( localize(
|
|
1006
|
-
|
|
1006
|
+
10897,
|
|
1007
1007
|
"Pick the models {0} can access via MCP sampling",
|
|
1008
1008
|
server.definition.label
|
|
1009
1009
|
)),
|
|
@@ -1019,7 +1019,7 @@ class McpStartPromptingServerCommand extends Action2 {
|
|
|
1019
1019
|
constructor() {
|
|
1020
1020
|
super({
|
|
1021
1021
|
id: McpCommandIds.StartPromptForServer,
|
|
1022
|
-
title: ( localize2(
|
|
1022
|
+
title: ( localize2(10898, "Start Prompting Server")),
|
|
1023
1023
|
category,
|
|
1024
1024
|
f1: false
|
|
1025
1025
|
});
|
|
@@ -1049,7 +1049,7 @@ class McpSkipCurrentAutostartCommand extends Action2 {
|
|
|
1049
1049
|
constructor() {
|
|
1050
1050
|
super({
|
|
1051
1051
|
id: McpCommandIds.SkipCurrentAutostart,
|
|
1052
|
-
title: ( localize2(
|
|
1052
|
+
title: ( localize2(10899, "Skip Current Autostart")),
|
|
1053
1053
|
category,
|
|
1054
1054
|
f1: false
|
|
1055
1055
|
});
|