@codingame/monaco-vscode-mcp-service-override 37.6.0 → 38.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.
Files changed (62) hide show
  1. package/common.js +7 -1
  2. package/package.json +2 -2
  3. package/session.d.ts +2 -1
  4. package/session.js +13 -1
  5. package/vscode/src/vs/platform/mcp/common/allowedMcpServersService.d.ts +3 -0
  6. package/vscode/src/vs/platform/mcp/common/allowedMcpServersService.js +38 -8
  7. package/vscode/src/vs/platform/mcp/common/mcpGalleryManifestService.d.ts +1 -0
  8. package/vscode/src/vs/platform/mcp/common/mcpGalleryManifestService.js +3 -0
  9. package/vscode/src/vs/platform/mcp/common/mcpGalleryService.d.ts +11 -5
  10. package/vscode/src/vs/platform/mcp/common/mcpGalleryService.js +121 -32
  11. package/vscode/src/vs/sessions/services/mcp/browser/mcpWorkspaceInstallTargetService.d.ts +4 -0
  12. package/vscode/src/vs/sessions/services/mcp/browser/mcpWorkspaceInstallTargetService.js +12 -0
  13. package/vscode/src/vs/workbench/api/browser/mainThreadMcp.d.ts +7 -1
  14. package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +108 -66
  15. package/vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js +8 -4
  16. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.js +2 -2
  17. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.d.ts +1 -1
  18. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.js +130 -118
  19. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +25 -25
  20. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +35 -35
  21. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpMigration.js +4 -4
  22. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess.js +8 -8
  23. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerConfigurationFormAccessibility.d.ts +15 -0
  24. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerConfigurationFormAccessibility.js +46 -0
  25. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +37 -37
  26. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +2 -2
  27. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.js +5 -5
  28. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +5 -5
  29. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.d.ts +4 -12
  30. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +39 -136
  31. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.d.ts +14 -7
  32. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +158 -61
  33. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +4 -4
  34. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/installedMcpServersDiscovery.js +2 -0
  35. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.d.ts +1 -3
  36. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +3 -10
  37. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.d.ts +4 -1
  38. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.js +16 -4
  39. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceDotMcpDiscovery.d.ts +1 -4
  40. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceDotMcpDiscovery.js +33 -7
  41. package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +4 -4
  42. package/vscode/src/vs/workbench/contrib/mcp/common/mcpCopilotGlobalConfigurationService.d.ts +16 -0
  43. package/vscode/src/vs/workbench/contrib/mcp/common/mcpCopilotGlobalConfigurationService.js +49 -0
  44. package/vscode/src/vs/workbench/contrib/mcp/common/mcpEnvironmentVariableExpansion.d.ts +18 -0
  45. package/vscode/src/vs/workbench/contrib/mcp/common/mcpEnvironmentVariableExpansion.js +21 -0
  46. package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.js +6 -6
  47. package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +21 -16
  48. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.js +1 -1
  49. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js +11 -11
  50. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSandboxService.d.ts +5 -4
  51. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSandboxService.js +59 -40
  52. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.d.ts +1 -0
  53. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +26 -13
  54. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.d.ts +2 -2
  55. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +18 -10
  56. package/vscode/src/vs/workbench/services/mcp/browser/mcpWorkbenchManagementService.d.ts +2 -1
  57. package/vscode/src/vs/workbench/services/mcp/browser/mcpWorkbenchManagementService.js +6 -3
  58. package/vscode/src/vs/workbench/services/mcp/common/mcpWorkspaceInstallTargetService.d.ts +11 -0
  59. package/vscode/src/vs/workbench/services/mcp/common/mcpWorkspaceInstallTargetService.js +24 -0
  60. package/vscode/src/vs/platform/mcp/common/mcpResourceScannerService.d.ts +0 -35
  61. package/vscode/src/vs/platform/mcp/common/mcpResourceScannerService.js +0 -214
  62. package/vscode/src/vs/workbench/contrib/mcp/browser/media/mcpServersView.css +0 -53
@@ -16,11 +16,12 @@ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
16
16
  import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
17
17
  import { ExtensionIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
18
18
  import { LogLevel } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log';
19
+ import { IAllowedMcpServersService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service';
19
20
  import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
20
21
  import { ISecretStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/secrets/common/secrets.service';
21
22
  import { IWorkbenchMcpGatewayService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpGatewayService.service';
22
23
  import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
23
- import { McpServerLaunch, McpServerTransportType, McpServerDefinition, McpServerTrust, McpCollectionSortOrder, McpCollectionProvenance, extensionPrefixedIdentifier, McpConnectionState, mcpOAuthClientSecretStorageKey, UserInteractionRequiredError } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
24
+ import { McpConnectionState, McpServerTransportType, McpServerLaunch, McpServerDefinition, McpServerTrust, McpCollectionSortOrder, McpCollectionProvenance, extensionPrefixedIdentifier, mcpOAuthClientSecretStorageKey, UserInteractionRequiredError } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
24
25
  import { mcpEnterpriseManagedAuthIdpSection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
25
26
  import { IAuthenticationMcpAccessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpAccessService.service';
26
27
  import { IAuthenticationMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpService.service';
@@ -49,7 +50,8 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
49
50
  _telemetryService,
50
51
  _mcpGatewayService,
51
52
  _configurationService,
52
- _secretStorageService
53
+ _secretStorageService,
54
+ _allowedMcpServersService
53
55
  ) {
54
56
  super();
55
57
  this._extHostContext = _extHostContext;
@@ -66,9 +68,11 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
66
68
  this._mcpGatewayService = _mcpGatewayService;
67
69
  this._configurationService = _configurationService;
68
70
  this._secretStorageService = _secretStorageService;
71
+ this._allowedMcpServersService = _allowedMcpServersService;
69
72
  this._serverIdCounter = 0;
70
73
  this._servers = ( new Map());
71
74
  this._serverDefinitions = ( new Map());
75
+ this._serverRequestUrls = ( new Map());
72
76
  this._serverAuthTracking = ( new McpServerAuthTracker());
73
77
  this._collectionDefinitions = this._register(( new DisposableMap()));
74
78
  this._gateways = this._register(( new DisposableMap()));
@@ -76,6 +80,28 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
76
80
  _authenticationService.onDidChangeSessions(e => this._onDidChangeAuthSessions(e.providerId, e.label))
77
81
  );
78
82
  const proxy = this._proxy = ( _extHostContext.getProxy(ExtHostContext.ExtHostMcp));
83
+ this._register(this._allowedMcpServersService.onDidChangeAllowedMcpServers(() => {
84
+ for (const [id, urls] of this._serverRequestUrls) {
85
+ const definition = this._serverDefinitions.get(id);
86
+ if (!definition) {
87
+ continue;
88
+ }
89
+ for (const url of urls) {
90
+ const allowed = this._allowedMcpServersService.isServerAllowed({
91
+ name: definition.label,
92
+ url
93
+ });
94
+ if (allowed !== true) {
95
+ this.$onDidChangeState(id, {
96
+ state: McpConnectionState.Kind.Error,
97
+ message: allowed.value
98
+ });
99
+ proxy.$stopMcp(id);
100
+ break;
101
+ }
102
+ }
103
+ }
104
+ }));
79
105
  this._register(this._mcpRegistry.registerDelegate({
80
106
  priority: _extHostContext.extensionHostKind === ExtensionHostKind.LocalWebWorker ? 0 : 1,
81
107
  waitForInitialProviderPromises() {
@@ -97,6 +123,16 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
97
123
  );
98
124
  return McpServerLaunch.fromSerialized(ser);
99
125
  },
126
+ async expandEnvironmentVariables(serverDefinition, launch) {
127
+ if (!serverDefinition.environmentVariableExpansion) {
128
+ return launch;
129
+ }
130
+ const ser = await proxy.$expandEnvironmentVariables(
131
+ McpServerLaunch.toSerialized(launch),
132
+ serverDefinition.environmentVariableExpansion
133
+ );
134
+ return McpServerLaunch.fromSerialized(ser);
135
+ },
100
136
  start: (_collection, serverDefiniton, resolveLaunch, options) => {
101
137
  const id = ++this._serverIdCounter;
102
138
  const launch = ( new ExtHostMcpServerLaunch(
@@ -106,6 +142,9 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
106
142
  ));
107
143
  this._servers.set(id, launch);
108
144
  this._serverDefinitions.set(id, serverDefiniton);
145
+ if (resolveLaunch.type === McpServerTransportType.HTTP) {
146
+ this._serverRequestUrls.set(id, ( new Set([( resolveLaunch.uri.toString(true))])));
147
+ }
109
148
  proxy.$startMcp(id, {
110
149
  launch: resolveLaunch,
111
150
  defaultCwd: serverDefiniton.defaultCwd ?? serverDefiniton.variableReplacement?.folder?.uri,
@@ -189,6 +228,22 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
189
228
  $deleteMcpCollection(collectionId) {
190
229
  this._collectionDefinitions.deleteAndDispose(collectionId);
191
230
  }
231
+ async $checkMcpServerAllowed(id, url) {
232
+ const definition = this._serverDefinitions.get(id);
233
+ const urls = this._serverRequestUrls.get(id);
234
+ if (!definition || !urls) {
235
+ throw ( new CancellationError());
236
+ }
237
+ const allowed = this._allowedMcpServersService.isServerAllowed({
238
+ name: definition.label,
239
+ url
240
+ });
241
+ if (allowed !== true) {
242
+ return allowed.value;
243
+ }
244
+ urls.add(url);
245
+ return undefined;
246
+ }
192
247
  $onDidChangeState(id, update) {
193
248
  const server = this._servers.get(id);
194
249
  if (!server) {
@@ -199,6 +254,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
199
254
  server.dispose();
200
255
  this._servers.delete(id);
201
256
  this._serverDefinitions.delete(id);
257
+ this._serverRequestUrls.delete(id);
202
258
  this._serverAuthTracking.untrack(id);
203
259
  }
204
260
  }
@@ -217,15 +273,9 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
217
273
  if (!server) {
218
274
  return undefined;
219
275
  }
220
- return this._getSessionForProvider(
221
- id,
222
- server,
223
- providerId,
224
- scopes,
225
- undefined,
226
- options.errorOnUserInteraction,
227
- options.clientId
228
- );
276
+ return this._getSessionForProvider(id, server, providerId, scopes, {
277
+ clientId: options.clientId
278
+ }, options.errorOnUserInteraction);
229
279
  }
230
280
  async $getTokenFromServerMetadata(
231
281
  id,
@@ -247,7 +297,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
247
297
  const resource = authDetails.resourceMetadata?.resource;
248
298
  if (!resource) {
249
299
  throw ( new Error(( localize(
250
- 5107,
300
+ 6427,
251
301
  "The enterprise-managed MCP server '{0}' did not advertise a protected-resource metadata document with a 'resource' identifier.",
252
302
  server.label
253
303
  ))));
@@ -256,7 +306,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
256
306
  const audience = resourceAuthServers[0];
257
307
  if (!audience) {
258
308
  throw ( new Error(( localize(
259
- 5108,
309
+ 6428,
260
310
  "The enterprise-managed MCP server '{0}' did not advertise an `authorization_servers` entry in its protected-resource metadata.",
261
311
  server.label
262
312
  ))));
@@ -268,33 +318,32 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
268
318
  return undefined;
269
319
  }
270
320
  const resourceClientId = clientId ?? authDetails.clientId;
321
+ let clientSecretStorageKey;
271
322
  let resourceClientSecret;
272
323
  if (resourceClientId) {
324
+ clientSecretStorageKey = mcpOAuthClientSecretStorageKey(resource, resourceClientId);
273
325
  try {
274
- resourceClientSecret = await this._secretStorageService.get(mcpOAuthClientSecretStorageKey(resource, resourceClientId));
326
+ resourceClientSecret = await this._secretStorageService.get(clientSecretStorageKey);
275
327
  } catch {}
276
328
  }
277
- return this._getSessionForProvider(
278
- id,
279
- server,
280
- xaaProviderId,
281
- xaaScopes,
282
- issuer,
283
- errorOnUserInteraction,
284
- resourceClientId,
329
+ return this._getSessionForProvider(id, server, xaaProviderId, xaaScopes, {
330
+ authorizationServer: issuer,
331
+ clientId: resourceClientId,
285
332
  resource,
286
333
  audience,
287
- resourceClientSecret
288
- );
334
+ clientSecretStorageKey
335
+ }, errorOnUserInteraction, resourceClientSecret);
289
336
  }
290
337
  let providerId = await this._authenticationService.getOrActivateProviderIdForServer(authorizationServer, resourceServer);
291
338
  const resolvedClientId = clientId ?? authDetails.clientId;
292
339
  const mcpServerUrl = server.launch.type === McpServerTransportType.HTTP ? ( server.launch.uri.toString(true)) : undefined;
340
+ let clientSecretStorageKey;
293
341
  let clientSecret;
294
342
  let didLookupClientSecret = false;
295
343
  if (resolvedClientId && mcpServerUrl) {
344
+ clientSecretStorageKey = mcpOAuthClientSecretStorageKey(mcpServerUrl, resolvedClientId);
296
345
  try {
297
- clientSecret = await this._secretStorageService.get(mcpOAuthClientSecretStorageKey(mcpServerUrl, resolvedClientId));
346
+ clientSecret = await this._secretStorageService.get(clientSecretStorageKey);
298
347
  didLookupClientSecret = true;
299
348
  } catch {}
300
349
  }
@@ -325,25 +374,19 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
325
374
  }
326
375
  providerId = provider.id;
327
376
  }
328
- return this._getSessionForProvider(
329
- id,
330
- server,
331
- providerId,
332
- resolvedScopes,
377
+ return this._getSessionForProvider(id, server, providerId, resolvedScopes, {
333
378
  authorizationServer,
334
- errorOnUserInteraction,
335
- resolvedClientId,
336
- authDetails.resourceMetadata?.resource,
337
- undefined,
338
- clientSecret
339
- );
379
+ clientId: resolvedClientId,
380
+ resource: authDetails.resourceMetadata?.resource,
381
+ clientSecretStorageKey
382
+ }, errorOnUserInteraction, clientSecret);
340
383
  }
341
384
  _ensureXaaIssuer() {
342
385
  const config = this._configurationService.getValue(mcpEnterpriseManagedAuthIdpSection) ?? {};
343
386
  const configuredIssuer = config.issuer?.trim();
344
387
  if (!configuredIssuer) {
345
388
  throw ( new Error(( localize(
346
- 5109,
389
+ 6429,
347
390
  "Enterprise-managed MCP authentication requires `mcp.enterpriseManagedAuth.idp.issuer` to be configured. Set it via enterprise policy (Windows Group Policy / macOS managed preferences / Linux `/etc/vscode/policy.json`) or, for local testing, by hand-editing `settings.json`."
348
391
  ))));
349
392
  }
@@ -352,14 +395,14 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
352
395
  parsed = ( URI.parse(configuredIssuer));
353
396
  } catch {
354
397
  throw ( new Error(( localize(
355
- 5110,
398
+ 6430,
356
399
  "Enterprise-managed MCP authentication requires `mcp.enterpriseManagedAuth.idp.issuer` to be a valid URL; got '{0}'.",
357
400
  configuredIssuer
358
401
  ))));
359
402
  }
360
403
  if (parsed.scheme !== "https" && parsed.scheme !== "http") {
361
404
  throw ( new Error(( localize(
362
- 5111,
405
+ 6431,
363
406
  "Enterprise-managed MCP authentication requires `mcp.enterpriseManagedAuth.idp.issuer` to use the `https` or `http` scheme; got '{0}'.",
364
407
  configuredIssuer
365
408
  ))));
@@ -371,25 +414,26 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
371
414
  server,
372
415
  providerId,
373
416
  scopes,
374
- authorizationServer,
417
+ authContext,
375
418
  errorOnUserInteraction = false,
376
- clientId,
377
- resource,
378
- audience,
379
419
  clientSecret
380
420
  ) {
381
- const authContext = {
421
+ const {
382
422
  authorizationServer,
383
423
  clientId,
384
424
  resource,
385
425
  audience
386
- };
387
- const sessions = await this._authenticationService.getSessions(providerId, scopes, {
426
+ } = authContext;
427
+ const providerOptions = {
388
428
  authorizationServer,
389
429
  clientId,
390
430
  clientSecret,
391
431
  resource,
392
432
  audience
433
+ };
434
+ const sessions = await this._authenticationService.getSessions(providerId, scopes, {
435
+ ...providerOptions,
436
+ silent: errorOnUserInteraction
393
437
  }, true);
394
438
  if (server.launch.type !== McpServerTransportType.HTTP) {
395
439
  return undefined;
@@ -436,7 +480,7 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
436
480
  if (provider.supportsMultipleAccounts && errorOnUserInteraction) {
437
481
  throw ( new UserInteractionRequiredError("authentication"));
438
482
  }
439
- session = provider.supportsMultipleAccounts ? await this.authenticationMcpServersService.selectSession(providerId, server.id, server.label, scopes, sessions) : sessions[0];
483
+ session = provider.supportsMultipleAccounts ? await this.authenticationMcpServersService.selectSession(providerId, server.id, server.label, scopes, sessions, providerOptions) : sessions[0];
440
484
  } else {
441
485
  if (errorOnUserInteraction) {
442
486
  throw ( new UserInteractionRequiredError("authentication"));
@@ -444,13 +488,9 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
444
488
  const accountToCreate = matchingAccountPreferenceSession?.account;
445
489
  do {
446
490
  session = await this._authenticationService.createSession(providerId, scopes, {
491
+ ...providerOptions,
447
492
  activateImmediate: true,
448
- account: accountToCreate,
449
- authorizationServer,
450
- clientId,
451
- clientSecret,
452
- resource,
453
- audience
493
+ account: accountToCreate
454
494
  });
455
495
  } while (accountToCreate && accountToCreate.label !== session.account.label && !(await this.continueWithIncorrectAccountPrompt(session.account.label, accountToCreate.label)));
456
496
  }
@@ -467,9 +507,9 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
467
507
  }
468
508
  async continueWithIncorrectAccountPrompt(chosenAccountLabel, requestedAccountLabel) {
469
509
  const result = await this.dialogService.prompt({
470
- message: ( localize(5112, "Incorrect account detected")),
510
+ message: ( localize(6432, "Incorrect account detected")),
471
511
  detail: ( localize(
472
- 5113,
512
+ 6433,
473
513
  "The chosen account, {0}, does not match the requested account, {1}.",
474
514
  chosenAccountLabel,
475
515
  requestedAccountLabel
@@ -477,10 +517,10 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
477
517
  type: Severity.Warning,
478
518
  cancelButton: true,
479
519
  buttons: [{
480
- label: ( localize(5114, "Keep {0}", chosenAccountLabel)),
520
+ label: ( localize(6434, "Keep {0}", chosenAccountLabel)),
481
521
  run: () => chosenAccountLabel
482
522
  }, {
483
- label: ( localize(5115, "Login with {0}", requestedAccountLabel)),
523
+ label: ( localize(6435, "Login with {0}", requestedAccountLabel)),
484
524
  run: () => requestedAccountLabel
485
525
  }]
486
526
  });
@@ -509,25 +549,26 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
509
549
  continue;
510
550
  }
511
551
  try {
552
+ const clientSecret = context.clientSecretStorageKey ? await this._secretStorageService.get(context.clientSecretStorageKey) : undefined;
512
553
  await this._getSessionForProvider(
513
554
  serverId,
514
555
  serverDefinition,
515
556
  providerId,
516
557
  scopes,
517
- context.authorizationServer,
558
+ context,
518
559
  true,
519
- context.clientId,
520
- context.resource,
521
- context.audience
560
+ clientSecret
522
561
  );
523
562
  } catch (e) {
524
563
  if (UserInteractionRequiredError.is(e)) {
525
564
  server.pushLog(LogLevel.Warning, ( localize(
526
- 5116,
565
+ 6436,
527
566
  "Authentication session for {0} removed, stopping server",
528
567
  providerLabel
529
568
  )));
530
569
  server.stop();
570
+ } else {
571
+ server.pushLog(LogLevel.Warning, ( localize(6437, "Unable to revalidate authentication for {0}.", providerLabel)));
531
572
  }
532
573
  }
533
574
  }
@@ -570,18 +611,18 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
570
611
  }
571
612
  async loginPrompt(mcpLabel, providerLabel, recreatingSession) {
572
613
  const message = recreatingSession ? ( localize(
573
- 5117,
614
+ 6438,
574
615
  "The MCP Server Definition '{0}' wants you to authenticate to {1}.",
575
616
  mcpLabel,
576
617
  providerLabel
577
618
  )) : ( localize(
578
- 5118,
619
+ 6439,
579
620
  "The MCP Server Definition '{0}' wants to authenticate to {1}.",
580
621
  mcpLabel,
581
622
  providerLabel
582
623
  ));
583
624
  const buttons = [{
584
- label: ( localize(5119, "&&Allow")),
625
+ label: ( localize(6440, "&&Allow")),
585
626
  run() {
586
627
  return true;
587
628
  }
@@ -602,11 +643,12 @@ let MainThreadMcp = class MainThreadMcp extends Disposable {
602
643
  }
603
644
  this._servers.clear();
604
645
  this._serverDefinitions.clear();
646
+ this._serverRequestUrls.clear();
605
647
  this._serverAuthTracking.clear();
606
648
  super.dispose();
607
649
  }
608
650
  };
609
- MainThreadMcp = __decorate([extHostNamedCustomer(MainContext.MainThreadMcp), ( __param(1, IMcpRegistry)), ( __param(2, IDialogService)), ( __param(3, IAuthenticationService)), ( __param(4, IAuthenticationMcpService)), ( __param(5, IAuthenticationMcpAccessService)), ( __param(6, IAuthenticationMcpUsageService)), ( __param(7, IDynamicAuthenticationProviderStorageService)), ( __param(8, IExtensionService)), ( __param(9, IContextKeyService)), ( __param(10, ITelemetryService)), ( __param(11, IWorkbenchMcpGatewayService)), ( __param(12, IConfigurationService)), ( __param(13, ISecretStorageService))], MainThreadMcp);
651
+ MainThreadMcp = __decorate([extHostNamedCustomer(MainContext.MainThreadMcp), ( __param(1, IMcpRegistry)), ( __param(2, IDialogService)), ( __param(3, IAuthenticationService)), ( __param(4, IAuthenticationMcpService)), ( __param(5, IAuthenticationMcpAccessService)), ( __param(6, IAuthenticationMcpUsageService)), ( __param(7, IDynamicAuthenticationProviderStorageService)), ( __param(8, IExtensionService)), ( __param(9, IContextKeyService)), ( __param(10, ITelemetryService)), ( __param(11, IWorkbenchMcpGatewayService)), ( __param(12, IConfigurationService)), ( __param(13, ISecretStorageService)), ( __param(14, IAllowedMcpServersService))], MainThreadMcp);
610
652
  class ExtHostMcpServerLaunch extends Disposable {
611
653
  pushLog(level, message) {
612
654
  this._onDidLog.fire({
@@ -22,9 +22,10 @@ import { CursorWorkspaceMcpDiscoveryAdapter } from '../common/discovery/workspac
22
22
  import { WorkspaceDotMcpDiscovery } from '../common/discovery/workspaceDotMcpDiscovery.js';
23
23
  import { McpCommandIds } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpCommandIds';
24
24
  import { mcpServerSchema } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
25
+ import '../common/mcpCopilotGlobalConfigurationService.js';
26
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
25
27
  import { McpContextKeysController } from '../common/mcpContextKeys.js';
26
28
  import '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpDevMode';
27
- import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
28
29
  import { McpLanguageModelToolContribution } from '../common/mcpLanguageModelToolContribution.js';
29
30
  import '../common/mcpRegistry.js';
30
31
  import '../common/mcpSandboxService.js';
@@ -40,10 +41,13 @@ import './mcpElicitationService.js';
40
41
  import { McpLanguageFeatures } from './mcpLanguageFeatures.js';
41
42
  import { McpConfigMigrationContribution } from './mcpMigration.js';
42
43
  import { McpResourceQuickAccess } from './mcpResourceQuickAccess.js';
44
+ import { AccessibleViewRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/browser/accessibleViewRegistry';
45
+ import { McpServerConfigurationFormAccessibilityHelp } from './mcpServerConfigurationFormAccessibility.js';
43
46
  import { McpServerEditor } from './mcpServerEditor.js';
44
47
  import { McpServerEditorInput } from './mcpServerEditorInput.js';
45
48
  import { MCPContextsInitialisation } from './mcpWorkbenchService.js';
46
49
 
50
+ AccessibleViewRegistry.register(( new McpServerConfigurationFormAccessibilityHelp()));
47
51
  mcpDiscoveryRegistry.register(( new SyncDescriptor(RemoteNativeMpcDiscovery)));
48
52
  mcpDiscoveryRegistry.register(( new SyncDescriptor(InstalledMcpServersDiscovery)));
49
53
  mcpDiscoveryRegistry.register(( new SyncDescriptor(ExtensionMcpDiscovery)));
@@ -113,16 +117,16 @@ registerWorkbenchContribution2(
113
117
  const jsonRegistry = ( Registry.as(Extensions.JSONContribution));
114
118
  jsonRegistry.registerSchema(mcpSchemaId, mcpServerSchema);
115
119
  ( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(
116
- EditorPaneDescriptor.create(McpServerEditor, McpServerEditor.ID, ( localize(15982, "MCP Server"))),
120
+ EditorPaneDescriptor.create(McpServerEditor, McpServerEditor.ID, ( localize(18395, "MCP Server"))),
117
121
  [( new SyncDescriptor(McpServerEditorInput))]
118
122
  );
119
123
  ( Registry.as(Extensions$1.Quickaccess)).registerQuickAccessProvider({
120
124
  ctor: McpResourceQuickAccess,
121
125
  prefix: McpResourceQuickAccess.PREFIX,
122
126
  when: ChatContextKeys.enabled,
123
- placeholder: ( localize(15983, "Filter to an MCP resource")),
127
+ placeholder: ( localize(18396, "Filter to an MCP resource")),
124
128
  helpEntries: [{
125
- description: ( localize(15984, "MCP Server Resources")),
129
+ description: ( localize(18397, "MCP Server Resources")),
126
130
  commandId: McpCommandIds.AddConfiguration
127
131
  }]
128
132
  });
@@ -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(15985, "MCP Resources...")),
46
+ label: ( localize(18398, "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(15986, "Select MCP Resource...")),
54
+ placeholder: ( localize(18399, "Select MCP Resource...")),
55
55
  picks: (_query, token) => this._getResourcePicks(token, helper),
56
56
  goBack: () => {
57
57
  return helper.navigateBack();
@@ -48,7 +48,7 @@ export declare class ResetMcpCachedTools extends Action2 {
48
48
  }
49
49
  export declare class AddConfigurationAction extends Action2 {
50
50
  constructor();
51
- run(accessor: ServicesAccessor, configUri?: string): Promise<void>;
51
+ run(accessor: ServicesAccessor, configUri?: URI | string): Promise<void>;
52
52
  }
53
53
  export declare class InstallFromManifestAction extends Action2 {
54
54
  constructor();