@codingame/monaco-vscode-mcp-service-override 23.0.2 → 23.0.4
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 +15 -15
- 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 +55 -55
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +18 -18
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +18 -18
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpMigration.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess.js +7 -7
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.js +32 -32
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +34 -34
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +17 -17
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +8 -8
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.js +6 -6
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +12 -12
- 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/mcpServer.js +9 -9
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +3 -3
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +9 -9
|
@@ -251,7 +251,7 @@ let McpRegistry = class McpRegistry extends Disposable {
|
|
|
251
251
|
const originURI = r.definition.presentation?.origin?.uri || r.collection.presentation?.origin;
|
|
252
252
|
let labelWithOrigin = originURI ? `[\`${r.definition.label}\`](${originURI})` : '`' + r.definition.label + '`';
|
|
253
253
|
if (r.collection.source instanceof ExtensionIdentifier) {
|
|
254
|
-
labelWithOrigin += ` (${( localize(
|
|
254
|
+
labelWithOrigin += ` (${( localize(8854, 'from {0}', r.collection.source.value))})`;
|
|
255
255
|
}
|
|
256
256
|
return labelWithOrigin;
|
|
257
257
|
}
|
|
@@ -259,12 +259,12 @@ let McpRegistry = class McpRegistry extends Disposable {
|
|
|
259
259
|
const def = definitions[0];
|
|
260
260
|
const originURI = def.definition.presentation?.origin?.uri;
|
|
261
261
|
const { result } = await this._dialogService.prompt({
|
|
262
|
-
message: ( localize(
|
|
262
|
+
message: ( localize(8855, 'Trust and run MCP server {0}?', def.definition.label)),
|
|
263
263
|
custom: {
|
|
264
264
|
icon: Codicon.shield,
|
|
265
265
|
markdownDetails: [{
|
|
266
266
|
markdown: ( new MarkdownString(( localize(
|
|
267
|
-
|
|
267
|
+
8856,
|
|
268
268
|
'The MCP server {0} was updated. MCP servers may add context to your chat session and lead to unexpected behavior. Do you want to trust and run this server?',
|
|
269
269
|
labelFor(def)
|
|
270
270
|
)))),
|
|
@@ -275,20 +275,20 @@ let McpRegistry = class McpRegistry extends Disposable {
|
|
|
275
275
|
}]
|
|
276
276
|
},
|
|
277
277
|
buttons: [
|
|
278
|
-
{ label: ( localize(
|
|
279
|
-
{ label: ( localize(
|
|
278
|
+
{ label: ( localize(8857, 'Trust')), run: () => true },
|
|
279
|
+
{ label: ( localize(8858, 'Do not trust')), run: () => false }
|
|
280
280
|
],
|
|
281
281
|
});
|
|
282
282
|
return result === undefined ? undefined : (result ? [def.definition.id] : []);
|
|
283
283
|
}
|
|
284
284
|
const list = ( definitions.map(d => `- ${labelFor(d)}`)).join('\n');
|
|
285
285
|
const { result } = await this._dialogService.prompt({
|
|
286
|
-
message: ( localize(
|
|
286
|
+
message: ( localize(8859, 'Trust and run {0} MCP servers?', definitions.length)),
|
|
287
287
|
custom: {
|
|
288
288
|
icon: Codicon.shield,
|
|
289
289
|
markdownDetails: [{
|
|
290
290
|
markdown: ( new MarkdownString(( localize(
|
|
291
|
-
|
|
291
|
+
8860,
|
|
292
292
|
'Several updated MCP servers were discovered:\n\n{0}\n\n MCP servers may add context to your chat session and lead to unexpected behavior. Do you want to trust and run these server?',
|
|
293
293
|
list
|
|
294
294
|
)))),
|
|
@@ -299,9 +299,9 @@ let McpRegistry = class McpRegistry extends Disposable {
|
|
|
299
299
|
}]
|
|
300
300
|
},
|
|
301
301
|
buttons: [
|
|
302
|
-
{ label: ( localize(
|
|
303
|
-
{ label: ( localize(
|
|
304
|
-
{ label: ( localize(
|
|
302
|
+
{ label: ( localize(8857, 'Trust')), run: () => 'all' },
|
|
303
|
+
{ label: ( localize(8861, 'Pick Trusted')), run: () => 'pick' },
|
|
304
|
+
{ label: ( localize(8858, 'Do not trust')), run: () => 'none' },
|
|
305
305
|
],
|
|
306
306
|
});
|
|
307
307
|
if (result === undefined) {
|
|
@@ -440,7 +440,7 @@ let McpRegistry = class McpRegistry extends Disposable {
|
|
|
440
440
|
}
|
|
441
441
|
this._notificationService.notify({
|
|
442
442
|
severity: Severity.Error,
|
|
443
|
-
message: ( localize(
|
|
443
|
+
message: ( localize(8862, 'Error starting {0}: {1}', definition.label, String(e))),
|
|
444
444
|
actions: {
|
|
445
445
|
primary: collection.presentation?.origin && [
|
|
446
446
|
{
|
|
@@ -448,7 +448,7 @@ let McpRegistry = class McpRegistry extends Disposable {
|
|
|
448
448
|
class: undefined,
|
|
449
449
|
enabled: true,
|
|
450
450
|
tooltip: '',
|
|
451
|
-
label: ( localize(
|
|
451
|
+
label: ( localize(8863, 'Open Configuration')),
|
|
452
452
|
run: () => this._editorService.openEditor({
|
|
453
453
|
resource: collection.presentation.origin,
|
|
454
454
|
options: { selection: definition.presentation?.origin?.range }
|
|
@@ -41,7 +41,7 @@ let McpSamplingLog = class McpSamplingLog extends Disposable {
|
|
|
41
41
|
}
|
|
42
42
|
const parts = [];
|
|
43
43
|
const total = record.bins.reduce((sum, value) => sum + value, 0);
|
|
44
|
-
parts.push(( localize(
|
|
44
|
+
parts.push(( localize(8864, '{0} total requests in the last 7 days.', total)));
|
|
45
45
|
parts.push(this._formatRecentRequests(record));
|
|
46
46
|
return parts.join('\n');
|
|
47
47
|
}
|
|
@@ -106,11 +106,11 @@ let McpSamplingService = class McpSamplingService extends Disposable {
|
|
|
106
106
|
const model = await this._getMatchingModelInner(opts.server, opts.isDuringToolCall, opts.params.modelPreferences);
|
|
107
107
|
if (model === ModelMatch.UnsureAllowedDuringChat) {
|
|
108
108
|
const retry = await this._showContextual(opts.isDuringToolCall, ( localize(
|
|
109
|
-
|
|
109
|
+
8865,
|
|
110
110
|
'Allow MCP tools from "{0}" to make LLM requests?',
|
|
111
111
|
opts.server.definition.label
|
|
112
112
|
)), ( localize(
|
|
113
|
-
|
|
113
|
+
8866,
|
|
114
114
|
'The MCP server "{0}" has issued a request to make a language model call. Do you want to allow it to make requests during chat?',
|
|
115
115
|
opts.server.definition.label
|
|
116
116
|
)), this.allowButtons(opts.server, 'allowedDuringChat'));
|
|
@@ -121,11 +121,11 @@ let McpSamplingService = class McpSamplingService extends Disposable {
|
|
|
121
121
|
}
|
|
122
122
|
else if (model === ModelMatch.UnsureAllowedOutsideChat) {
|
|
123
123
|
const retry = await this._showContextual(opts.isDuringToolCall, ( localize(
|
|
124
|
-
|
|
124
|
+
8867,
|
|
125
125
|
'Allow MCP server "{0}" to make LLM requests?',
|
|
126
126
|
opts.server.definition.label
|
|
127
127
|
)), ( localize(
|
|
128
|
-
|
|
128
|
+
8868,
|
|
129
129
|
'The MCP server "{0}" has issued a request to make a language model call. Do you want to allow it to make requests, outside of tool calls during chat?',
|
|
130
130
|
opts.server.definition.label
|
|
131
131
|
)), this.allowButtons(opts.server, 'allowedOutsideChat'));
|
|
@@ -141,12 +141,12 @@ let McpSamplingService = class McpSamplingService extends Disposable {
|
|
|
141
141
|
const newlyPickedModels = opts.isDuringToolCall
|
|
142
142
|
? await this._commandService.executeCommand(McpCommandIds.ConfigureSamplingModels, opts.server)
|
|
143
143
|
: await this._notify(( localize(
|
|
144
|
-
|
|
144
|
+
8869,
|
|
145
145
|
'MCP server "{0}" triggered a language model request, but it has no allowlisted models.',
|
|
146
146
|
opts.server.definition.label
|
|
147
147
|
)), {
|
|
148
|
-
[( localize(
|
|
149
|
-
[( localize(
|
|
148
|
+
[( localize(8870, 'Configure'))]: () => this._commandService.executeCommand(McpCommandIds.ConfigureSamplingModels, opts.server),
|
|
149
|
+
[( localize(8871, 'Cancel'))]: () => Promise.resolve(undefined),
|
|
150
150
|
});
|
|
151
151
|
if (newlyPickedModels) {
|
|
152
152
|
return this._getMatchingModel(opts);
|
|
@@ -157,19 +157,19 @@ let McpSamplingService = class McpSamplingService extends Disposable {
|
|
|
157
157
|
}
|
|
158
158
|
allowButtons(server, key) {
|
|
159
159
|
return {
|
|
160
|
-
[( localize(
|
|
160
|
+
[( localize(8872, 'Allow in this Session'))]: async () => {
|
|
161
161
|
this._sessionSets[key].set(server.definition.id, true);
|
|
162
162
|
return true;
|
|
163
163
|
},
|
|
164
|
-
[( localize(
|
|
164
|
+
[( localize(8873, 'Always'))]: async () => {
|
|
165
165
|
await this.updateConfig(server, c => c[key] = true);
|
|
166
166
|
return true;
|
|
167
167
|
},
|
|
168
|
-
[( localize(
|
|
168
|
+
[( localize(8874, 'Not Now'))]: async () => {
|
|
169
169
|
this._sessionSets[key].set(server.definition.id, false);
|
|
170
170
|
return false;
|
|
171
171
|
},
|
|
172
|
-
[( localize(
|
|
172
|
+
[( localize(8875, 'Never'))]: async () => {
|
|
173
173
|
await this.updateConfig(server, c => c[key] = false);
|
|
174
174
|
return false;
|
|
175
175
|
},
|
|
@@ -426,29 +426,29 @@ let McpServer = McpServer_1 = class McpServer extends Disposable {
|
|
|
426
426
|
break;
|
|
427
427
|
}
|
|
428
428
|
const options = [{
|
|
429
|
-
label: ( localize(
|
|
429
|
+
label: ( localize(8876, "Show Output")),
|
|
430
430
|
run: () => this.showOutput(),
|
|
431
431
|
}];
|
|
432
432
|
if (cnx.definition.devMode?.debug?.type === 'debugpy' && debug) {
|
|
433
433
|
this._notificationService.prompt(Severity.Error, ( localize(
|
|
434
|
-
|
|
434
|
+
8877,
|
|
435
435
|
'The command "{0}" was not found. You can specify the path to debugpy in the `dev.debug.debugpyPath` option.',
|
|
436
436
|
cnx.launchDefinition.command,
|
|
437
437
|
cnx.definition.label
|
|
438
438
|
)), [...options, {
|
|
439
|
-
label: ( localize(
|
|
439
|
+
label: ( localize(8878, 'View Docs')),
|
|
440
440
|
run: () => this._openerService.open(( URI.parse('https://aka.ms/vscode-mcp-install/debugpy'))),
|
|
441
441
|
}]);
|
|
442
442
|
return;
|
|
443
443
|
}
|
|
444
444
|
if (docsLink) {
|
|
445
445
|
options.push({
|
|
446
|
-
label: ( localize(
|
|
446
|
+
label: ( localize(8879, 'Install {0}', cnx.launchDefinition.command)),
|
|
447
447
|
run: () => this._openerService.open(( URI.parse(docsLink))),
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
450
|
this._notificationService.prompt(Severity.Error, ( localize(
|
|
451
|
-
|
|
451
|
+
8880,
|
|
452
452
|
'The command "{0}" needed to run {1} was not found.',
|
|
453
453
|
cnx.launchDefinition.command,
|
|
454
454
|
cnx.definition.label
|
|
@@ -456,7 +456,7 @@ let McpServer = McpServer_1 = class McpServer extends Disposable {
|
|
|
456
456
|
}
|
|
457
457
|
else {
|
|
458
458
|
this._notificationService.warn(( localize(
|
|
459
|
-
|
|
459
|
+
8881,
|
|
460
460
|
'The MCP server {0} could not be started: {1}',
|
|
461
461
|
cnx.definition.label,
|
|
462
462
|
error.message
|
|
@@ -522,7 +522,7 @@ let McpServer = McpServer_1 = class McpServer extends Disposable {
|
|
|
522
522
|
const validated = [];
|
|
523
523
|
for (const [i, result] of validations.entries()) {
|
|
524
524
|
if ('error' in result) {
|
|
525
|
-
error += ( localize(
|
|
525
|
+
error += ( localize(8882, 'Tool `{0}` has invalid JSON parameters:', tools[i].name)) + '\n';
|
|
526
526
|
for (const message of result.error) {
|
|
527
527
|
error += `\t- ${message}\n`;
|
|
528
528
|
}
|
|
@@ -785,7 +785,7 @@ function warnInvalidTools(instaService, serverName, errorText) {
|
|
|
785
785
|
notificationService.notify({
|
|
786
786
|
severity: Severity.Warning,
|
|
787
787
|
message: ( localize(
|
|
788
|
-
|
|
788
|
+
8883,
|
|
789
789
|
'MCP server `{0}` has tools with invalid parameters which will be omitted.',
|
|
790
790
|
serverName
|
|
791
791
|
)),
|
|
@@ -795,7 +795,7 @@ function warnInvalidTools(instaService, serverName, errorText) {
|
|
|
795
795
|
enabled: true,
|
|
796
796
|
id: 'mcpBadSchema.show',
|
|
797
797
|
tooltip: '',
|
|
798
|
-
label: ( localize(
|
|
798
|
+
label: ( localize(8884, 'Show')),
|
|
799
799
|
run: () => {
|
|
800
800
|
editorService.openEditor({
|
|
801
801
|
resource: undefined,
|
|
@@ -35,7 +35,7 @@ let McpServerConnection = class McpServerConnection extends Disposable {
|
|
|
35
35
|
}
|
|
36
36
|
this._launch.value = undefined;
|
|
37
37
|
this._state.set({ state: McpConnectionState.Kind.Starting }, undefined);
|
|
38
|
-
this._logger.info(( localize(
|
|
38
|
+
this._logger.info(( localize(8885, 'Starting server {0}', this.definition.label)));
|
|
39
39
|
try {
|
|
40
40
|
const launch = this._delegate.start(this._collection, this.definition, this.launchDefinition, { errorOnUserInteraction: this._errorOnUserInteraction });
|
|
41
41
|
this._launch.value = this.adoptLaunch(launch, methods);
|
|
@@ -62,7 +62,7 @@ let McpServerConnection = class McpServerConnection extends Disposable {
|
|
|
62
62
|
store.add(autorun(reader => {
|
|
63
63
|
const state = launch.state.read(reader);
|
|
64
64
|
this._state.set(state, undefined);
|
|
65
|
-
this._logger.info(( localize(
|
|
65
|
+
this._logger.info(( localize(8886, 'Connection state: {0}', (McpConnectionState.toString(state)))));
|
|
66
66
|
if (state.state === McpConnectionState.Kind.Running && !didStart) {
|
|
67
67
|
didStart = true;
|
|
68
68
|
McpServerRequestHandler.create(this._instantiationService, {
|
|
@@ -96,7 +96,7 @@ let McpServerConnection = class McpServerConnection extends Disposable {
|
|
|
96
96
|
return { dispose: () => store.dispose(), object: launch };
|
|
97
97
|
}
|
|
98
98
|
async stop() {
|
|
99
|
-
this._logger.info(( localize(
|
|
99
|
+
this._logger.info(( localize(8887, 'Stopping server {0}', this.definition.label)));
|
|
100
100
|
this._launch.value?.object.stop();
|
|
101
101
|
await this._waitForState(McpConnectionState.Kind.Stopped, McpConnectionState.Kind.Error);
|
|
102
102
|
}
|
|
@@ -112,7 +112,7 @@ let AuthenticationMcpService = class AuthenticationMcpService extends Disposable
|
|
|
112
112
|
numberOfRequests += ( Object.keys(accessRequest)).length;
|
|
113
113
|
});
|
|
114
114
|
if (numberOfRequests > 0) {
|
|
115
|
-
const badge = ( new NumberBadge(numberOfRequests, () => ( localize(
|
|
115
|
+
const badge = ( new NumberBadge(numberOfRequests, () => ( localize(13508, "Sign in requested"))));
|
|
116
116
|
this._accountBadgeDisposable.value = this.activityService.showAccountsActivity({ badge });
|
|
117
117
|
}
|
|
118
118
|
}
|
|
@@ -173,7 +173,7 @@ let AuthenticationMcpService = class AuthenticationMcpService extends Disposable
|
|
|
173
173
|
const { result } = await this.dialogService.prompt({
|
|
174
174
|
type: Severity.Info,
|
|
175
175
|
message: ( localize(
|
|
176
|
-
|
|
176
|
+
13509,
|
|
177
177
|
"The MCP server '{0}' wants to access the {1} account '{2}'.",
|
|
178
178
|
mcpServerName,
|
|
179
179
|
provider.label,
|
|
@@ -181,11 +181,11 @@ let AuthenticationMcpService = class AuthenticationMcpService extends Disposable
|
|
|
181
181
|
)),
|
|
182
182
|
buttons: [
|
|
183
183
|
{
|
|
184
|
-
label: ( localize(
|
|
184
|
+
label: ( localize(13510, "&&Allow")),
|
|
185
185
|
run: () => SessionPromptChoice.Allow
|
|
186
186
|
},
|
|
187
187
|
{
|
|
188
|
-
label: ( localize(
|
|
188
|
+
label: ( localize(13511, "&&Deny")),
|
|
189
189
|
run: () => SessionPromptChoice.Deny
|
|
190
190
|
}
|
|
191
191
|
],
|
|
@@ -221,16 +221,16 @@ let AuthenticationMcpService = class AuthenticationMcpService extends Disposable
|
|
|
221
221
|
items.push({ label: account.label, account });
|
|
222
222
|
}
|
|
223
223
|
});
|
|
224
|
-
items.push({ label: ( localize(
|
|
224
|
+
items.push({ label: ( localize(13512, "Sign in to another account")) });
|
|
225
225
|
quickPick.items = items;
|
|
226
226
|
quickPick.title = ( localize(
|
|
227
|
-
|
|
227
|
+
13513,
|
|
228
228
|
"The MCP server '{0}' wants to access a {1} account",
|
|
229
229
|
mcpServerName,
|
|
230
230
|
this._authenticationService.getProvider(providerId).label
|
|
231
231
|
));
|
|
232
232
|
quickPick.placeholder = ( localize(
|
|
233
|
-
|
|
233
|
+
13514,
|
|
234
234
|
"Select an account for '{0}' to use or Esc to cancel",
|
|
235
235
|
mcpServerName
|
|
236
236
|
));
|
|
@@ -302,7 +302,7 @@ let AuthenticationMcpService = class AuthenticationMcpService extends Disposable
|
|
|
302
302
|
group: '3_accessRequests',
|
|
303
303
|
command: {
|
|
304
304
|
id: `${providerId}${mcpServerId}Access`,
|
|
305
|
-
title: ( localize(
|
|
305
|
+
title: ( localize(13515, "Grant access to {0} for {1}... (1)", provider.label, mcpServerName))
|
|
306
306
|
}
|
|
307
307
|
}));
|
|
308
308
|
const accessCommand = CommandsRegistry.registerCommand({
|
|
@@ -346,7 +346,7 @@ let AuthenticationMcpService = class AuthenticationMcpService extends Disposable
|
|
|
346
346
|
group: '2_signInRequests',
|
|
347
347
|
command: {
|
|
348
348
|
id: commandId,
|
|
349
|
-
title: ( localize(
|
|
349
|
+
title: ( localize(13516, "Sign in with {0} to use {1} (1)", provider.label, mcpServerName))
|
|
350
350
|
}
|
|
351
351
|
}));
|
|
352
352
|
const signInCommand = CommandsRegistry.registerCommand({
|