@codingame/monaco-vscode-mcp-service-override 17.2.1 → 18.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 (64) hide show
  1. package/index.js +20 -2
  2. package/package.json +14 -5
  3. package/vscode/src/vs/platform/mcp/common/mcpGalleryService.d.ts +26 -0
  4. package/vscode/src/vs/platform/mcp/common/mcpGalleryService.js +170 -0
  5. package/vscode/src/vs/platform/mcp/common/mcpManagementService.d.ts +35 -0
  6. package/vscode/src/vs/platform/mcp/common/mcpManagementService.js +292 -0
  7. package/vscode/src/vs/platform/mcp/common/mcpPlatformTypes.d.ts +65 -0
  8. package/vscode/src/vs/platform/mcp/common/mcpPlatformTypes.js +9 -0
  9. package/vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js +64 -5
  10. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.d.ts +12 -0
  11. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.js +76 -0
  12. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpDiscovery.js +2 -2
  13. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +73 -27
  14. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.d.ts +106 -0
  15. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.js +423 -0
  16. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.d.ts +61 -0
  17. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +542 -0
  18. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.d.ts +17 -0
  19. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +45 -0
  20. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.d.ts +54 -0
  21. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +272 -0
  22. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.d.ts +24 -0
  23. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +193 -0
  24. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.d.ts +56 -0
  25. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +176 -0
  26. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/configMcpDiscovery.d.ts +3 -1
  27. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/configMcpDiscovery.js +27 -6
  28. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +8 -6
  29. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.d.ts +1 -1
  30. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +6 -4
  31. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.d.ts +1 -1
  32. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.js +2 -2
  33. package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceMcpDiscoveryAdapter.js +4 -2
  34. package/vscode/src/vs/workbench/contrib/mcp/common/mcpConfigPathsService.js +4 -4
  35. package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.d.ts +23 -0
  36. package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.js +89 -0
  37. package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.service.d.ts +6 -0
  38. package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.service.js +6 -0
  39. package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.d.ts +8 -6
  40. package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +30 -47
  41. package/vscode/src/vs/workbench/contrib/mcp/common/mcpResourceFilesystem.d.ts +35 -0
  42. package/vscode/src/vs/workbench/contrib/mcp/common/mcpResourceFilesystem.js +206 -0
  43. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.d.ts +26 -0
  44. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.js +110 -0
  45. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.d.ts +38 -0
  46. package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js +256 -0
  47. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.d.ts +29 -13
  48. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.js +313 -116
  49. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.d.ts +2 -2
  50. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +15 -17
  51. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.d.ts +16 -7
  52. package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.js +58 -39
  53. package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.d.ts +1 -1
  54. package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.js +109 -46
  55. package/vscode/src/vs/workbench/contrib/mcp/common/uriTemplate.d.ts +25 -0
  56. package/vscode/src/vs/workbench/contrib/mcp/common/uriTemplate.js +296 -0
  57. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpAccessService.d.ts +27 -0
  58. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpAccessService.js +73 -0
  59. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.d.ts +51 -0
  60. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +391 -0
  61. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpUsageService.d.ts +27 -0
  62. package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpUsageService.js +105 -0
  63. package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocol.d.ts +0 -395
  64. package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocol.js +0 -14
@@ -0,0 +1,9 @@
1
+
2
+
3
+ var McpServerVariableType;
4
+ (function (McpServerVariableType) {
5
+ McpServerVariableType["PROMPT"] = "promptString";
6
+ McpServerVariableType["PICK"] = "pickString";
7
+ })(McpServerVariableType || (McpServerVariableType = {}));
8
+
9
+ export { McpServerVariableType };
@@ -1,26 +1,45 @@
1
1
 
2
+ import { localize2, localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
2
3
  import { registerAction2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
4
+ import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
3
5
  import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
4
6
  import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
5
7
  import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/platform/jsonschemas/common/jsonContributionRegistry';
8
+ import { Extensions as Extensions$2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickAccess';
6
9
  import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
10
+ import { EditorPaneDescriptor } from '@codingame/monaco-vscode-dcfc2191-2da1-54c7-8fb7-e92c5d11ecef-common/vscode/vs/workbench/browser/editor';
7
11
  import { registerWorkbenchContribution2, WorkbenchPhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
8
- import { mcpSchemaId } from '@codingame/monaco-vscode-4a0e04a7-c3bd-5fb7-9d3b-4fd047cc9e59-common/vscode/vs/workbench/services/configuration/common/configuration';
12
+ import { EditorExtensions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
13
+ import { Extensions as Extensions$1 } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
14
+ import { mcpSchemaId } from '@codingame/monaco-vscode-ce7c734f-7712-563c-9335-d7acb43306af-common/vscode/vs/workbench/services/configuration/common/configuration';
15
+ import { VIEW_CONTAINER } from '@codingame/monaco-vscode-2673c6e2-17c1-5710-b169-46f3d4a28696-common/vscode/vs/workbench/contrib/extensions/browser/extensions.contribution';
16
+ import { DefaultViewsContext, SearchMcpServersContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions';
9
17
  import { ConfigMcpDiscovery } from '../common/discovery/configMcpDiscovery.js';
10
18
  import { ExtensionMcpDiscovery } from '../common/discovery/extensionMcpDiscovery.js';
11
19
  import { mcpDiscoveryRegistry } from '../common/discovery/mcpDiscovery.js';
12
20
  import { RemoteNativeMpcDiscovery } from '../common/discovery/nativeMcpRemoteDiscovery.js';
13
21
  import { CursorWorkspaceMcpDiscoveryAdapter } from '../common/discovery/workspaceMcpDiscoveryAdapter.js';
22
+ import { McpCommandIds } from '@codingame/monaco-vscode-aa9ead53-dfd3-59da-b9e7-f163d201de8d-common/vscode/vs/workbench/contrib/mcp/common/mcpCommandIds';
14
23
  import '../common/mcpConfigPathsService.js';
15
24
  import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
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';
25
+ import { mcpServerSchema } from '@codingame/monaco-vscode-aa9ead53-dfd3-59da-b9e7-f163d201de8d-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
26
+ import { McpContextKeysController } from '@codingame/monaco-vscode-aa9ead53-dfd3-59da-b9e7-f163d201de8d-common/vscode/vs/workbench/contrib/mcp/common/mcpContextKeys';
27
+ import '../common/mcpDevMode.js';
18
28
  import '../common/mcpRegistry.js';
29
+ import { McpResourceFilesystem } from '../common/mcpResourceFilesystem.js';
30
+ import '../common/mcpSamplingService.js';
19
31
  import '../common/mcpService.js';
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';
32
+ import { InstalledMcpServersViewId, HasInstalledMcpServersContext, McpServersGalleryEnabledContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
33
+ import { McpAddContextContribution } from './mcpAddContextContribution.js';
34
+ import { ListMcpServerCommand, McpServerOptionsCommand, ResetMcpTrustCommand, ResetMcpCachedTools, AddConfigurationAction, RemoveStoredInput, EditStoredInput, StartServer, StopServer, ShowOutput, InstallFromActivation, RestartServer, ShowConfiguration, McpBrowseCommand, McpBrowseResourcesCommand, McpConfigureSamplingModels, McpStartPromptingServerCommand, MCPServerActionRendering } from '@codingame/monaco-vscode-aa9ead53-dfd3-59da-b9e7-f163d201de8d-common/vscode/vs/workbench/contrib/mcp/browser/mcpCommands';
21
35
  import { McpDiscovery } from './mcpDiscovery.js';
22
36
  import { McpLanguageFeatures } from './mcpLanguageFeatures.js';
23
- import { McpUrlHandler } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/browser/mcpUrlHandler';
37
+ import { McpResourceQuickAccess } from '@codingame/monaco-vscode-aa9ead53-dfd3-59da-b9e7-f163d201de8d-common/vscode/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess';
38
+ import { McpServerEditor } from './mcpServerEditor.js';
39
+ import { McpServerEditorInput } from './mcpServerEditorInput.js';
40
+ import { McpServersListView } from './mcpServersView.js';
41
+ import { McpUrlHandler } from '@codingame/monaco-vscode-aa9ead53-dfd3-59da-b9e7-f163d201de8d-common/vscode/vs/workbench/contrib/mcp/browser/mcpUrlHandler';
42
+ import { MCPContextsInitialisation } from './mcpWorkbenchService.js';
24
43
 
25
44
  mcpDiscoveryRegistry.register(( new SyncDescriptor(RemoteNativeMpcDiscovery)));
26
45
  mcpDiscoveryRegistry.register(( new SyncDescriptor(ConfigMcpDiscovery)));
@@ -30,6 +49,7 @@ registerWorkbenchContribution2('mcpDiscovery', McpDiscovery, WorkbenchPhase.Afte
30
49
  registerWorkbenchContribution2('mcpContextKeys', McpContextKeysController, WorkbenchPhase.BlockRestore);
31
50
  registerWorkbenchContribution2('mcpLanguageFeatures', McpLanguageFeatures, WorkbenchPhase.Eventually);
32
51
  registerWorkbenchContribution2('mcpUrlHandler', McpUrlHandler, WorkbenchPhase.BlockRestore);
52
+ registerWorkbenchContribution2('mcpResourceFilesystem', McpResourceFilesystem, WorkbenchPhase.BlockRestore);
33
53
  registerAction2(ListMcpServerCommand);
34
54
  registerAction2(McpServerOptionsCommand);
35
55
  registerAction2(ResetMcpTrustCommand);
@@ -43,6 +63,45 @@ registerAction2(ShowOutput);
43
63
  registerAction2(InstallFromActivation);
44
64
  registerAction2(RestartServer);
45
65
  registerAction2(ShowConfiguration);
66
+ registerAction2(McpBrowseCommand);
67
+ registerAction2(McpBrowseResourcesCommand);
68
+ registerAction2(McpConfigureSamplingModels);
69
+ registerAction2(McpStartPromptingServerCommand);
46
70
  registerWorkbenchContribution2('mcpActionRendering', MCPServerActionRendering, WorkbenchPhase.BlockRestore);
71
+ registerWorkbenchContribution2('mcpAddContext', McpAddContextContribution, WorkbenchPhase.Eventually);
72
+ registerWorkbenchContribution2(MCPContextsInitialisation.ID, MCPContextsInitialisation, WorkbenchPhase.AfterRestored);
47
73
  const jsonRegistry = ( Registry.as(Extensions.JSONContribution));
48
74
  jsonRegistry.registerSchema(mcpSchemaId, mcpServerSchema);
75
+ ( Registry.as(Extensions$1.ViewsRegistry)).registerViews([
76
+ {
77
+ id: InstalledMcpServersViewId,
78
+ name: ( localize2(7767, "MCP Servers - Installed")),
79
+ ctorDescriptor: ( new SyncDescriptor(McpServersListView)),
80
+ when: ( ContextKeyExpr.and(
81
+ DefaultViewsContext,
82
+ HasInstalledMcpServersContext,
83
+ McpServersGalleryEnabledContext
84
+ )),
85
+ weight: 40,
86
+ order: 4,
87
+ canToggleVisibility: true
88
+ },
89
+ {
90
+ id: 'workbench.views.mcp.marketplace',
91
+ name: ( localize2(7768, "MCP Servers")),
92
+ ctorDescriptor: ( new SyncDescriptor(McpServersListView)),
93
+ when: ( ContextKeyExpr.and(SearchMcpServersContext, McpServersGalleryEnabledContext)),
94
+ }
95
+ ], VIEW_CONTAINER);
96
+ ( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(McpServerEditor, McpServerEditor.ID, ( localize(7769, "MCP Server"))), [
97
+ ( new SyncDescriptor(McpServerEditorInput))
98
+ ]);
99
+ ( Registry.as(Extensions$2.Quickaccess)).registerQuickAccessProvider({
100
+ ctor: McpResourceQuickAccess,
101
+ prefix: McpResourceQuickAccess.PREFIX,
102
+ placeholder: ( localize(7770, "Filter to an MCP resource")),
103
+ helpEntries: [{
104
+ description: ( localize(7771, "MCP Server Resources")),
105
+ commandId: McpCommandIds.AddConfiguration
106
+ }]
107
+ });
@@ -0,0 +1,12 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
3
+ import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
4
+ import { IChatContextPickService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatContextPickService.service";
5
+ export declare class McpAddContextContribution extends Disposable implements IWorkbenchContribution {
6
+ private readonly _chatContextPickService;
7
+ private readonly _helper;
8
+ private readonly _addContextMenu;
9
+ constructor(_chatContextPickService: IChatContextPickService, instantiationService: IInstantiationService);
10
+ private _registerAddContextMenu;
11
+ private _getResourcePicks;
12
+ }
@@ -0,0 +1,76 @@
1
+
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';
4
+ import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
5
+ import { Disposable, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
6
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
7
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
8
+ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
9
+ import { IChatContextPickService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatContextPickService.service';
10
+ import { McpResourcePickHelper } from '@codingame/monaco-vscode-aa9ead53-dfd3-59da-b9e7-f163d201de8d-common/vscode/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess';
11
+ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
12
+ import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
13
+
14
+ let McpAddContextContribution = class McpAddContextContribution extends Disposable {
15
+ constructor(_chatContextPickService, instantiationService) {
16
+ super();
17
+ this._chatContextPickService = _chatContextPickService;
18
+ this._addContextMenu = this._register(( new MutableDisposable()));
19
+ this._helper = instantiationService.createInstance(McpResourcePickHelper);
20
+ this._register(autorun(reader => {
21
+ const enabled = this._helper.hasServersWithResources.read(reader);
22
+ if (enabled && !this._addContextMenu.value) {
23
+ this._registerAddContextMenu();
24
+ }
25
+ else {
26
+ this._addContextMenu.clear();
27
+ }
28
+ }));
29
+ }
30
+ _registerAddContextMenu() {
31
+ this._addContextMenu.value = this._chatContextPickService.registerChatContextItem({
32
+ type: 'pickerPick',
33
+ label: ( localize(7772, "MCP Resources...")),
34
+ icon: Codicon.mcp,
35
+ asPicker: () => ({
36
+ placeholder: ( localize(7773, "Select MCP Resource...")),
37
+ picks: (_query, token) => this._getResourcePicks(token),
38
+ }),
39
+ });
40
+ }
41
+ _getResourcePicks(token) {
42
+ const observable = observableValue(this, { busy: true, picks: [] });
43
+ this._helper.getPicks(servers => {
44
+ const picks = [];
45
+ for (const [server, resources] of servers) {
46
+ if (resources.length === 0) {
47
+ continue;
48
+ }
49
+ picks.push(McpResourcePickHelper.sep(server));
50
+ for (const resource of resources) {
51
+ picks.push({
52
+ ...McpResourcePickHelper.item(resource),
53
+ asAttachment: () => this._helper.toAttachment(resource).then(r => {
54
+ if (!r) {
55
+ throw ( new CancellationError());
56
+ }
57
+ else {
58
+ return r;
59
+ }
60
+ }),
61
+ });
62
+ }
63
+ }
64
+ observable.set({ picks, busy: true }, undefined);
65
+ }, token).finally(() => {
66
+ observable.set({ busy: false, picks: observable.get().picks }, undefined);
67
+ });
68
+ return observable;
69
+ }
70
+ };
71
+ McpAddContextContribution = ( __decorate([
72
+ ( __param(0, IChatContextPickService)),
73
+ ( __param(1, IInstantiationService))
74
+ ], McpAddContextContribution));
75
+
76
+ export { McpAddContextContribution };
@@ -6,8 +6,8 @@ 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-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
10
- import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
9
+ import { mcpEnabledSection } from '@codingame/monaco-vscode-aa9ead53-dfd3-59da-b9e7-f163d201de8d-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
10
+ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
11
11
 
12
12
  let McpDiscovery = class McpDiscovery extends Disposable {
13
13
  static { this.ID = 'workbench.contrib.mcp.discovery'; }
@@ -13,9 +13,9 @@ 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
+ import { McpCommandIds } from '@codingame/monaco-vscode-aa9ead53-dfd3-59da-b9e7-f163d201de8d-common/vscode/vs/workbench/contrib/mcp/common/mcpCommandIds';
17
17
  import { IMcpConfigPathsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpConfigPathsService.service';
18
- import { mcpConfigurationSection } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
18
+ import { mcpConfigurationSection } from '@codingame/monaco-vscode-aa9ead53-dfd3-59da-b9e7-f163d201de8d-common/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
19
19
  import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
20
20
  import { McpConnectionState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
21
21
  import { IMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
@@ -103,7 +103,7 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
103
103
  diagnostics.push({
104
104
  severity: MarkerSeverity.Warning,
105
105
  message: ( localize(
106
- 7700,
106
+ 7859,
107
107
  'Variable `{0}` not found, did you mean ${{1}}?',
108
108
  name,
109
109
  getClosestMatchingVariable(name) + (arg ? `:${arg}` : '')
@@ -155,37 +155,49 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
155
155
  continue;
156
156
  }
157
157
  const range = Range.fromPositions(model.getPositionAt(node.children[0].offset));
158
- switch (read(server.connectionState).state) {
158
+ const canDebug = !!server.readDefinitions().get().server?.devMode?.debug;
159
+ const state = read(server.connectionState).state;
160
+ switch (state) {
159
161
  case McpConnectionState.Kind.Error:
160
162
  lenses.lenses.push({
161
163
  range,
162
164
  command: {
163
165
  id: McpCommandIds.ShowOutput,
164
- title: '$(error) ' + ( localize(7701, 'Error')),
166
+ title: '$(error) ' + ( localize(7860, 'Error')),
165
167
  arguments: [server.definition.id],
166
168
  },
167
169
  }, {
168
170
  range,
169
171
  command: {
170
172
  id: McpCommandIds.RestartServer,
171
- title: ( localize(7702, "Restart")),
173
+ title: ( localize(7861, "Restart")),
172
174
  arguments: [server.definition.id],
173
175
  },
174
176
  });
177
+ if (canDebug) {
178
+ lenses.lenses.push({
179
+ range,
180
+ command: {
181
+ id: McpCommandIds.RestartServer,
182
+ title: ( localize(7862, "Debug")),
183
+ arguments: [server.definition.id, { debug: true }],
184
+ },
185
+ });
186
+ }
175
187
  break;
176
188
  case McpConnectionState.Kind.Starting:
177
189
  lenses.lenses.push({
178
190
  range,
179
191
  command: {
180
192
  id: McpCommandIds.ShowOutput,
181
- title: '$(loading~spin) ' + ( localize(7703, 'Starting')),
193
+ title: '$(loading~spin) ' + ( localize(7863, 'Starting')),
182
194
  arguments: [server.definition.id],
183
195
  },
184
196
  }, {
185
197
  range,
186
198
  command: {
187
199
  id: McpCommandIds.StopServer,
188
- title: ( localize(7704, "Cancel")),
200
+ title: ( localize(7864, "Cancel")),
189
201
  arguments: [server.definition.id],
190
202
  },
191
203
  });
@@ -195,51 +207,85 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
195
207
  range,
196
208
  command: {
197
209
  id: McpCommandIds.ShowOutput,
198
- title: '$(check) ' + ( localize(7705, 'Running')),
210
+ title: '$(check) ' + ( localize(7865, 'Running')),
199
211
  arguments: [server.definition.id],
200
212
  },
201
213
  }, {
202
214
  range,
203
215
  command: {
204
216
  id: McpCommandIds.StopServer,
205
- title: ( localize(7706, "Stop")),
217
+ title: ( localize(7866, "Stop")),
206
218
  arguments: [server.definition.id],
207
219
  },
208
220
  }, {
209
221
  range,
210
222
  command: {
211
223
  id: McpCommandIds.RestartServer,
212
- title: ( localize(7702, "Restart")),
224
+ title: ( localize(7861, "Restart")),
213
225
  arguments: [server.definition.id],
214
226
  },
215
- }, {
216
- range,
217
- command: {
218
- id: '',
219
- title: ( localize(7707, '{0} tools', read(server.tools).length)),
220
- },
221
227
  });
228
+ if (canDebug) {
229
+ lenses.lenses.push({
230
+ range,
231
+ command: {
232
+ id: McpCommandIds.RestartServer,
233
+ title: ( localize(7862, "Debug")),
234
+ arguments: [server.definition.id, { debug: true }],
235
+ },
236
+ });
237
+ }
222
238
  break;
223
- case McpConnectionState.Kind.Stopped: {
239
+ case McpConnectionState.Kind.Stopped:
224
240
  lenses.lenses.push({
225
241
  range,
226
242
  command: {
227
243
  id: McpCommandIds.StartServer,
228
- title: '$(debug-start) ' + ( localize(7708, "Start")),
244
+ title: '$(debug-start) ' + ( localize(7867, "Start")),
229
245
  arguments: [server.definition.id],
230
246
  },
231
247
  });
232
- const toolCount = read(server.tools).length;
233
- if (toolCount) {
248
+ if (canDebug) {
234
249
  lenses.lenses.push({
235
250
  range,
236
251
  command: {
237
- id: '',
238
- title: ( localize(7709, '{0} cached tools', toolCount)),
239
- }
252
+ id: McpCommandIds.StartServer,
253
+ title: ( localize(7862, "Debug")),
254
+ arguments: [server.definition.id, { debug: true }],
255
+ },
240
256
  });
241
257
  }
258
+ }
259
+ if (state !== McpConnectionState.Kind.Error) {
260
+ const toolCount = read(server.tools).length;
261
+ if (toolCount) {
262
+ lenses.lenses.push({
263
+ range,
264
+ command: {
265
+ id: '',
266
+ title: ( localize(7868, '{0} tools', toolCount)),
267
+ }
268
+ });
242
269
  }
270
+ const promptCount = read(server.prompts).length;
271
+ if (promptCount) {
272
+ lenses.lenses.push({
273
+ range,
274
+ command: {
275
+ id: McpCommandIds.StartPromptForServer,
276
+ title: ( localize(7869, '{0} prompts', promptCount)),
277
+ arguments: [server],
278
+ }
279
+ });
280
+ }
281
+ lenses.lenses.push({
282
+ range,
283
+ command: {
284
+ id: McpCommandIds.ServerOptions,
285
+ title: ( localize(7870, 'More...')),
286
+ arguments: [server.definition.id],
287
+ }
288
+ });
243
289
  }
244
290
  }
245
291
  return lenses;
@@ -302,9 +348,9 @@ let McpLanguageFeatures = class McpLanguageFeatures extends Disposable {
302
348
  }
303
349
  function pushAnnotation(savedId, offset, saved) {
304
350
  const tooltip = ( new MarkdownString([
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] }),
351
+ markdownCommandLink({ id: McpCommandIds.EditStoredInput, title: ( localize(7871, 'Edit')), arguments: [savedId, model.uri, mcpConfigurationSection, inConfig.target] }),
352
+ markdownCommandLink({ id: McpCommandIds.RemoveStoredInput, title: ( localize(7872, 'Clear')), arguments: [inConfig.scope, savedId] }),
353
+ markdownCommandLink({ id: McpCommandIds.RemoveStoredInput, title: ( localize(7873, 'Clear All')), arguments: [inConfig.scope] }),
308
354
  ].join(' | '), { isTrusted: true }));
309
355
  const hint = {
310
356
  label: '= ' + (saved.input?.type === 'promptString' && saved.input.password ? '*'.repeat(10) : (saved.value || '')),
@@ -0,0 +1,106 @@
1
+ import { ActionViewItem, IActionViewItemOptions } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionViewItems";
2
+ import { Action, IAction } from "@codingame/monaco-vscode-api/vscode/vs/base/common/actions";
3
+ import { IContextMenuService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service";
4
+ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
5
+ import { IMcpServerContainer, IWorkbenchMcpServer } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes";
6
+ import { IMcpWorkbenchService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service";
7
+ import { IMcpService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service";
8
+ import { IMcpRegistry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service";
9
+ import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
10
+ export declare abstract class McpServerAction extends Action implements IMcpServerContainer {
11
+ static readonly EXTENSION_ACTION_CLASS = "extension-action";
12
+ static readonly TEXT_ACTION_CLASS: string;
13
+ static readonly LABEL_ACTION_CLASS: string;
14
+ static readonly PROMINENT_LABEL_ACTION_CLASS: string;
15
+ static readonly ICON_ACTION_CLASS: string;
16
+ private _mcpServer;
17
+ get mcpServer(): IWorkbenchMcpServer | null;
18
+ set mcpServer(mcpServer: IWorkbenchMcpServer | null);
19
+ abstract update(): void;
20
+ }
21
+ export declare abstract class DropDownAction extends McpServerAction {
22
+ protected instantiationService: IInstantiationService;
23
+ constructor(id: string, label: string, cssClass: string, enabled: boolean, instantiationService: IInstantiationService);
24
+ private _actionViewItem;
25
+ createActionViewItem(options: IActionViewItemOptions): DropDownExtensionActionViewItem;
26
+ run(actionGroups: IAction[][]): Promise<any>;
27
+ }
28
+ export declare class DropDownExtensionActionViewItem extends ActionViewItem {
29
+ private readonly contextMenuService;
30
+ constructor(action: IAction, options: IActionViewItemOptions, contextMenuService: IContextMenuService);
31
+ showMenu(menuActionGroups: IAction[][]): void;
32
+ private getActions;
33
+ }
34
+ export declare class InstallAction extends McpServerAction {
35
+ private readonly mcpWorkbenchService;
36
+ static readonly CLASS: string;
37
+ private static readonly HIDE;
38
+ constructor(mcpWorkbenchService: IMcpWorkbenchService);
39
+ update(): void;
40
+ run(): Promise<any>;
41
+ }
42
+ export declare class UninstallAction extends McpServerAction {
43
+ private readonly mcpWorkbenchService;
44
+ static readonly CLASS: string;
45
+ private static readonly HIDE;
46
+ constructor(mcpWorkbenchService: IMcpWorkbenchService);
47
+ update(): void;
48
+ run(): Promise<any>;
49
+ }
50
+ export declare class ManageMcpServerAction extends DropDownAction {
51
+ private readonly isEditorAction;
52
+ static readonly ID = "mcpServer.manage";
53
+ private static readonly Class;
54
+ private static readonly HideManageExtensionClass;
55
+ constructor(isEditorAction: boolean, instantiationService: IInstantiationService);
56
+ getActionGroups(): Promise<IAction[][]>;
57
+ run(): Promise<any>;
58
+ update(): void;
59
+ }
60
+ export declare class StartServerAction extends McpServerAction {
61
+ private readonly mcpService;
62
+ static readonly CLASS: string;
63
+ private static readonly HIDE;
64
+ constructor(mcpService: IMcpService);
65
+ update(): void;
66
+ run(): Promise<any>;
67
+ private getServer;
68
+ }
69
+ export declare class StopServerAction extends McpServerAction {
70
+ private readonly mcpService;
71
+ static readonly CLASS: string;
72
+ private static readonly HIDE;
73
+ constructor(mcpService: IMcpService);
74
+ update(): void;
75
+ run(): Promise<any>;
76
+ private getServer;
77
+ }
78
+ export declare class RestartServerAction extends McpServerAction {
79
+ private readonly mcpService;
80
+ static readonly CLASS: string;
81
+ private static readonly HIDE;
82
+ constructor(mcpService: IMcpService);
83
+ update(): void;
84
+ run(): Promise<any>;
85
+ private getServer;
86
+ }
87
+ export declare class ShowServerOutputAction extends McpServerAction {
88
+ private readonly mcpService;
89
+ static readonly CLASS: string;
90
+ private static readonly HIDE;
91
+ constructor(mcpService: IMcpService);
92
+ update(): void;
93
+ run(): Promise<any>;
94
+ private getServer;
95
+ }
96
+ export declare class ShowServerConfigurationAction extends McpServerAction {
97
+ private readonly mcpService;
98
+ private readonly mcpRegistry;
99
+ private readonly editorService;
100
+ static readonly CLASS: string;
101
+ private static readonly HIDE;
102
+ constructor(mcpService: IMcpService, mcpRegistry: IMcpRegistry, editorService: IEditorService);
103
+ update(): void;
104
+ run(): Promise<any>;
105
+ private getConfigurationTarget;
106
+ }