@codingame/monaco-vscode-mcp-service-override 30.0.0 → 31.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 +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.js +77 -77
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +25 -25
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpGatewayService.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpGatewayService.js +10 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +21 -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 +22 -22
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +12 -12
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/installedMcpServersDiscovery.js +2 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/pluginMcpDiscovery.js +2 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpGatewayToolBrokerChannel.js +9 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.js +6 -6
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +13 -13
- 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 +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +3 -3
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +9 -9
|
@@ -27,8 +27,8 @@ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/obse
|
|
|
27
27
|
|
|
28
28
|
const noneItem = {
|
|
29
29
|
id: undefined,
|
|
30
|
-
label: ( localize(
|
|
31
|
-
description: ( localize(
|
|
30
|
+
label: ( localize(10650, "None")),
|
|
31
|
+
description: ( localize(10651, "No selection")),
|
|
32
32
|
alwaysShow: true
|
|
33
33
|
};
|
|
34
34
|
function isFormElicitation(params) {
|
|
@@ -117,11 +117,11 @@ let McpElicitationService = class McpElicitationService {
|
|
|
117
117
|
}
|
|
118
118
|
const handle = this._notificationService.notify({
|
|
119
119
|
message: elicitation.message,
|
|
120
|
-
source: ( localize(
|
|
120
|
+
source: ( localize(10652, "MCP Server ({0})", server.definition.label)),
|
|
121
121
|
severity: Severity.Info,
|
|
122
122
|
actions: {
|
|
123
|
-
primary: [store.add(( new Action("mcp.elicit.give", ( localize(
|
|
124
|
-
secondary: [store.add(( new Action("mcp.elicit.cancel", ( localize(
|
|
123
|
+
primary: [store.add(( new Action("mcp.elicit.give", ( localize(10653, "Respond")), undefined, true, () => resolve(this._doElicitForm(elicitation, token)))))],
|
|
124
|
+
secondary: [store.add(( new Action("mcp.elicit.cancel", ( localize(10654, "Cancel")), undefined, true, () => resolve({
|
|
125
125
|
action: "decline"
|
|
126
126
|
}))))]
|
|
127
127
|
}
|
|
@@ -163,7 +163,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
163
163
|
if (chatModel instanceof ChatModel) {
|
|
164
164
|
const request = chatModel.getRequests().at(-1);
|
|
165
165
|
if (request) {
|
|
166
|
-
const part = ( new ChatElicitationRequestPart(( localize(
|
|
166
|
+
const part = ( new ChatElicitationRequestPart(( localize(10655, "Authorization Required")), ( new MarkdownString()).appendText(elicitation.message).appendMarkdown("\n\n" + ( localize(10656, "Open this URL?"))).appendCodeblock("", elicitation.url), ( localize(10657, "{0} (MCP Server)", server.definition.label)), ( localize(10658, "Open {0}", ( URI.parse(elicitation.url)).authority)), ( localize(10659, "Cancel")), async () => {
|
|
167
167
|
const result = await this._doElicitUrl(elicitation, token);
|
|
168
168
|
resolve(result);
|
|
169
169
|
completePromise.then(() => part.hide());
|
|
@@ -178,12 +178,12 @@ let McpElicitationService = class McpElicitationService {
|
|
|
178
178
|
}
|
|
179
179
|
} else {
|
|
180
180
|
const handle = this._notificationService.notify({
|
|
181
|
-
message: elicitation.message + " " + ( localize(
|
|
182
|
-
source: ( localize(
|
|
181
|
+
message: elicitation.message + " " + ( localize(10660, "This will open {0}", elicitation.url)),
|
|
182
|
+
source: ( localize(10652, "MCP Server ({0})", server.definition.label)),
|
|
183
183
|
severity: Severity.Info,
|
|
184
184
|
actions: {
|
|
185
|
-
primary: [store.add(( new Action("mcp.elicit.url.open2", ( localize(
|
|
186
|
-
secondary: [store.add(( new Action("mcp.elicit.cancel", ( localize(
|
|
185
|
+
primary: [store.add(( new Action("mcp.elicit.url.open2", ( localize(10661, "Open URL")), undefined, true, () => resolve(this._doElicitUrl(elicitation, token)))))],
|
|
186
|
+
secondary: [store.add(( new Action("mcp.elicit.cancel", ( localize(10654, "Cancel")), undefined, true, () => resolve({
|
|
187
187
|
action: "decline"
|
|
188
188
|
}))))]
|
|
189
189
|
}
|
|
@@ -325,7 +325,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
325
325
|
_getFieldPlaceholder(schema, required) {
|
|
326
326
|
let placeholder = schema.description || "";
|
|
327
327
|
if (!required) {
|
|
328
|
-
placeholder = placeholder ? `${placeholder} (${( localize(
|
|
328
|
+
placeholder = placeholder ? `${placeholder} (${( localize(10662, "Optional"))})` : ( localize(10662, "Optional"));
|
|
329
329
|
}
|
|
330
330
|
return placeholder;
|
|
331
331
|
}
|
|
@@ -434,7 +434,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
434
434
|
items.push({
|
|
435
435
|
id: "$default",
|
|
436
436
|
label: `${schema.default}`,
|
|
437
|
-
description: ( localize(
|
|
437
|
+
description: ( localize(10663, "Default value"))
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
440
|
}
|
|
@@ -503,13 +503,13 @@ let McpElicitationService = class McpElicitationService {
|
|
|
503
503
|
if (schema.minLength && value.length < schema.minLength) {
|
|
504
504
|
return {
|
|
505
505
|
isValid: false,
|
|
506
|
-
message: ( localize(
|
|
506
|
+
message: ( localize(10664, "Minimum length is {0}", schema.minLength))
|
|
507
507
|
};
|
|
508
508
|
}
|
|
509
509
|
if (schema.maxLength && value.length > schema.maxLength) {
|
|
510
510
|
return {
|
|
511
511
|
isValid: false,
|
|
512
|
-
message: ( localize(
|
|
512
|
+
message: ( localize(10665, "Maximum length is {0}", schema.maxLength))
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
515
|
if (schema.format) {
|
|
@@ -530,7 +530,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
530
530
|
isValid: true
|
|
531
531
|
} : {
|
|
532
532
|
isValid: false,
|
|
533
|
-
message: ( localize(
|
|
533
|
+
message: ( localize(10666, "Please enter a valid email address"))
|
|
534
534
|
};
|
|
535
535
|
case "uri":
|
|
536
536
|
if (URL.canParse(value)) {
|
|
@@ -540,7 +540,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
540
540
|
} else {
|
|
541
541
|
return {
|
|
542
542
|
isValid: false,
|
|
543
|
-
message: ( localize(
|
|
543
|
+
message: ( localize(10667, "Please enter a valid URI"))
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
546
|
case "date":
|
|
@@ -549,7 +549,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
549
549
|
if (!dateRegex.test(value)) {
|
|
550
550
|
return {
|
|
551
551
|
isValid: false,
|
|
552
|
-
message: ( localize(
|
|
552
|
+
message: ( localize(10668, "Please enter a valid date (YYYY-MM-DD)"))
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
555
|
const date = ( new Date(value));
|
|
@@ -557,7 +557,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
557
557
|
isValid: true
|
|
558
558
|
} : {
|
|
559
559
|
isValid: false,
|
|
560
|
-
message: ( localize(
|
|
560
|
+
message: ( localize(10668, "Please enter a valid date (YYYY-MM-DD)"))
|
|
561
561
|
};
|
|
562
562
|
}
|
|
563
563
|
case "date-time":
|
|
@@ -567,7 +567,7 @@ let McpElicitationService = class McpElicitationService {
|
|
|
567
567
|
isValid: true
|
|
568
568
|
} : {
|
|
569
569
|
isValid: false,
|
|
570
|
-
message: ( localize(
|
|
570
|
+
message: ( localize(10669, "Please enter a valid date-time"))
|
|
571
571
|
};
|
|
572
572
|
}
|
|
573
573
|
default:
|
|
@@ -581,25 +581,25 @@ let McpElicitationService = class McpElicitationService {
|
|
|
581
581
|
if (isNaN(parsed)) {
|
|
582
582
|
return {
|
|
583
583
|
isValid: false,
|
|
584
|
-
message: ( localize(
|
|
584
|
+
message: ( localize(10670, "Please enter a valid number"))
|
|
585
585
|
};
|
|
586
586
|
}
|
|
587
587
|
if (schema.type === "integer" && !Number.isInteger(parsed)) {
|
|
588
588
|
return {
|
|
589
589
|
isValid: false,
|
|
590
|
-
message: ( localize(
|
|
590
|
+
message: ( localize(10671, "Please enter a valid integer"))
|
|
591
591
|
};
|
|
592
592
|
}
|
|
593
593
|
if (schema.minimum !== undefined && parsed < schema.minimum) {
|
|
594
594
|
return {
|
|
595
595
|
isValid: false,
|
|
596
|
-
message: ( localize(
|
|
596
|
+
message: ( localize(10672, "Minimum value is {0}", schema.minimum))
|
|
597
597
|
};
|
|
598
598
|
}
|
|
599
599
|
if (schema.maximum !== undefined && parsed > schema.maximum) {
|
|
600
600
|
return {
|
|
601
601
|
isValid: false,
|
|
602
|
-
message: ( localize(
|
|
602
|
+
message: ( localize(10673, "Maximum value is {0}", schema.maximum))
|
|
603
603
|
};
|
|
604
604
|
}
|
|
605
605
|
return {
|
|
@@ -628,11 +628,11 @@ let McpElicitationService = class McpElicitationService {
|
|
|
628
628
|
allowFreeformInput: false,
|
|
629
629
|
options: [{
|
|
630
630
|
id: "true",
|
|
631
|
-
label: ( localize(
|
|
631
|
+
label: ( localize(10674, "True")),
|
|
632
632
|
value: "true"
|
|
633
633
|
}, {
|
|
634
634
|
id: "false",
|
|
635
|
-
label: ( localize(
|
|
635
|
+
label: ( localize(10675, "False")),
|
|
636
636
|
value: "false"
|
|
637
637
|
}],
|
|
638
638
|
defaultValue: schema.default !== undefined ? String(schema.default) : undefined
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
1
2
|
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
2
3
|
import { IRemoteAgentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/remote/common/remoteAgentService.service";
|
|
3
4
|
import { IMcpGatewayResult } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpGatewayService";
|
|
@@ -16,5 +17,5 @@ export declare class BrowserMcpGatewayService implements IWorkbenchMcpGatewaySer
|
|
|
16
17
|
private readonly _logService;
|
|
17
18
|
readonly _serviceBrand: undefined;
|
|
18
19
|
constructor(_remoteAgentService: IRemoteAgentService, _logService: ILogService);
|
|
19
|
-
createGateway(inRemote: boolean): Promise<IMcpGatewayResult | undefined>;
|
|
20
|
+
createGateway(inRemote: boolean, chatSessionResource?: URI): Promise<IMcpGatewayResult | undefined>;
|
|
20
21
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
4
4
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
5
|
-
import { ProxyChannel } from '@codingame/monaco-vscode-api/vscode/vs/base/parts/ipc/common/ipc';
|
|
6
5
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
7
6
|
import { McpGatewayChannelName } from '../../../../platform/mcp/common/mcpGateway.js';
|
|
8
7
|
import { IRemoteAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/remote/common/remoteAgentService.service';
|
|
@@ -12,7 +11,7 @@ let BrowserMcpGatewayService = class BrowserMcpGatewayService {
|
|
|
12
11
|
this._remoteAgentService = _remoteAgentService;
|
|
13
12
|
this._logService = _logService;
|
|
14
13
|
}
|
|
15
|
-
async createGateway(inRemote) {
|
|
14
|
+
async createGateway(inRemote, chatSessionResource) {
|
|
16
15
|
this._logService.debug(
|
|
17
16
|
`[McpGateway][BrowserWorkbench] createGateway requested (inRemote=${inRemote})`
|
|
18
17
|
);
|
|
@@ -31,8 +30,9 @@ let BrowserMcpGatewayService = class BrowserMcpGatewayService {
|
|
|
31
30
|
}
|
|
32
31
|
this._logService.info("[McpGateway][BrowserWorkbench] Creating remote gateway via remote server");
|
|
33
32
|
return connection.withChannel(McpGatewayChannelName, async channel => {
|
|
34
|
-
const
|
|
35
|
-
|
|
33
|
+
const info = await channel.call("createGateway", chatSessionResource ? {
|
|
34
|
+
chatSessionResource: ( chatSessionResource.toString())
|
|
35
|
+
} : undefined);
|
|
36
36
|
const servers = reviveServers(info.servers);
|
|
37
37
|
this._logService.info(
|
|
38
38
|
`[McpGateway][BrowserWorkbench] Remote gateway created with ${servers.length} server(s)`
|
|
@@ -48,7 +48,12 @@ let BrowserMcpGatewayService = class BrowserMcpGatewayService {
|
|
|
48
48
|
this._logService.info(
|
|
49
49
|
`[McpGateway][BrowserWorkbench] Disposing remote gateway: ${info.gatewayId}`
|
|
50
50
|
);
|
|
51
|
-
|
|
51
|
+
void channel.call("disposeGateway", info.gatewayId).then(undefined, error => {
|
|
52
|
+
this._logService.warn(
|
|
53
|
+
`[McpGateway][BrowserWorkbench] Failed to dispose remote gateway: ${info.gatewayId}`,
|
|
54
|
+
error
|
|
55
|
+
);
|
|
56
|
+
});
|
|
52
57
|
}
|
|
53
58
|
};
|
|
54
59
|
});
|
|
@@ -115,7 +115,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
115
115
|
diagnostics.push({
|
|
116
116
|
severity: MarkerSeverity.Warning,
|
|
117
117
|
message: ( localize(
|
|
118
|
-
|
|
118
|
+
10676,
|
|
119
119
|
"Variable `{0}` not found, did you mean ${{1}}?",
|
|
120
120
|
name,
|
|
121
121
|
getClosestMatchingVariable(name) + (arg ? `:${arg}` : "")
|
|
@@ -181,14 +181,14 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
181
181
|
range,
|
|
182
182
|
command: {
|
|
183
183
|
id: McpCommandIds.ShowOutput,
|
|
184
|
-
title: "$(error) " + ( localize(
|
|
184
|
+
title: "$(error) " + ( localize(10677, "Error")),
|
|
185
185
|
arguments: [server.definition.id]
|
|
186
186
|
}
|
|
187
187
|
}, {
|
|
188
188
|
range,
|
|
189
189
|
command: {
|
|
190
190
|
id: McpCommandIds.RestartServer,
|
|
191
|
-
title: ( localize(
|
|
191
|
+
title: ( localize(10678, "Restart")),
|
|
192
192
|
arguments: [server.definition.id, {
|
|
193
193
|
autoTrustChanges: true
|
|
194
194
|
}]
|
|
@@ -199,7 +199,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
199
199
|
range,
|
|
200
200
|
command: {
|
|
201
201
|
id: McpCommandIds.RestartServer,
|
|
202
|
-
title: ( localize(
|
|
202
|
+
title: ( localize(10679, "Debug")),
|
|
203
203
|
arguments: [server.definition.id, {
|
|
204
204
|
debug: true,
|
|
205
205
|
autoTrustChanges: true
|
|
@@ -213,14 +213,14 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
213
213
|
range,
|
|
214
214
|
command: {
|
|
215
215
|
id: McpCommandIds.ShowOutput,
|
|
216
|
-
title: "$(loading~spin) " + ( localize(
|
|
216
|
+
title: "$(loading~spin) " + ( localize(10680, "Starting")),
|
|
217
217
|
arguments: [server.definition.id]
|
|
218
218
|
}
|
|
219
219
|
}, {
|
|
220
220
|
range,
|
|
221
221
|
command: {
|
|
222
222
|
id: McpCommandIds.StopServer,
|
|
223
|
-
title: ( localize(
|
|
223
|
+
title: ( localize(10681, "Cancel")),
|
|
224
224
|
arguments: [server.definition.id]
|
|
225
225
|
}
|
|
226
226
|
});
|
|
@@ -230,21 +230,21 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
230
230
|
range,
|
|
231
231
|
command: {
|
|
232
232
|
id: McpCommandIds.ShowOutput,
|
|
233
|
-
title: "$(check) " + ( localize(
|
|
233
|
+
title: "$(check) " + ( localize(10682, "Running")),
|
|
234
234
|
arguments: [server.definition.id]
|
|
235
235
|
}
|
|
236
236
|
}, {
|
|
237
237
|
range,
|
|
238
238
|
command: {
|
|
239
239
|
id: McpCommandIds.StopServer,
|
|
240
|
-
title: ( localize(
|
|
240
|
+
title: ( localize(10683, "Stop")),
|
|
241
241
|
arguments: [server.definition.id]
|
|
242
242
|
}
|
|
243
243
|
}, {
|
|
244
244
|
range,
|
|
245
245
|
command: {
|
|
246
246
|
id: McpCommandIds.RestartServer,
|
|
247
|
-
title: ( localize(
|
|
247
|
+
title: ( localize(10678, "Restart")),
|
|
248
248
|
arguments: [server.definition.id, {
|
|
249
249
|
autoTrustChanges: true
|
|
250
250
|
}]
|
|
@@ -255,7 +255,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
255
255
|
range,
|
|
256
256
|
command: {
|
|
257
257
|
id: McpCommandIds.RestartServer,
|
|
258
|
-
title: ( localize(
|
|
258
|
+
title: ( localize(10679, "Debug")),
|
|
259
259
|
arguments: [server.definition.id, {
|
|
260
260
|
autoTrustChanges: true,
|
|
261
261
|
debug: true
|
|
@@ -269,7 +269,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
269
269
|
range,
|
|
270
270
|
command: {
|
|
271
271
|
id: McpCommandIds.StartServer,
|
|
272
|
-
title: "$(debug-start) " + ( localize(
|
|
272
|
+
title: "$(debug-start) " + ( localize(10684, "Start")),
|
|
273
273
|
arguments: [server.definition.id, {
|
|
274
274
|
autoTrustChanges: true
|
|
275
275
|
}]
|
|
@@ -280,7 +280,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
280
280
|
range,
|
|
281
281
|
command: {
|
|
282
282
|
id: McpCommandIds.StartServer,
|
|
283
|
-
title: ( localize(
|
|
283
|
+
title: ( localize(10679, "Debug")),
|
|
284
284
|
arguments: [server.definition.id, {
|
|
285
285
|
autoTrustChanges: true,
|
|
286
286
|
debug: true
|
|
@@ -296,7 +296,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
296
296
|
range,
|
|
297
297
|
command: {
|
|
298
298
|
id: "",
|
|
299
|
-
title: ( localize(
|
|
299
|
+
title: ( localize(10685, "{0} tools", toolCount))
|
|
300
300
|
}
|
|
301
301
|
});
|
|
302
302
|
}
|
|
@@ -306,7 +306,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
306
306
|
range,
|
|
307
307
|
command: {
|
|
308
308
|
id: McpCommandIds.StartPromptForServer,
|
|
309
|
-
title: ( localize(
|
|
309
|
+
title: ( localize(10686, "{0} prompts", promptCount)),
|
|
310
310
|
arguments: [server]
|
|
311
311
|
}
|
|
312
312
|
});
|
|
@@ -315,7 +315,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
315
315
|
range,
|
|
316
316
|
command: {
|
|
317
317
|
id: McpCommandIds.ServerOptions,
|
|
318
|
-
title: ( localize(
|
|
318
|
+
title: ( localize(10687, "More...")),
|
|
319
319
|
arguments: [server.definition.id]
|
|
320
320
|
}
|
|
321
321
|
});
|
|
@@ -390,19 +390,19 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
390
390
|
function pushAnnotation(savedId, offset, saved) {
|
|
391
391
|
const tooltip = ( new MarkdownString([createMarkdownCommandLink({
|
|
392
392
|
id: McpCommandIds.EditStoredInput,
|
|
393
|
-
text: ( localize(
|
|
393
|
+
text: ( localize(10688, "Edit")),
|
|
394
394
|
arguments: [savedId, model.uri, mcpConfigurationSection, inConfig.target],
|
|
395
|
-
tooltip: ( localize(
|
|
395
|
+
tooltip: ( localize(10689, "Edit saved value"))
|
|
396
396
|
}), createMarkdownCommandLink({
|
|
397
397
|
id: McpCommandIds.RemoveStoredInput,
|
|
398
|
-
text: ( localize(
|
|
398
|
+
text: ( localize(10690, "Clear")),
|
|
399
399
|
arguments: [inConfig.scope, savedId],
|
|
400
|
-
tooltip: ( localize(
|
|
400
|
+
tooltip: ( localize(10691, "Clear saved value"))
|
|
401
401
|
}), createMarkdownCommandLink({
|
|
402
402
|
id: McpCommandIds.RemoveStoredInput,
|
|
403
|
-
text: ( localize(
|
|
403
|
+
text: ( localize(10692, "Clear All")),
|
|
404
404
|
arguments: [inConfig.scope],
|
|
405
|
-
tooltip: ( localize(
|
|
405
|
+
tooltip: ( localize(10693, "Clear all saved values"))
|
|
406
406
|
})].join(" | "), {
|
|
407
407
|
isTrusted: true
|
|
408
408
|
}));
|
|
@@ -98,16 +98,16 @@ let McpConfigMigrationContribution = class McpConfigMigrationContribution extend
|
|
|
98
98
|
}
|
|
99
99
|
showMcpConfigErrorNotification(isRemote) {
|
|
100
100
|
const message = isRemote ? ( localize(
|
|
101
|
-
|
|
101
|
+
10694,
|
|
102
102
|
"MCP servers should no longer be configured in remote user settings. Use the dedicated MCP configuration instead."
|
|
103
103
|
)) : ( localize(
|
|
104
|
-
|
|
104
|
+
10695,
|
|
105
105
|
"MCP servers should no longer be configured in user settings. Use the dedicated MCP configuration instead."
|
|
106
106
|
));
|
|
107
|
-
const openConfigLabel = isRemote ? ( localize(
|
|
107
|
+
const openConfigLabel = isRemote ? ( localize(10696, "Open Remote User MCP Configuration")) : ( localize(10697, "Open User MCP Configuration"));
|
|
108
108
|
const commandId = isRemote ? McpCommandIds.OpenRemoteUserMcp : McpCommandIds.OpenUserMcp;
|
|
109
109
|
this.notificationService.prompt(Severity.Error, message, [{
|
|
110
|
-
label: ( localize(
|
|
110
|
+
label: ( localize(10698, "Update Now")),
|
|
111
111
|
run: async () => {
|
|
112
112
|
await this.migrateMcpConfig();
|
|
113
113
|
await this.commandService.executeCommand(commandId);
|
|
@@ -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(10714, "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
|
+
10715,
|
|
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
|
+
10716,
|
|
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(10717, "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(10718, "<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(10719, "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(10720, "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(10721, "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(10799, "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(10800, "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(10801, "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
|
+
10802,
|
|
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
|
+
10803,
|
|
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(10804, "Enable MCP Servers Marketplace")),
|
|
278
278
|
...defaultButtonStyles
|
|
279
279
|
})));
|
|
280
|
-
button.label = ( localize(
|
|
280
|
+
button.label = ( localize(10804, "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(10805, "Enable MCP Servers Marketplace?")),
|
|
287
287
|
custom: {
|
|
288
288
|
markdownDetails: [{
|
|
289
289
|
markdown: ( new MarkdownString(( localize(
|
|
290
|
-
|
|
290
|
+
10803,
|
|
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(10806, "Enable")),
|
|
300
300
|
run: () => true
|
|
301
301
|
}, {
|
|
302
|
-
label: ( localize(
|
|
302
|
+
label: ( localize(10807, "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(10808, "No MCP Servers found."));
|
|
323
323
|
}
|
|
324
324
|
if (this.bodyTemplate.messageBox.textContent) {
|
|
325
325
|
alert(this.bodyTemplate.messageBox.textContent);
|
|
@@ -533,42 +533,42 @@ class McpServersViewsContribution extends Disposable {
|
|
|
533
533
|
super();
|
|
534
534
|
( Registry.as(Extensions.ViewsRegistry)).registerViews([{
|
|
535
535
|
id: InstalledMcpServersViewId,
|
|
536
|
-
name: ( localize2(
|
|
536
|
+
name: ( localize2(10809, "MCP Servers - Installed")),
|
|
537
537
|
ctorDescriptor: ( new SyncDescriptor(McpServersListView, [{}])),
|
|
538
|
-
when: ( ContextKeyExpr.and(DefaultViewsContext, HasInstalledMcpServersContext, ( ChatContextKeys.Setup.hidden.negate()))),
|
|
538
|
+
when: ( ContextKeyExpr.and(DefaultViewsContext, HasInstalledMcpServersContext, ( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabledInWorkspace.negate()))),
|
|
539
539
|
weight: 40,
|
|
540
540
|
order: 4,
|
|
541
541
|
canToggleVisibility: true
|
|
542
542
|
}, {
|
|
543
543
|
id: "workbench.views.mcp.default.marketplace",
|
|
544
|
-
name: ( localize2(
|
|
544
|
+
name: ( localize2(10810, "MCP Servers")),
|
|
545
545
|
ctorDescriptor: ( new SyncDescriptor(DefaultBrowseMcpServersView, [{}])),
|
|
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}`)))))),
|
|
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,
|
|
548
548
|
order: 4,
|
|
549
549
|
canToggleVisibility: true
|
|
550
550
|
}, {
|
|
551
551
|
id: "workbench.views.mcp.marketplace",
|
|
552
|
-
name: ( localize2(
|
|
552
|
+
name: ( localize2(10810, "MCP Servers")),
|
|
553
553
|
ctorDescriptor: ( new SyncDescriptor(McpServersListView, [{}])),
|
|
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}`))))))
|
|
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(10810, "MCP Servers")),
|
|
558
558
|
ctorDescriptor: ( new SyncDescriptor(DefaultBrowseMcpServersView, [{
|
|
559
559
|
showWelcome: true
|
|
560
560
|
}])),
|
|
561
|
-
when: ( ContextKeyExpr.and(DefaultViewsContext, ( HasInstalledMcpServersContext.toNegated()), ( ChatContextKeys.Setup.hidden.negate()), ( McpServersGalleryStatusContext.isEqualTo(McpGalleryManifestStatus.Available)), ( ( ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceUrlConfig}`)).negate()), ( ProductQualityContext.isEqualTo("stable")), ( ( ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceEnablementConfig}`)).negate()))),
|
|
561
|
+
when: ( ContextKeyExpr.and(DefaultViewsContext, ( HasInstalledMcpServersContext.toNegated()), ( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabledInWorkspace.negate()), ( McpServersGalleryStatusContext.isEqualTo(McpGalleryManifestStatus.Available)), ( ( ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceUrlConfig}`)).negate()), ( ProductQualityContext.isEqualTo("stable")), ( ( ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceEnablementConfig}`)).negate()))),
|
|
562
562
|
weight: 40,
|
|
563
563
|
order: 4,
|
|
564
564
|
canToggleVisibility: true
|
|
565
565
|
}, {
|
|
566
566
|
id: "workbench.views.mcp.welcomeView",
|
|
567
|
-
name: ( localize2(
|
|
567
|
+
name: ( localize2(10810, "MCP Servers")),
|
|
568
568
|
ctorDescriptor: ( new SyncDescriptor(McpServersListView, [{
|
|
569
569
|
showWelcome: true
|
|
570
570
|
}])),
|
|
571
|
-
when: ( ContextKeyExpr.and(SearchMcpServersContext, ( ChatContextKeys.Setup.hidden.negate()), ( McpServersGalleryStatusContext.isEqualTo(McpGalleryManifestStatus.Available)), ( ( ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceUrlConfig}`)).negate()), ( ProductQualityContext.isEqualTo("stable")), ( ( ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceEnablementConfig}`)).negate())))
|
|
571
|
+
when: ( ContextKeyExpr.and(SearchMcpServersContext, ( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabledInWorkspace.negate()), ( McpServersGalleryStatusContext.isEqualTo(McpGalleryManifestStatus.Available)), ( ( ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceUrlConfig}`)).negate()), ( ProductQualityContext.isEqualTo("stable")), ( ( ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceEnablementConfig}`)).negate())))
|
|
572
572
|
}], VIEW_CONTAINER);
|
|
573
573
|
}
|
|
574
574
|
}
|
|
@@ -120,7 +120,7 @@ export declare class McpWorkbenchService extends Disposable implements IMcpWorkb
|
|
|
120
120
|
private handleMcpInstallUri;
|
|
121
121
|
private handleMcpServerUrl;
|
|
122
122
|
private handleMcpServerByName;
|
|
123
|
-
openSearch(searchValue: string,
|
|
123
|
+
openSearch(searchValue: string, preserveFocus?: boolean): Promise<void>;
|
|
124
124
|
open(extension: IWorkbenchMcpServer, options?: IEditorOptions): Promise<void>;
|
|
125
125
|
private getInstallState;
|
|
126
126
|
private getRuntimeStatus;
|