@codingame/monaco-vscode-mcp-service-override 31.0.0 → 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
|
@@ -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(10963, "None")),
|
|
31
|
+
description: ( localize(10964, "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(10965, "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(10966, "Respond")), undefined, true, () => resolve(this._doElicitForm(elicitation, token)))))],
|
|
124
|
+
secondary: [store.add(( new Action("mcp.elicit.cancel", ( localize(10967, "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(10968, "Authorization Required")), ( new MarkdownString()).appendText(elicitation.message).appendMarkdown("\n\n" + ( localize(10969, "Open this URL?"))).appendCodeblock("", elicitation.url), ( localize(10970, "{0} (MCP Server)", server.definition.label)), ( localize(10971, "Open {0}", ( URI.parse(elicitation.url)).authority)), ( localize(10972, "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(10973, "This will open {0}", elicitation.url)),
|
|
182
|
+
source: ( localize(10965, "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(10974, "Open URL")), undefined, true, () => resolve(this._doElicitUrl(elicitation, token)))))],
|
|
186
|
+
secondary: [store.add(( new Action("mcp.elicit.cancel", ( localize(10967, "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(10975, "Optional"))})` : ( localize(10975, "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(10976, "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(10977, "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(10978, "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(10979, "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(10980, "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(10981, "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(10981, "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(10982, "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(10983, "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(10984, "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(10985, "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(10986, "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(10987, "True")),
|
|
632
632
|
value: "true"
|
|
633
633
|
}, {
|
|
634
634
|
id: "false",
|
|
635
|
-
label: ( localize(
|
|
635
|
+
label: ( localize(10988, "False")),
|
|
636
636
|
value: "false"
|
|
637
637
|
}],
|
|
638
638
|
defaultValue: schema.default !== undefined ? String(schema.default) : undefined
|
|
@@ -9,13 +9,16 @@ import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/reso
|
|
|
9
9
|
import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
|
|
10
10
|
import { ILanguageFeaturesService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/languageFeatures.service';
|
|
11
11
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
12
|
+
import { ConfigurationTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
|
|
12
13
|
import { MarkerSeverity } from '@codingame/monaco-vscode-api/vscode/vs/platform/markers/common/markers';
|
|
13
14
|
import { IMarkerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/markers/common/markers.service';
|
|
15
|
+
import { StorageScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
14
16
|
import { IConfigurationResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/configurationResolver.service';
|
|
15
17
|
import { ConfigurationResolverExpression } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/configurationResolverExpression';
|
|
16
18
|
import { McpCommandIds } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpCommandIds';
|
|
17
19
|
import { mcpConfigurationSection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
|
|
18
20
|
import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
|
|
21
|
+
import { isContributionDisabled } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/enablement';
|
|
19
22
|
import { McpConnectionState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
|
|
20
23
|
import { IMcpWorkbenchService, IMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
|
|
21
24
|
|
|
@@ -38,6 +41,8 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
38
41
|
this._cachedMcpSection = this._register(( new MutableDisposable()));
|
|
39
42
|
const patterns = [{
|
|
40
43
|
pattern: "**/mcp.json"
|
|
44
|
+
}, {
|
|
45
|
+
pattern: "**/.mcp.json"
|
|
41
46
|
}, {
|
|
42
47
|
pattern: "**/workspace.json"
|
|
43
48
|
}];
|
|
@@ -59,7 +64,11 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
59
64
|
return this._cachedMcpSection.value;
|
|
60
65
|
}
|
|
61
66
|
const uri = model.uri;
|
|
62
|
-
const inConfig =
|
|
67
|
+
const inConfig = uri.path.endsWith("/.mcp.json") ? {
|
|
68
|
+
scope: StorageScope.WORKSPACE,
|
|
69
|
+
target: ConfigurationTarget.WORKSPACE_FOLDER,
|
|
70
|
+
serversKey: "mcpServers"
|
|
71
|
+
} : await this._mcpWorkbenchService.getMcpConfigPath(model.uri);
|
|
63
72
|
if (!inConfig) {
|
|
64
73
|
return undefined;
|
|
65
74
|
}
|
|
@@ -81,7 +90,8 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
81
90
|
};
|
|
82
91
|
}
|
|
83
92
|
_addDiagnostics(tm, value, tree, inConfig) {
|
|
84
|
-
const
|
|
93
|
+
const serversKey = inConfig.serversKey ?? "servers";
|
|
94
|
+
const serversNode = findNodeAtLocation(tree, inConfig.section ? [...inConfig.section, serversKey] : [serversKey]);
|
|
85
95
|
if (!serversNode) {
|
|
86
96
|
return;
|
|
87
97
|
}
|
|
@@ -115,7 +125,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
115
125
|
diagnostics.push({
|
|
116
126
|
severity: MarkerSeverity.Warning,
|
|
117
127
|
message: ( localize(
|
|
118
|
-
|
|
128
|
+
10989,
|
|
119
129
|
"Variable `{0}` not found, did you mean ${{1}}?",
|
|
120
130
|
name,
|
|
121
131
|
getClosestMatchingVariable(name) + (arg ? `:${arg}` : "")
|
|
@@ -144,7 +154,8 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
144
154
|
tree,
|
|
145
155
|
inConfig
|
|
146
156
|
} = parsed;
|
|
147
|
-
const
|
|
157
|
+
const serversKey = inConfig.serversKey ?? "servers";
|
|
158
|
+
const serversNode = findNodeAtLocation(tree, inConfig.section ? [...inConfig.section, serversKey] : [serversKey]);
|
|
148
159
|
if (!serversNode) {
|
|
149
160
|
return undefined;
|
|
150
161
|
}
|
|
@@ -173,6 +184,17 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
173
184
|
continue;
|
|
174
185
|
}
|
|
175
186
|
const range = Range.fromPositions(model.getPositionAt(node.children[0].offset));
|
|
187
|
+
if (isContributionDisabled(read(server.enablement))) {
|
|
188
|
+
lenses.push({
|
|
189
|
+
range,
|
|
190
|
+
command: {
|
|
191
|
+
id: McpCommandIds.ServerOptions,
|
|
192
|
+
title: "$(circle-slash) " + ( localize(10990, "Disabled")),
|
|
193
|
+
arguments: [server.definition.id]
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
176
198
|
const canDebug = !!server.readDefinitions().get().server?.devMode?.debug;
|
|
177
199
|
const state = read(server.connectionState).state;
|
|
178
200
|
switch (state) {
|
|
@@ -181,14 +203,14 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
181
203
|
range,
|
|
182
204
|
command: {
|
|
183
205
|
id: McpCommandIds.ShowOutput,
|
|
184
|
-
title: "$(error) " + ( localize(
|
|
206
|
+
title: "$(error) " + ( localize(10991, "Error")),
|
|
185
207
|
arguments: [server.definition.id]
|
|
186
208
|
}
|
|
187
209
|
}, {
|
|
188
210
|
range,
|
|
189
211
|
command: {
|
|
190
212
|
id: McpCommandIds.RestartServer,
|
|
191
|
-
title: ( localize(
|
|
213
|
+
title: ( localize(10992, "Restart")),
|
|
192
214
|
arguments: [server.definition.id, {
|
|
193
215
|
autoTrustChanges: true
|
|
194
216
|
}]
|
|
@@ -199,7 +221,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
199
221
|
range,
|
|
200
222
|
command: {
|
|
201
223
|
id: McpCommandIds.RestartServer,
|
|
202
|
-
title: ( localize(
|
|
224
|
+
title: ( localize(10993, "Debug")),
|
|
203
225
|
arguments: [server.definition.id, {
|
|
204
226
|
debug: true,
|
|
205
227
|
autoTrustChanges: true
|
|
@@ -213,14 +235,14 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
213
235
|
range,
|
|
214
236
|
command: {
|
|
215
237
|
id: McpCommandIds.ShowOutput,
|
|
216
|
-
title: "$(loading~spin) " + ( localize(
|
|
238
|
+
title: "$(loading~spin) " + ( localize(10994, "Starting")),
|
|
217
239
|
arguments: [server.definition.id]
|
|
218
240
|
}
|
|
219
241
|
}, {
|
|
220
242
|
range,
|
|
221
243
|
command: {
|
|
222
244
|
id: McpCommandIds.StopServer,
|
|
223
|
-
title: ( localize(
|
|
245
|
+
title: ( localize(10995, "Cancel")),
|
|
224
246
|
arguments: [server.definition.id]
|
|
225
247
|
}
|
|
226
248
|
});
|
|
@@ -230,21 +252,21 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
230
252
|
range,
|
|
231
253
|
command: {
|
|
232
254
|
id: McpCommandIds.ShowOutput,
|
|
233
|
-
title: "$(check) " + ( localize(
|
|
255
|
+
title: "$(check) " + ( localize(10996, "Running")),
|
|
234
256
|
arguments: [server.definition.id]
|
|
235
257
|
}
|
|
236
258
|
}, {
|
|
237
259
|
range,
|
|
238
260
|
command: {
|
|
239
261
|
id: McpCommandIds.StopServer,
|
|
240
|
-
title: ( localize(
|
|
262
|
+
title: ( localize(10997, "Stop")),
|
|
241
263
|
arguments: [server.definition.id]
|
|
242
264
|
}
|
|
243
265
|
}, {
|
|
244
266
|
range,
|
|
245
267
|
command: {
|
|
246
268
|
id: McpCommandIds.RestartServer,
|
|
247
|
-
title: ( localize(
|
|
269
|
+
title: ( localize(10992, "Restart")),
|
|
248
270
|
arguments: [server.definition.id, {
|
|
249
271
|
autoTrustChanges: true
|
|
250
272
|
}]
|
|
@@ -255,7 +277,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
255
277
|
range,
|
|
256
278
|
command: {
|
|
257
279
|
id: McpCommandIds.RestartServer,
|
|
258
|
-
title: ( localize(
|
|
280
|
+
title: ( localize(10993, "Debug")),
|
|
259
281
|
arguments: [server.definition.id, {
|
|
260
282
|
autoTrustChanges: true,
|
|
261
283
|
debug: true
|
|
@@ -269,7 +291,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
269
291
|
range,
|
|
270
292
|
command: {
|
|
271
293
|
id: McpCommandIds.StartServer,
|
|
272
|
-
title: "$(debug-start) " + ( localize(
|
|
294
|
+
title: "$(debug-start) " + ( localize(10998, "Start")),
|
|
273
295
|
arguments: [server.definition.id, {
|
|
274
296
|
autoTrustChanges: true
|
|
275
297
|
}]
|
|
@@ -280,7 +302,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
280
302
|
range,
|
|
281
303
|
command: {
|
|
282
304
|
id: McpCommandIds.StartServer,
|
|
283
|
-
title: ( localize(
|
|
305
|
+
title: ( localize(10993, "Debug")),
|
|
284
306
|
arguments: [server.definition.id, {
|
|
285
307
|
autoTrustChanges: true,
|
|
286
308
|
debug: true
|
|
@@ -296,7 +318,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
296
318
|
range,
|
|
297
319
|
command: {
|
|
298
320
|
id: "",
|
|
299
|
-
title: ( localize(
|
|
321
|
+
title: ( localize(10999, "{0} tools", toolCount))
|
|
300
322
|
}
|
|
301
323
|
});
|
|
302
324
|
}
|
|
@@ -306,7 +328,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
306
328
|
range,
|
|
307
329
|
command: {
|
|
308
330
|
id: McpCommandIds.StartPromptForServer,
|
|
309
|
-
title: ( localize(
|
|
331
|
+
title: ( localize(11000, "{0} prompts", promptCount)),
|
|
310
332
|
arguments: [server]
|
|
311
333
|
}
|
|
312
334
|
});
|
|
@@ -315,7 +337,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
315
337
|
range,
|
|
316
338
|
command: {
|
|
317
339
|
id: McpCommandIds.ServerOptions,
|
|
318
|
-
title: ( localize(
|
|
340
|
+
title: ( localize(11001, "More...")),
|
|
319
341
|
arguments: [server.definition.id]
|
|
320
342
|
}
|
|
321
343
|
});
|
|
@@ -342,7 +364,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
342
364
|
}
|
|
343
365
|
const inputs = await this._mcpRegistry.getSavedInputs(inConfig.scope);
|
|
344
366
|
const hints = [];
|
|
345
|
-
const serversNode = findNodeAtLocation(mcpSection, ["servers"]);
|
|
367
|
+
const serversNode = findNodeAtLocation(mcpSection, [inConfig.serversKey ?? "servers"]);
|
|
346
368
|
if (serversNode) {
|
|
347
369
|
annotateServers(serversNode);
|
|
348
370
|
}
|
|
@@ -390,19 +412,19 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
|
|
|
390
412
|
function pushAnnotation(savedId, offset, saved) {
|
|
391
413
|
const tooltip = ( new MarkdownString([createMarkdownCommandLink({
|
|
392
414
|
id: McpCommandIds.EditStoredInput,
|
|
393
|
-
text: ( localize(
|
|
415
|
+
text: ( localize(11002, "Edit")),
|
|
394
416
|
arguments: [savedId, model.uri, mcpConfigurationSection, inConfig.target],
|
|
395
|
-
tooltip: ( localize(
|
|
417
|
+
tooltip: ( localize(11003, "Edit saved value"))
|
|
396
418
|
}), createMarkdownCommandLink({
|
|
397
419
|
id: McpCommandIds.RemoveStoredInput,
|
|
398
|
-
text: ( localize(
|
|
420
|
+
text: ( localize(11004, "Clear")),
|
|
399
421
|
arguments: [inConfig.scope, savedId],
|
|
400
|
-
tooltip: ( localize(
|
|
422
|
+
tooltip: ( localize(11005, "Clear saved value"))
|
|
401
423
|
}), createMarkdownCommandLink({
|
|
402
424
|
id: McpCommandIds.RemoveStoredInput,
|
|
403
|
-
text: ( localize(
|
|
425
|
+
text: ( localize(11006, "Clear All")),
|
|
404
426
|
arguments: [inConfig.scope],
|
|
405
|
-
tooltip: ( localize(
|
|
427
|
+
tooltip: ( localize(11007, "Clear all saved values"))
|
|
406
428
|
})].join(" | "), {
|
|
407
429
|
isTrusted: true
|
|
408
430
|
}));
|
|
@@ -98,16 +98,16 @@ let McpConfigMigrationContribution = class McpConfigMigrationContribution extend
|
|
|
98
98
|
}
|
|
99
99
|
showMcpConfigErrorNotification(isRemote) {
|
|
100
100
|
const message = isRemote ? ( localize(
|
|
101
|
-
|
|
101
|
+
11008,
|
|
102
102
|
"MCP servers should no longer be configured in remote user settings. Use the dedicated MCP configuration instead."
|
|
103
103
|
)) : ( localize(
|
|
104
|
-
|
|
104
|
+
11009,
|
|
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(11010, "Open Remote User MCP Configuration")) : ( localize(11011, "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(11012, "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(11028, "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
|
+
11029,
|
|
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
|
+
11030,
|
|
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(11031, "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(11032, "<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(11033, "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(11034, "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(11035, "Search for resources"));
|
|
577
577
|
store.add(this.applyToPick(qp, token));
|
|
578
578
|
store.add(qp.onDidHide(() => store.dispose()));
|
|
579
579
|
qp.show();
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Dimension } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/dom";
|
|
2
|
+
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
3
|
+
import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service";
|
|
4
|
+
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
5
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
6
|
+
import { INotificationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service";
|
|
7
|
+
import { IOpenerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service";
|
|
8
|
+
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
9
|
+
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
10
|
+
import { IThemeService } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service";
|
|
11
|
+
import { EditorPane } from "@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/editor/editorPane";
|
|
12
|
+
import { IEditorOpenContext } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor";
|
|
13
|
+
import { IWebview } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/webview/browser/webview";
|
|
14
|
+
import { IWebviewService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/webview/browser/webview.service";
|
|
15
|
+
import { IEditorGroup } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService";
|
|
16
|
+
import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
|
|
17
|
+
import { IHoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service";
|
|
18
|
+
import { IMcpServerEditorOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes";
|
|
19
|
+
import { IMcpWorkbenchService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service";
|
|
20
|
+
import { McpServerEditorInput } from "./mcpServerEditorInput.js";
|
|
21
|
+
import { IContextMenuService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service";
|
|
22
|
+
export declare class McpServerEditor extends EditorPane {
|
|
23
|
+
private readonly instantiationService;
|
|
24
|
+
private readonly notificationService;
|
|
25
|
+
private readonly openerService;
|
|
26
|
+
private readonly extensionService;
|
|
27
|
+
private readonly webviewService;
|
|
28
|
+
private readonly languageService;
|
|
29
|
+
private readonly contextKeyService;
|
|
30
|
+
private readonly mcpWorkbenchService;
|
|
31
|
+
private readonly hoverService;
|
|
32
|
+
private readonly contextMenuService;
|
|
33
|
+
static readonly ID: string;
|
|
34
|
+
private readonly _scopedContextKeyService;
|
|
35
|
+
private template;
|
|
36
|
+
private mcpServerReadme;
|
|
37
|
+
private mcpServerManifest;
|
|
38
|
+
private initialScrollProgress;
|
|
39
|
+
private currentIdentifier;
|
|
40
|
+
private layoutParticipants;
|
|
41
|
+
private readonly contentDisposables;
|
|
42
|
+
private readonly transientDisposables;
|
|
43
|
+
private activeElement;
|
|
44
|
+
private dimension;
|
|
45
|
+
constructor(group: IEditorGroup, telemetryService: ITelemetryService, instantiationService: IInstantiationService, themeService: IThemeService, notificationService: INotificationService, openerService: IOpenerService, storageService: IStorageService, extensionService: IExtensionService, webviewService: IWebviewService, languageService: ILanguageService, contextKeyService: IContextKeyService, mcpWorkbenchService: IMcpWorkbenchService, hoverService: IHoverService, contextMenuService: IContextMenuService);
|
|
46
|
+
get scopedContextKeyService(): IContextKeyService | undefined;
|
|
47
|
+
protected createEditor(parent: HTMLElement): void;
|
|
48
|
+
setInput(input: McpServerEditorInput, options: IMcpServerEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void>;
|
|
49
|
+
private render;
|
|
50
|
+
setOptions(options: IMcpServerEditorOptions | undefined): void;
|
|
51
|
+
private renderNavbar;
|
|
52
|
+
clearInput(): void;
|
|
53
|
+
focus(): void;
|
|
54
|
+
showFind(): void;
|
|
55
|
+
runFindAction(previous: boolean): void;
|
|
56
|
+
get activeWebview(): IWebview | undefined;
|
|
57
|
+
private onNavbarChange;
|
|
58
|
+
private open;
|
|
59
|
+
private openMarkdown;
|
|
60
|
+
private renderMarkdown;
|
|
61
|
+
private renderBody;
|
|
62
|
+
private openDetails;
|
|
63
|
+
private openConfiguration;
|
|
64
|
+
private openManifestWithAdditionalDetails;
|
|
65
|
+
private openManifest;
|
|
66
|
+
private renderConfigurationDetails;
|
|
67
|
+
private renderManifestDetails;
|
|
68
|
+
private renderAdditionalDetails;
|
|
69
|
+
private loadContents;
|
|
70
|
+
layout(dimension: Dimension): void;
|
|
71
|
+
private onError;
|
|
72
|
+
}
|