@codingame/monaco-vscode-mcp-service-override 16.1.1 → 17.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 (22) hide show
  1. package/package.json +5 -6
  2. package/vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js +6 -5
  3. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpDiscovery.js +1 -1
  4. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +24 -24
  5. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/configMcpDiscovery.js +3 -3
  6. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +4 -4
  7. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.d.ts +1 -1
  8. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +2 -2
  9. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.d.ts +1 -1
  10. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.js +2 -2
  11. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceMcpDiscoveryAdapter.js +1 -1
  12. package/vscode/src/vs/workbench/contrib/mcp/common/mcpConfigPathsService.js +3 -3
  13. package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.d.ts +4 -2
  14. package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +55 -17
  15. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.d.ts +17 -4
  16. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.js +127 -35
  17. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +14 -6
  18. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.d.ts +2 -1
  19. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.js +3 -0
  20. package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.js +51 -32
  21. package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocol.d.ts +36 -15
  22. package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocol.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-mcp-service-override",
3
- "version": "16.1.1",
3
+ "version": "17.0.0",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - mcp service-override",
6
6
  "keywords": [],
@@ -15,11 +15,10 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-2b1a9082-790f-527f-b013-d1b29d6265a3-common": "16.1.1",
19
- "@codingame/monaco-vscode-4a3ac544-9a61-534c-88df-756262793ef7-common": "16.1.1",
20
- "@codingame/monaco-vscode-ae8a8ca1-f243-508b-9c37-c88ebbd295fa-common": "16.1.1",
21
- "@codingame/monaco-vscode-api": "16.1.1",
22
- "@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common": "16.1.1"
18
+ "@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common": "17.0.0",
19
+ "@codingame/monaco-vscode-4a0e04a7-c3bd-5fb7-9d3b-4fd047cc9e59-common": "17.0.0",
20
+ "@codingame/monaco-vscode-4a3ac544-9a61-534c-88df-756262793ef7-common": "17.0.0",
21
+ "@codingame/monaco-vscode-api": "17.0.0"
23
22
  },
24
23
  "main": "index.js",
25
24
  "module": "index.js",
@@ -5,7 +5,7 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/ext
5
5
  import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/platform/jsonschemas/common/jsonContributionRegistry';
6
6
  import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
7
7
  import { registerWorkbenchContribution2, WorkbenchPhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
8
- import { mcpSchemaId } from '@codingame/monaco-vscode-2b1a9082-790f-527f-b013-d1b29d6265a3-common/vscode/vs/workbench/services/configuration/common/configuration';
8
+ import { mcpSchemaId } from '@codingame/monaco-vscode-4a0e04a7-c3bd-5fb7-9d3b-4fd047cc9e59-common/vscode/vs/workbench/services/configuration/common/configuration';
9
9
  import { ConfigMcpDiscovery } from '../common/discovery/configMcpDiscovery.js';
10
10
  import { ExtensionMcpDiscovery } from '../common/discovery/extensionMcpDiscovery.js';
11
11
  import { mcpDiscoveryRegistry } from '../common/discovery/mcpDiscovery.js';
@@ -13,14 +13,14 @@ import { RemoteNativeMpcDiscovery } from '../common/discovery/nativeMcpRemoteDis
13
13
  import { CursorWorkspaceMcpDiscoveryAdapter } from '../common/discovery/workspaceMcpDiscoveryAdapter.js';
14
14
  import '../common/mcpConfigPathsService.js';
15
15
  import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
16
- import { mcpServerSchema } from '@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
17
- import { McpContextKeysController } from '@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/workbench/contrib/mcp/common/mcpContextKeys';
16
+ import { mcpServerSchema } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
17
+ import { McpContextKeysController } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/common/mcpContextKeys';
18
18
  import '../common/mcpRegistry.js';
19
19
  import '../common/mcpService.js';
20
- import { ListMcpServerCommand, McpServerOptionsCommand, ResetMcpTrustCommand, ResetMcpCachedTools, AddConfigurationAction, RemoveStoredInput, EditStoredInput, StartServer, StopServer, ShowOutput, InstallFromActivation, RestartServer, MCPServerActionRendering } from '@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/workbench/contrib/mcp/browser/mcpCommands';
20
+ import { ListMcpServerCommand, McpServerOptionsCommand, ResetMcpTrustCommand, ResetMcpCachedTools, AddConfigurationAction, RemoveStoredInput, EditStoredInput, StartServer, StopServer, ShowOutput, InstallFromActivation, RestartServer, ShowConfiguration, MCPServerActionRendering } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/browser/mcpCommands';
21
21
  import { McpDiscovery } from './mcpDiscovery.js';
22
22
  import { McpLanguageFeatures } from './mcpLanguageFeatures.js';
23
- import { McpUrlHandler } from '@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/workbench/contrib/mcp/browser/mcpUrlHandler';
23
+ import { McpUrlHandler } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/browser/mcpUrlHandler';
24
24
 
25
25
  mcpDiscoveryRegistry.register(( new SyncDescriptor(RemoteNativeMpcDiscovery)));
26
26
  mcpDiscoveryRegistry.register(( new SyncDescriptor(ConfigMcpDiscovery)));
@@ -42,6 +42,7 @@ registerAction2(StopServer);
42
42
  registerAction2(ShowOutput);
43
43
  registerAction2(InstallFromActivation);
44
44
  registerAction2(RestartServer);
45
+ registerAction2(ShowConfiguration);
45
46
  registerWorkbenchContribution2('mcpActionRendering', MCPServerActionRendering, WorkbenchPhase.BlockRestore);
46
47
  const jsonRegistry = ( Registry.as(Extensions.JSONContribution));
47
48
  jsonRegistry.registerSchema(mcpSchemaId, mcpServerSchema);
@@ -6,7 +6,7 @@ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
6
6
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
7
7
  import { observableConfigValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
8
8
  import { mcpDiscoveryRegistry } from '../common/discovery/mcpDiscovery.js';
9
- import { mcpEnabledSection } from '@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
9
+ import { mcpEnabledSection } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
10
10
  import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
11
11
 
12
12
  let McpDiscovery = class McpDiscovery extends Disposable {
@@ -13,12 +13,12 @@ import { MarkerSeverity } from '@codingame/monaco-vscode-api/vscode/vs/platform/
13
13
  import { IMarkerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/markers/common/markers.service';
14
14
  import { IConfigurationResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/configurationResolver.service';
15
15
  import { ConfigurationResolverExpression } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/configurationResolverExpression';
16
+ import { McpCommandIds } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/common/mcpCommandIds';
16
17
  import { IMcpConfigPathsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpConfigPathsService.service';
17
- import { mcpConfigurationSection } from '@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
18
+ import { mcpConfigurationSection } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
18
19
  import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
19
20
  import { McpConnectionState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
20
21
  import { IMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
21
- import { StartServer, ShowOutput, StopServer, RestartServer, EditStoredInput, RemoveStoredInput } from '@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/workbench/contrib/mcp/browser/mcpCommands';
22
22
 
23
23
  const diagnosticOwner = 'vscode.mcp';
24
24
  let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
@@ -103,7 +103,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
103
103
  diagnostics.push({
104
104
  severity: MarkerSeverity.Warning,
105
105
  message: ( localize(
106
- 7618,
106
+ 7700,
107
107
  'Variable `{0}` not found, did you mean ${{1}}?',
108
108
  name,
109
109
  getClosestMatchingVariable(name) + (arg ? `:${arg}` : '')
@@ -160,15 +160,15 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
160
160
  lenses.lenses.push({
161
161
  range,
162
162
  command: {
163
- id: ShowOutput.ID,
164
- title: '$(error) ' + ( localize(7619, 'Error')),
163
+ id: McpCommandIds.ShowOutput,
164
+ title: '$(error) ' + ( localize(7701, 'Error')),
165
165
  arguments: [server.definition.id],
166
166
  },
167
167
  }, {
168
168
  range,
169
169
  command: {
170
- id: RestartServer.ID,
171
- title: ( localize(7620, "Restart")),
170
+ id: McpCommandIds.RestartServer,
171
+ title: ( localize(7702, "Restart")),
172
172
  arguments: [server.definition.id],
173
173
  },
174
174
  });
@@ -177,15 +177,15 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
177
177
  lenses.lenses.push({
178
178
  range,
179
179
  command: {
180
- id: ShowOutput.ID,
181
- title: '$(loading~spin) ' + ( localize(7621, 'Starting')),
180
+ id: McpCommandIds.ShowOutput,
181
+ title: '$(loading~spin) ' + ( localize(7703, 'Starting')),
182
182
  arguments: [server.definition.id],
183
183
  },
184
184
  }, {
185
185
  range,
186
186
  command: {
187
- id: StopServer.ID,
188
- title: ( localize(7622, "Cancel")),
187
+ id: McpCommandIds.StopServer,
188
+ title: ( localize(7704, "Cancel")),
189
189
  arguments: [server.definition.id],
190
190
  },
191
191
  });
@@ -194,29 +194,29 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
194
194
  lenses.lenses.push({
195
195
  range,
196
196
  command: {
197
- id: ShowOutput.ID,
198
- title: '$(check) ' + ( localize(7623, 'Running')),
197
+ id: McpCommandIds.ShowOutput,
198
+ title: '$(check) ' + ( localize(7705, 'Running')),
199
199
  arguments: [server.definition.id],
200
200
  },
201
201
  }, {
202
202
  range,
203
203
  command: {
204
- id: StopServer.ID,
205
- title: ( localize(7624, "Stop")),
204
+ id: McpCommandIds.StopServer,
205
+ title: ( localize(7706, "Stop")),
206
206
  arguments: [server.definition.id],
207
207
  },
208
208
  }, {
209
209
  range,
210
210
  command: {
211
- id: RestartServer.ID,
212
- title: ( localize(7620, "Restart")),
211
+ id: McpCommandIds.RestartServer,
212
+ title: ( localize(7702, "Restart")),
213
213
  arguments: [server.definition.id],
214
214
  },
215
215
  }, {
216
216
  range,
217
217
  command: {
218
218
  id: '',
219
- title: ( localize(7625, '{0} tools', read(server.tools).length)),
219
+ title: ( localize(7707, '{0} tools', read(server.tools).length)),
220
220
  },
221
221
  });
222
222
  break;
@@ -224,8 +224,8 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
224
224
  lenses.lenses.push({
225
225
  range,
226
226
  command: {
227
- id: StartServer.ID,
228
- title: '$(debug-start) ' + ( localize(7626, "Start")),
227
+ id: McpCommandIds.StartServer,
228
+ title: '$(debug-start) ' + ( localize(7708, "Start")),
229
229
  arguments: [server.definition.id],
230
230
  },
231
231
  });
@@ -235,7 +235,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
235
235
  range,
236
236
  command: {
237
237
  id: '',
238
- title: ( localize(7627, '{0} cached tools', toolCount)),
238
+ title: ( localize(7709, '{0} cached tools', toolCount)),
239
239
  }
240
240
  });
241
241
  }
@@ -302,9 +302,9 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
302
302
  }
303
303
  function pushAnnotation(savedId, offset, saved) {
304
304
  const tooltip = ( new MarkdownString([
305
- markdownCommandLink({ id: EditStoredInput.ID, title: ( localize(7628, 'Edit')), arguments: [savedId, model.uri, mcpConfigurationSection, inConfig.target] }),
306
- markdownCommandLink({ id: RemoveStoredInput.ID, title: ( localize(7629, 'Clear')), arguments: [inConfig.scope, savedId] }),
307
- markdownCommandLink({ id: RemoveStoredInput.ID, title: ( localize(7630, 'Clear All')), arguments: [inConfig.scope] }),
305
+ markdownCommandLink({ id: McpCommandIds.EditStoredInput, title: ( localize(7710, 'Edit')), arguments: [savedId, model.uri, mcpConfigurationSection, inConfig.target] }),
306
+ markdownCommandLink({ id: McpCommandIds.RemoveStoredInput, title: ( localize(7711, 'Clear')), arguments: [inConfig.scope, savedId] }),
307
+ markdownCommandLink({ id: McpCommandIds.RemoveStoredInput, title: ( localize(7712, 'Clear All')), arguments: [inConfig.scope] }),
308
308
  ].join(' | '), { isTrusted: true }));
309
309
  const hint = {
310
310
  label: '= ' + (saved.input?.type === 'promptString' && saved.input.password ? '*'.repeat(10) : (saved.value || '')),
@@ -9,7 +9,7 @@ import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor
9
9
  import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
10
10
  import { getMcpServerMapping } from '../mcpConfigFileUtils.js';
11
11
  import { IMcpConfigPathsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpConfigPathsService.service';
12
- import { mcpConfigurationSection } from '@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
12
+ import { mcpConfigurationSection } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
13
13
  import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
14
14
  import { McpServerTransportType, McpServerDefinition } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
15
15
  import { autorunDelta } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
@@ -91,8 +91,8 @@ let ConfigMcpDiscovery = class ConfigMcpDiscovery extends Disposable {
91
91
  const nextDefinitions = ( Object.entries(value?.servers || {}).map(([name, value]) => ({
92
92
  id: `${collectionId}.${name}`,
93
93
  label: name,
94
- launch: 'type' in value && value.type === 'sse' ? {
95
- type: McpServerTransportType.SSE,
94
+ launch: 'url' in value ? {
95
+ type: McpServerTransportType.HTTP,
96
96
  uri: ( URI.parse(value.url)),
97
97
  headers: Object.entries(value.headers || {}),
98
98
  } : {
@@ -8,7 +8,7 @@ import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode
8
8
  import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
9
9
  import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
10
10
  import { ExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
11
- import { mcpContributionPoint, mcpActivationEvent } from '@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
11
+ import { mcpContributionPoint, mcpActivationEvent } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
12
12
  import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
13
13
  import { McpServerDefinition, extensionPrefixedIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
14
14
  import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/base';
@@ -83,16 +83,16 @@ let ExtensionMcpDiscovery = ExtensionMcpDiscovery_1 = class ExtensionMcpDiscover
83
83
  }
84
84
  static _validate(user) {
85
85
  if (!Array.isArray(user.value)) {
86
- user.collector.error(( localize(7631, "Expected an array of MCP collections")));
86
+ user.collector.error(( localize(7713, "Expected an array of MCP collections")));
87
87
  return false;
88
88
  }
89
89
  for (const contribution of user.value) {
90
90
  if (typeof contribution.id !== 'string' || isFalsyOrWhitespace(contribution.id)) {
91
- user.collector.error(( localize(7632, "Expected 'id' to be a non-empty string.")));
91
+ user.collector.error(( localize(7714, "Expected 'id' to be a non-empty string.")));
92
92
  return false;
93
93
  }
94
94
  if (typeof contribution.label !== 'string' || isFalsyOrWhitespace(contribution.label)) {
95
- user.collector.error(( localize(7633, "Expected 'label' to be a non-empty string.")));
95
+ user.collector.error(( localize(7715, "Expected 'label' to be a non-empty string.")));
96
96
  return false;
97
97
  }
98
98
  }
@@ -8,7 +8,7 @@ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/pl
8
8
  import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
9
9
  import { INativeMcpDiscoveryData } from "../../../../../platform/mcp/common/nativeMcpDiscoveryHelper.js";
10
10
  import { Dto } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/proxyIdentifier";
11
- import { DiscoverySource } from "@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration";
11
+ import { DiscoverySource } from "@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration";
12
12
  import { IMcpRegistry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service";
13
13
  import { McpCollectionDefinition, McpServerDefinition } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes";
14
14
  import { IMcpDiscovery } from "./mcpDiscovery.js";
@@ -12,7 +12,7 @@ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
12
12
  import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
13
13
  import { observableConfigValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
14
14
  import { StorageScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
15
- import { mcpDiscoverySection, discoverySourceLabel } from '@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
15
+ import { mcpDiscoverySection, discoverySourceLabel } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
16
16
  import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
17
17
  import { McpCollectionSortOrder } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
18
18
  import { ClaudeDesktopMpcDiscoveryAdapter, CursorDesktopMpcDiscoveryAdapter, WindsurfDesktopMpcDiscoveryAdapter } from './nativeMcpDiscoveryAdapters.js';
@@ -81,7 +81,7 @@ let NativeFilesystemMcpDiscovery = class NativeFilesystemMcpDiscovery extends Fi
81
81
  this.suffix = '';
82
82
  if (remoteAuthority) {
83
83
  this.suffix = ' ' + ( localize(
84
- 7634,
84
+ 7716,
85
85
  ' on {0}',
86
86
  labelService.getHostLabel(Schemas.vscodeRemote, remoteAuthority)
87
87
  ));
@@ -2,7 +2,7 @@ import { VSBuffer } from "@codingame/monaco-vscode-api/vscode/vs/base/common/buf
2
2
  import { Mutable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/types";
3
3
  import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
4
4
  import { INativeMcpDiscoveryData } from "../../../../../platform/mcp/common/nativeMcpDiscoveryHelper.js";
5
- import { DiscoverySource } from "@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration";
5
+ import { DiscoverySource } from "@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration";
6
6
  import { McpCollectionSortOrder, McpServerDefinition } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes";
7
7
  export interface NativeMpcDiscoveryAdapter {
8
8
  readonly remoteAuthority: string | null;
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { Platform } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
3
3
  import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
4
- import { DiscoverySource } from '@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
4
+ import { DiscoverySource } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
5
5
  import { McpServerTransportType, McpCollectionSortOrder } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
6
6
 
7
7
  function claudeConfigToServerDefinition(idPrefix, contents, cwd) {
@@ -17,7 +17,7 @@ function claudeConfigToServerDefinition(idPrefix, contents, cwd) {
17
17
  id: `${idPrefix}.${name}`,
18
18
  label: name,
19
19
  launch: server.url ? {
20
- type: McpServerTransportType.SSE,
20
+ type: McpServerTransportType.HTTP,
21
21
  uri: ( URI.parse(server.url)),
22
22
  headers: [],
23
23
  } : {
@@ -9,7 +9,7 @@ import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/fi
9
9
  import { StorageScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
10
10
  import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
11
11
  import { IRemoteAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/remote/common/remoteAgentService.service';
12
- import { DiscoverySource } from '@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
12
+ import { DiscoverySource } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
13
13
  import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
14
14
  import { McpCollectionSortOrder } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
15
15
  import { FilesystemMcpDiscovery } from './nativeMcpDiscoveryAbstract.js';
@@ -13,10 +13,10 @@ import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform
13
13
  import { StorageScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
14
14
  import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
15
15
  import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
16
- import { FOLDER_SETTINGS_PATH } from '@codingame/monaco-vscode-2b1a9082-790f-527f-b013-d1b29d6265a3-common/vscode/vs/workbench/services/preferences/common/preferences';
16
+ import { FOLDER_SETTINGS_PATH } from '@codingame/monaco-vscode-4a0e04a7-c3bd-5fb7-9d3b-4fd047cc9e59-common/vscode/vs/workbench/services/preferences/common/preferences';
17
17
  import { IPreferencesService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/preferences/common/preferences.service';
18
18
  import { IRemoteAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/remote/common/remoteAgentService.service';
19
- import { mcpConfigurationSection } from '@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
19
+ import { mcpConfigurationSection } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
20
20
  import { McpCollectionSortOrder } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
21
21
  import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/base';
22
22
 
@@ -33,7 +33,7 @@ let McpConfigPathsService = class McpConfigPathsService extends Disposable {
33
33
  id: 'usrlocal',
34
34
  key: 'userLocalValue',
35
35
  target: ConfigurationTarget.USER_LOCAL,
36
- label: ( localize(7635, 'Global in {0}', productService.nameShort)),
36
+ label: ( localize(7717, 'Global in {0}', productService.nameShort)),
37
37
  scope: StorageScope.PROFILE,
38
38
  order: McpCollectionSortOrder.User,
39
39
  uri: preferencesService.userSettingsResource,
@@ -1,6 +1,7 @@
1
1
  import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
2
  import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
3
3
  import { ConfigurationTarget } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration";
4
+ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
4
5
  import { IDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service";
5
6
  import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
6
7
  import { INotificationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service";
@@ -26,18 +27,18 @@ export declare class McpRegistry extends Disposable implements IMcpRegistry {
26
27
  private readonly _trustPrompts;
27
28
  private readonly _collections;
28
29
  private readonly _delegates;
30
+ private readonly _enabled;
29
31
  readonly collections: IObservable<readonly McpCollectionDefinition[]>;
30
32
  private readonly _collectionToPrefixes;
31
33
  private readonly _workspaceStorage;
32
34
  private readonly _profileStorage;
33
35
  private readonly _trustMemento;
34
- private readonly _lazyCollectionsToUpdate;
35
36
  private readonly _ongoingLazyActivations;
36
37
  readonly lazyCollectionState: IObservable<LazyCollectionState>;
37
38
  get delegates(): readonly IMcpHostDelegate[];
38
39
  private readonly _onDidChangeInputs;
39
40
  readonly onDidChangeInputs: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
40
- constructor(_instantiationService: IInstantiationService, _configurationResolverService: IConfigurationResolverService, _dialogService: IDialogService, _storageService: IStorageService, _productService: IProductService, _notificationService: INotificationService, _editorService: IEditorService);
41
+ constructor(_instantiationService: IInstantiationService, _configurationResolverService: IConfigurationResolverService, _dialogService: IDialogService, _storageService: IStorageService, _productService: IProductService, _notificationService: INotificationService, _editorService: IEditorService, configurationService: IConfigurationService);
41
42
  registerDelegate(delegate: IMcpHostDelegate): IDisposable;
42
43
  registerCollection(collection: McpCollectionDefinition): IDisposable;
43
44
  collectionToolPrefix(collection: McpCollectionReference): IObservable<string>;
@@ -46,6 +47,7 @@ export declare class McpRegistry extends Disposable implements IMcpRegistry {
46
47
  private _getInputStorageInConfigTarget;
47
48
  clearSavedInputs(scope: StorageScope, inputId?: string): Promise<void>;
48
49
  editSavedInput(inputId: string, folderData: IWorkspaceFolderData | undefined, configSection: string, target: ConfigurationTarget): Promise<void>;
50
+ setSavedInput(inputId: string, target: ConfigurationTarget, value: string): Promise<void>;
49
51
  getSavedInputs(scope: StorageScope): Promise<{
50
52
  [id: string]: IResolvedValue;
51
53
  }>;
@@ -1,5 +1,6 @@
1
1
 
2
2
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
3
4
  import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
4
5
  import { StringSHA1 } from '@codingame/monaco-vscode-api/vscode/vs/base/common/hash';
5
6
  import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
@@ -7,19 +8,24 @@ import { Lazy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lazy';
7
8
  import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
8
9
  import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
9
10
  import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
11
+ import { indexOfPattern } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
10
12
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
11
13
  import { ConfigurationTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
14
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
12
15
  import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
13
16
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
14
17
  import '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification';
15
18
  import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
16
- import { observableMemento } from '@codingame/monaco-vscode-ec21d4de-4d65-574c-8715-bb1a6bbad376-common/vscode/vs/platform/observable/common/observableMemento';
19
+ import { observableMemento } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/platform/observable/common/observableMemento';
20
+ import { observableConfigValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
17
21
  import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
18
22
  import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
19
23
  import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
20
24
  import { IConfigurationResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/configurationResolver.service';
21
25
  import { ConfigurationResolverExpression } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/configurationResolverExpression';
26
+ import { AUX_WINDOW_GROUP } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService';
22
27
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
28
+ import { mcpEnabledSection } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
23
29
  import { McpRegistryInputStorage } from './mcpRegistryInputStorage.js';
24
30
  import { McpServerConnection } from './mcpServerConnection.js';
25
31
  import { LazyCollectionState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
@@ -36,7 +42,7 @@ let McpRegistry = class McpRegistry extends Disposable {
36
42
  get delegates() {
37
43
  return this._delegates;
38
44
  }
39
- constructor(_instantiationService, _configurationResolverService, _dialogService, _storageService, _productService, _notificationService, _editorService) {
45
+ constructor(_instantiationService, _configurationResolverService, _dialogService, _storageService, _productService, _notificationService, _editorService, configurationService) {
40
46
  super();
41
47
  this._instantiationService = _instantiationService;
42
48
  this._configurationResolverService = _configurationResolverService;
@@ -48,12 +54,18 @@ let McpRegistry = class McpRegistry extends Disposable {
48
54
  this._trustPrompts = ( new Map());
49
55
  this._collections = observableValue('collections', []);
50
56
  this._delegates = [];
51
- this.collections = this._collections;
57
+ this.collections = derived(reader => {
58
+ if (!this._enabled.read(reader)) {
59
+ return [];
60
+ }
61
+ return this._collections.read(reader);
62
+ });
52
63
  this._collectionToPrefixes = ( this._collections.map(c => {
53
64
  const hashes = ( c.map((collection) => {
54
65
  const sha = ( new StringSHA1());
55
66
  sha.update(collection.id);
56
- return { view: 0, hash: sha.digest(), collection };
67
+ const hash = sha.digest();
68
+ return { view: indexOfPattern(hash, /[a-z]/i), hash, collection };
57
69
  }));
58
70
  const view = (h) => h.hash.slice(h.view, h.view + collectionPrefixLen);
59
71
  let collided = false;
@@ -80,9 +92,11 @@ let McpRegistry = class McpRegistry extends Disposable {
80
92
  this._trustMemento = ( new Lazy(
81
93
  () => this._register(createTrustMemento(StorageScope.APPLICATION, StorageTarget.MACHINE, this._storageService))
82
94
  ));
83
- this._lazyCollectionsToUpdate = ( new Set());
84
95
  this._ongoingLazyActivations = observableValue(this, 0);
85
96
  this.lazyCollectionState = derived(reader => {
97
+ if (this._enabled.read(reader) === false) {
98
+ return LazyCollectionState.AllKnown;
99
+ }
86
100
  if (this._ongoingLazyActivations.read(reader) > 0) {
87
101
  return LazyCollectionState.LoadingUnknown;
88
102
  }
@@ -91,6 +105,7 @@ let McpRegistry = class McpRegistry extends Disposable {
91
105
  });
92
106
  this._onDidChangeInputs = this._register(( new Emitter()));
93
107
  this.onDidChangeInputs = this._onDidChangeInputs.event;
108
+ this._enabled = observableConfigValue(mcpEnabledSection, true, configurationService);
94
109
  }
95
110
  registerDelegate(delegate) {
96
111
  this._delegates.push(delegate);
@@ -108,7 +123,6 @@ let McpRegistry = class McpRegistry extends Disposable {
108
123
  const currentCollections = this._collections.get();
109
124
  const toReplace = currentCollections.find(c => c.lazy && c.id === collection.id);
110
125
  if (toReplace) {
111
- this._lazyCollectionsToUpdate.add(collection.id);
112
126
  this._collections.set(( currentCollections.map(c => c === toReplace ? collection : c)), undefined);
113
127
  }
114
128
  else {
@@ -170,6 +184,15 @@ let McpRegistry = class McpRegistry extends Disposable {
170
184
  await this._configurationResolverService.resolveWithInteraction(folderData, expr, configSection, previous ? { [inputId.slice(2, -1)]: previous } : {}, target);
171
185
  await this._updateStorageWithExpressionInputs(storage, expr);
172
186
  }
187
+ async setSavedInput(inputId, target, value) {
188
+ const storage = this._getInputStorageInConfigTarget(target);
189
+ const expr = ConfigurationResolverExpression.parse(inputId);
190
+ for (const unresolved of expr.unresolved()) {
191
+ expr.resolve(unresolved, value);
192
+ break;
193
+ }
194
+ await this._updateStorageWithExpressionInputs(storage, expr);
195
+ }
173
196
  getSavedInputs(scope) {
174
197
  return this._getInputStorage(scope).getMap();
175
198
  }
@@ -198,23 +221,27 @@ let McpRegistry = class McpRegistry extends Disposable {
198
221
  const originURI = collection.presentation?.origin;
199
222
  const labelWithOrigin = originURI ? `[\`${basename(originURI)}\`](${originURI})` : collection.label;
200
223
  const result = await this._dialogService.prompt({
201
- message: ( localize(7655, 'Trust MCP servers from {0}?', collection.label)),
224
+ message: ( localize(7737, 'Trust MCP servers from {0}?', collection.label)),
202
225
  custom: {
226
+ icon: Codicon.shield,
203
227
  markdownDetails: [{
204
228
  markdown: ( new MarkdownString(( localize(
205
- 7656,
229
+ 7738,
206
230
  '{0} discovered Model Context Protocol servers from {1} (`{2}`). {0} can use their capabilities in Chat.\n\nDo you want to allow running MCP servers from {3}?',
207
231
  this._productService.nameShort,
208
232
  collection.label,
209
233
  ( collection.serverDefinitions.get().map(s => s.label)).join('`, `'),
210
234
  labelWithOrigin
211
235
  )))),
212
- dismissOnLinkClick: true,
236
+ actionHandler: () => {
237
+ const editor = this._editorService.openEditor({ resource: collection.presentation.origin }, AUX_WINDOW_GROUP);
238
+ return editor.then(Boolean);
239
+ },
213
240
  }]
214
241
  },
215
242
  buttons: [
216
- { label: ( localize(7657, 'Trust')), run: () => true },
217
- { label: ( localize(7658, 'Do not trust')), run: () => false }
243
+ { label: ( localize(7739, 'Trust')), run: () => true },
244
+ { label: ( localize(7740, 'Do not trust')), run: () => false }
218
245
  ],
219
246
  });
220
247
  return result.result;
@@ -252,7 +279,11 @@ let McpRegistry = class McpRegistry extends Disposable {
252
279
  return await this._configurationResolverService.resolveAsync(folder, expr);
253
280
  }
254
281
  async resolveConnection({ collectionRef, definitionRef, forceTrust, logger }) {
255
- const collection = this._collections.get().find(c => c.id === collectionRef.id);
282
+ let collection = this._collections.get().find(c => c.id === collectionRef.id);
283
+ if (collection?.lazy) {
284
+ await collection.lazy.load();
285
+ collection = this._collections.get().find(c => c.id === collectionRef.id);
286
+ }
256
287
  const definition = collection?.serverDefinitions.get().find(s => s.id === definitionRef.id);
257
288
  if (!collection || !definition) {
258
289
  throw ( new Error(
@@ -280,14 +311,20 @@ let McpRegistry = class McpRegistry extends Disposable {
280
311
  return undefined;
281
312
  }
282
313
  }
283
- let launch;
314
+ let launch = definition.launch;
315
+ if (collection.resolveServerLanch) {
316
+ launch = await collection.resolveServerLanch(definition);
317
+ if (!launch) {
318
+ return undefined;
319
+ }
320
+ }
284
321
  try {
285
- launch = await this._replaceVariablesInLaunch(definition, definition.launch);
322
+ launch = await this._replaceVariablesInLaunch(definition, launch);
286
323
  }
287
324
  catch (e) {
288
325
  this._notificationService.notify({
289
326
  severity: Severity.Error,
290
- message: ( localize(7659, 'Error starting {0}: {1}', definition.label, String(e))),
327
+ message: ( localize(7741, 'Error starting {0}: {1}', definition.label, String(e))),
291
328
  actions: {
292
329
  primary: collection.presentation?.origin && [
293
330
  {
@@ -295,7 +332,7 @@ let McpRegistry = class McpRegistry extends Disposable {
295
332
  class: undefined,
296
333
  enabled: true,
297
334
  tooltip: '',
298
- label: ( localize(7660, 'Open Configuration')),
335
+ label: ( localize(7742, 'Open Configuration')),
299
336
  run: () => this._editorService.openEditor({
300
337
  resource: collection.presentation.origin,
301
338
  options: { selection: definition.presentation?.origin?.range }
@@ -316,7 +353,8 @@ McpRegistry = ( __decorate([
316
353
  ( __param(3, IStorageService)),
317
354
  ( __param(4, IProductService)),
318
355
  ( __param(5, INotificationService)),
319
- ( __param(6, IEditorService))
356
+ ( __param(6, IEditorService)),
357
+ ( __param(7, IConfigurationService))
320
358
  ], McpRegistry));
321
359
 
322
360
  export { McpRegistry };