@codingame/monaco-vscode-mcp-service-override 19.1.4 → 20.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -5
- package/package.json +15 -14
- package/vscode/src/vs/platform/mcp/common/allowedMcpServersService.d.ts +13 -0
- package/vscode/src/vs/platform/mcp/common/allowedMcpServersService.js +42 -0
- package/vscode/src/vs/platform/mcp/common/mcpGalleryService.js +19 -2
- package/vscode/src/vs/platform/mcp/common/mcpManagementIpc.d.ts +4 -3
- package/vscode/src/vs/platform/mcp/common/mcpManagementIpc.js +10 -5
- package/vscode/src/vs/platform/mcp/common/mcpManagementService.d.ts +40 -20
- package/vscode/src/vs/platform/mcp/common/mcpManagementService.js +50 -11
- package/vscode/src/vs/platform/mcp/common/mcpResourceScannerService.d.ts +1 -1
- package/vscode/src/vs/platform/mcp/common/mcpResourceScannerService.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js +5 -3
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.js +197 -89
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpDiscovery.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +21 -40
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +24 -24
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpMigration.js +6 -6
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess.js +7 -7
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.d.ts +41 -6
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.js +207 -50
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +52 -37
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.js +10 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +180 -10
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.d.ts +6 -4
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +71 -26
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.d.ts +8 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +102 -20
- package/vscode/src/vs/workbench/contrib/mcp/browser/media/mcpServerAction.css +23 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/media/mcpServersView.css +6 -1
- package/vscode/src/vs/workbench/contrib/mcp/browser/openPanelChatAndGetWidget.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/browser/openPanelChatAndGetWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +25 -12
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/installedMcpServersDiscovery.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/installedMcpServersDiscovery.js +40 -41
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.js +18 -16
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceMcpDiscoveryAdapter.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +5 -8
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.js +277 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.d.ts +18 -13
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +184 -79
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js +11 -11
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.d.ts +13 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.js +75 -23
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.js +37 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.d.ts +15 -6
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.js +68 -192
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpTypesUtils.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpTypesUtils.js +57 -0
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +10 -10
- package/vscode/src/vs/workbench/services/mcp/browser/mcpWorkbenchManagementService.d.ts +12 -0
- package/vscode/src/vs/workbench/services/mcp/browser/mcpWorkbenchManagementService.js +33 -0
- package/vscode/src/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.d.ts +26 -12
- package/vscode/src/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.js +96 -55
- package/vscode/src/vs/platform/mcp/common/mcpPlatformTypes.d.ts +0 -52
- package/vscode/src/vs/platform/mcp/common/mcpPlatformTypes.js +0 -14
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommandsAddConfiguration.d.ts +0 -41
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommandsAddConfiguration.js +0 -420
package/index.js
CHANGED
|
@@ -13,15 +13,15 @@ import { AuthenticationMcpAccessService } from './vscode/src/vs/workbench/servic
|
|
|
13
13
|
import { IAuthenticationMcpUsageService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationMcpUsageService.service';
|
|
14
14
|
import { AuthenticationMcpUsageService } from './vscode/src/vs/workbench/services/authentication/browser/authenticationMcpUsageService.js';
|
|
15
15
|
import { McpWorkbenchService } from './vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js';
|
|
16
|
-
import {
|
|
16
|
+
import { IAllowedMcpServersService, IMcpGalleryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service';
|
|
17
17
|
import { McpGalleryService } from './vscode/src/vs/platform/mcp/common/mcpGalleryService.js';
|
|
18
|
-
import { McpManagementService } from './vscode/src/vs/platform/mcp/common/mcpManagementService.js';
|
|
19
18
|
import { McpSamplingService } from './vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js';
|
|
20
19
|
import { IMcpResourceScannerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpResourceScannerService.service';
|
|
21
20
|
import { McpResourceScannerService } from './vscode/src/vs/platform/mcp/common/mcpResourceScannerService.js';
|
|
22
21
|
import { McpElicitationService } from './vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js';
|
|
23
22
|
import { IWorkbenchMcpManagementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.service';
|
|
24
|
-
import { WorkbenchMcpManagementService } from './vscode/src/vs/workbench/services/mcp/
|
|
23
|
+
import { WorkbenchMcpManagementService } from './vscode/src/vs/workbench/services/mcp/browser/mcpWorkbenchManagementService.js';
|
|
24
|
+
import { AllowedMcpServersService } from './vscode/src/vs/platform/mcp/common/allowedMcpServersService.js';
|
|
25
25
|
|
|
26
26
|
function getServiceOverride() {
|
|
27
27
|
return {
|
|
@@ -33,10 +33,10 @@ function getServiceOverride() {
|
|
|
33
33
|
[IAuthenticationMcpUsageService.toString()]: new SyncDescriptor(AuthenticationMcpUsageService, [], true),
|
|
34
34
|
[IMcpWorkbenchService.toString()]: new SyncDescriptor(McpWorkbenchService, [], true),
|
|
35
35
|
[IMcpGalleryService.toString()]: new SyncDescriptor(McpGalleryService, [], true),
|
|
36
|
-
[IMcpManagementService.toString()]: new SyncDescriptor(McpManagementService, [], true),
|
|
37
36
|
[IMcpSamplingService.toString()]: new SyncDescriptor(McpSamplingService, [], true),
|
|
38
37
|
[IMcpElicitationService.toString()]: new SyncDescriptor(McpElicitationService, [], true),
|
|
39
|
-
[IWorkbenchMcpManagementService.toString()]: new SyncDescriptor(WorkbenchMcpManagementService, [], true)
|
|
38
|
+
[IWorkbenchMcpManagementService.toString()]: new SyncDescriptor(WorkbenchMcpManagementService, [], true),
|
|
39
|
+
[IAllowedMcpServersService.toString()]: new SyncDescriptor(AllowedMcpServersService, [], true)
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-mcp-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - mcp service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,19 +15,20 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-2673c6e2-17c1-5710-b169-46f3d4a28696-common": "
|
|
19
|
-
"@codingame/monaco-vscode-4a3ac544-9a61-534c-88df-756262793ef7-common": "
|
|
20
|
-
"@codingame/monaco-vscode-501b06ab-3f58-516b-8a1a-c29d375d3da4-common": "
|
|
21
|
-
"@codingame/monaco-vscode-
|
|
22
|
-
"@codingame/monaco-vscode-
|
|
23
|
-
"@codingame/monaco-vscode-
|
|
24
|
-
"@codingame/monaco-vscode-
|
|
25
|
-
"@codingame/monaco-vscode-
|
|
26
|
-
"@codingame/monaco-vscode-
|
|
27
|
-
"@codingame/monaco-vscode-ce7c734f-7712-563c-9335-d7acb43306af-common": "
|
|
28
|
-
"@codingame/monaco-vscode-cf77987b-b1b7-5359-aaf8-a259c63d9f03-common": "
|
|
29
|
-
"@codingame/monaco-vscode-
|
|
30
|
-
"@codingame/monaco-vscode-
|
|
18
|
+
"@codingame/monaco-vscode-2673c6e2-17c1-5710-b169-46f3d4a28696-common": "20.0.1",
|
|
19
|
+
"@codingame/monaco-vscode-4a3ac544-9a61-534c-88df-756262793ef7-common": "20.0.1",
|
|
20
|
+
"@codingame/monaco-vscode-501b06ab-3f58-516b-8a1a-c29d375d3da4-common": "20.0.1",
|
|
21
|
+
"@codingame/monaco-vscode-60014c9d-b815-501d-83a9-4b08725c2ec2-common": "20.0.1",
|
|
22
|
+
"@codingame/monaco-vscode-62190c26-af1c-5f7a-a364-e05a59cfb7c7-common": "20.0.1",
|
|
23
|
+
"@codingame/monaco-vscode-a654b07e-8806-5425-b124-18f03ba8e11a-common": "20.0.1",
|
|
24
|
+
"@codingame/monaco-vscode-api": "20.0.1",
|
|
25
|
+
"@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common": "20.0.1",
|
|
26
|
+
"@codingame/monaco-vscode-c2deffc4-ad68-5e63-8f95-9b89e0fc6898-common": "20.0.1",
|
|
27
|
+
"@codingame/monaco-vscode-ce7c734f-7712-563c-9335-d7acb43306af-common": "20.0.1",
|
|
28
|
+
"@codingame/monaco-vscode-cf77987b-b1b7-5359-aaf8-a259c63d9f03-common": "20.0.1",
|
|
29
|
+
"@codingame/monaco-vscode-d941ac7b-412f-57e3-b1bf-f6b0eb253b21-common": "20.0.1",
|
|
30
|
+
"@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common": "20.0.1",
|
|
31
|
+
"@codingame/monaco-vscode-f24e325c-2ce0-5bba-8236-bfc4f53180ab-common": "20.0.1"
|
|
31
32
|
},
|
|
32
33
|
"main": "index.js",
|
|
33
34
|
"module": "index.js",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IMarkdownString } from "@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent";
|
|
3
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
4
|
+
import { IGalleryMcpServer, IInstallableMcpServer, ILocalMcpServer } from "@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common/vscode/vs/platform/mcp/common/mcpManagement";
|
|
5
|
+
import { IAllowedMcpServersService } from "@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service";
|
|
6
|
+
export declare class AllowedMcpServersService extends Disposable implements IAllowedMcpServersService {
|
|
7
|
+
private readonly configurationService;
|
|
8
|
+
_serviceBrand: undefined;
|
|
9
|
+
private _onDidChangeAllowedMcpServers;
|
|
10
|
+
readonly onDidChangeAllowedMcpServers: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
|
|
11
|
+
constructor(configurationService: IConfigurationService);
|
|
12
|
+
isAllowed(mcpServer: IGalleryMcpServer | ILocalMcpServer | IInstallableMcpServer): true | IMarkdownString;
|
|
13
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
5
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
6
|
+
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
7
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
8
|
+
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
9
|
+
import { mcpEnabledConfig } from '@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common/vscode/vs/platform/mcp/common/mcpManagement';
|
|
10
|
+
|
|
11
|
+
let AllowedMcpServersService = class AllowedMcpServersService extends Disposable {
|
|
12
|
+
constructor(configurationService) {
|
|
13
|
+
super();
|
|
14
|
+
this.configurationService = configurationService;
|
|
15
|
+
this._onDidChangeAllowedMcpServers = this._register(( new Emitter()));
|
|
16
|
+
this.onDidChangeAllowedMcpServers = this._onDidChangeAllowedMcpServers.event;
|
|
17
|
+
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
18
|
+
if (e.affectsConfiguration(mcpEnabledConfig)) {
|
|
19
|
+
this._onDidChangeAllowedMcpServers.fire();
|
|
20
|
+
}
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
isAllowed(mcpServer) {
|
|
24
|
+
const isEnabled = this.configurationService.getValue(mcpEnabledConfig) === true;
|
|
25
|
+
if (isEnabled) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
const settingsCommandLink = ( ( URI.parse(
|
|
29
|
+
`command:workbench.action.openSettings?${encodeURIComponent(JSON.stringify({ query: `@id:${mcpEnabledConfig}` }))}`
|
|
30
|
+
)).toString());
|
|
31
|
+
return (new MarkdownString(localize(
|
|
32
|
+
1966,
|
|
33
|
+
"Model Context Protocol servers are disabled in the Editor. Please check your [settings]({0}).",
|
|
34
|
+
settingsCommandLink
|
|
35
|
+
)));
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
AllowedMcpServersService = ( __decorate([
|
|
39
|
+
( __param(0, IConfigurationService))
|
|
40
|
+
], AllowedMcpServersService));
|
|
41
|
+
|
|
42
|
+
export { AllowedMcpServersService };
|
|
@@ -84,7 +84,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
84
84
|
async getReadme(gallery, token) {
|
|
85
85
|
const readmeUrl = gallery.readmeUrl;
|
|
86
86
|
if (!readmeUrl) {
|
|
87
|
-
return Promise.resolve(( localize(
|
|
87
|
+
return Promise.resolve(( localize(1967, 'No README available')));
|
|
88
88
|
}
|
|
89
89
|
const uri = ( URI.parse(readmeUrl));
|
|
90
90
|
if (uri.scheme === Schemas.file) {
|
|
@@ -97,7 +97,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
if (uri.authority !== 'raw.githubusercontent.com') {
|
|
100
|
-
return ( new MarkdownString(( localize(
|
|
100
|
+
return ( new MarkdownString(( localize(1968, "You can find information about this server [here]({0})", readmeUrl)))).value;
|
|
101
101
|
}
|
|
102
102
|
const context = await this.requestService.request({
|
|
103
103
|
type: 'GET',
|
|
@@ -118,6 +118,22 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
118
118
|
publisher = domainParts[domainParts.length - 1];
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
+
let icon;
|
|
122
|
+
const mcpGalleryUrl = this.getMcpGalleryUrl();
|
|
123
|
+
if (mcpGalleryUrl && this.productService.extensionsGallery?.mcpUrl !== mcpGalleryUrl) {
|
|
124
|
+
if (item.iconUrl) {
|
|
125
|
+
icon = {
|
|
126
|
+
light: item.iconUrl,
|
|
127
|
+
dark: item.iconUrl
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
if (item.iconUrlLight && item.iconUrlDark) {
|
|
131
|
+
icon = {
|
|
132
|
+
light: item.iconUrlLight,
|
|
133
|
+
dark: item.iconUrlDark
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
121
137
|
return {
|
|
122
138
|
id: item.id ?? item.name,
|
|
123
139
|
name: item.name,
|
|
@@ -128,6 +144,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
128
144
|
lastUpdated: item.version_detail ? Date.parse(item.version_detail.release_date) : undefined,
|
|
129
145
|
repositoryUrl: item.repository?.url,
|
|
130
146
|
codicon: item.codicon,
|
|
147
|
+
icon,
|
|
131
148
|
readmeUrl: item.readmeUrl,
|
|
132
149
|
manifestUrl: this.getManifestUrl(item),
|
|
133
150
|
packageTypes: item.package_types ?? [],
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
2
|
-
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
2
|
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
3
|
import { IURITransformer } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uriIpc";
|
|
5
4
|
import { IChannel, IServerChannel } from "@codingame/monaco-vscode-4a3ac544-9a61-534c-88df-756262793ef7-common/vscode/vs/base/parts/ipc/common/ipc";
|
|
6
5
|
import { DidUninstallMcpServerEvent, IGalleryMcpServer, ILocalMcpServer, IInstallableMcpServer, InstallMcpServerEvent, InstallMcpServerResult, InstallOptions, UninstallMcpServerEvent, UninstallOptions } from "@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common/vscode/vs/platform/mcp/common/mcpManagement";
|
|
6
|
+
import { IAllowedMcpServersService } from "@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service";
|
|
7
7
|
import { IMcpManagementService } from "@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service";
|
|
8
|
+
import { AbstractMcpManagementService } from "./mcpManagementService.js";
|
|
8
9
|
export declare class McpManagementChannel implements IServerChannel {
|
|
9
10
|
private service;
|
|
10
11
|
private getUriTransformer;
|
|
@@ -17,7 +18,7 @@ export declare class McpManagementChannel implements IServerChannel {
|
|
|
17
18
|
listen(context: any, event: string): Event<any>;
|
|
18
19
|
call(context: any, command: string, args?: any): Promise<any>;
|
|
19
20
|
}
|
|
20
|
-
export declare class McpManagementChannelClient extends
|
|
21
|
+
export declare class McpManagementChannelClient extends AbstractMcpManagementService implements IMcpManagementService {
|
|
21
22
|
private readonly channel;
|
|
22
23
|
readonly _serviceBrand: undefined;
|
|
23
24
|
private readonly _onInstallMcpServer;
|
|
@@ -30,7 +31,7 @@ export declare class McpManagementChannelClient extends Disposable implements IM
|
|
|
30
31
|
get onDidUninstallMcpServer(): Event<DidUninstallMcpServerEvent>;
|
|
31
32
|
private readonly _onDidUpdateMcpServers;
|
|
32
33
|
get onDidUpdateMcpServers(): Event<InstallMcpServerResult[]>;
|
|
33
|
-
constructor(channel: IChannel);
|
|
34
|
+
constructor(channel: IChannel, allowedMcpServersService: IAllowedMcpServersService);
|
|
34
35
|
install(server: IInstallableMcpServer, options?: InstallOptions): Promise<ILocalMcpServer>;
|
|
35
36
|
installFromGallery(extension: IGalleryMcpServer, installOptions?: InstallOptions): Promise<ILocalMcpServer>;
|
|
36
37
|
uninstall(extension: ILocalMcpServer, options?: UninstallOptions): Promise<void>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
2
3
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
3
|
-
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
4
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
5
5
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
6
6
|
import { DefaultURITransformer, transformAndReviveIncomingURIs } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uriIpc';
|
|
7
|
+
import { IAllowedMcpServersService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service';
|
|
8
|
+
import { AbstractMcpManagementService } from './mcpManagementService.js';
|
|
7
9
|
|
|
8
10
|
function transformIncomingURI(uri, transformer) {
|
|
9
11
|
return uri ? URI.revive(uri) : undefined;
|
|
@@ -14,14 +16,14 @@ function transformIncomingServer(mcpServer, transformer) {
|
|
|
14
16
|
const transformed = transformAndReviveIncomingURIs({ ...mcpServer, ...{ manifest: undefined } }, transformer);
|
|
15
17
|
return { ...transformed, ...{ manifest } };
|
|
16
18
|
}
|
|
17
|
-
class McpManagementChannelClient extends
|
|
19
|
+
let McpManagementChannelClient = class McpManagementChannelClient extends AbstractMcpManagementService {
|
|
18
20
|
get onInstallMcpServer() { return this._onInstallMcpServer.event; }
|
|
19
21
|
get onDidInstallMcpServers() { return this._onDidInstallMcpServers.event; }
|
|
20
22
|
get onUninstallMcpServer() { return this._onUninstallMcpServer.event; }
|
|
21
23
|
get onDidUninstallMcpServer() { return this._onDidUninstallMcpServer.event; }
|
|
22
24
|
get onDidUpdateMcpServers() { return this._onDidUpdateMcpServers.event; }
|
|
23
|
-
constructor(channel) {
|
|
24
|
-
super();
|
|
25
|
+
constructor(channel, allowedMcpServersService) {
|
|
26
|
+
super(allowedMcpServersService);
|
|
25
27
|
this.channel = channel;
|
|
26
28
|
this._onInstallMcpServer = this._register(( new Emitter()));
|
|
27
29
|
this._onDidInstallMcpServers = this._register(( new Emitter()));
|
|
@@ -54,6 +56,9 @@ class McpManagementChannelClient extends Disposable {
|
|
|
54
56
|
updateMetadata(local, gallery, mcpResource) {
|
|
55
57
|
return Promise.resolve(this.channel.call('updateMetadata', [local, gallery, mcpResource])).then(local => transformIncomingServer(local, null));
|
|
56
58
|
}
|
|
57
|
-
}
|
|
59
|
+
};
|
|
60
|
+
McpManagementChannelClient = ( __decorate([
|
|
61
|
+
( __param(1, IAllowedMcpServersService))
|
|
62
|
+
], McpManagementChannelClient));
|
|
58
63
|
|
|
59
64
|
export { McpManagementChannelClient };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Emitter } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
1
|
+
import { Emitter, Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
2
|
+
import { IMarkdownString } from "@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent";
|
|
2
3
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
4
|
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
5
|
import { IEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service";
|
|
@@ -8,9 +9,10 @@ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log
|
|
|
8
9
|
import { IUriIdentityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
|
|
9
10
|
import { IUserDataProfilesService } from "@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfile.service";
|
|
10
11
|
import { DidUninstallMcpServerEvent, IGalleryMcpServer, ILocalMcpServer, IMcpServerManifest, InstallMcpServerEvent, InstallMcpServerResult, PackageType, UninstallMcpServerEvent, InstallOptions, UninstallOptions, IInstallableMcpServer } from "@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common/vscode/vs/platform/mcp/common/mcpManagement";
|
|
12
|
+
import { IAllowedMcpServersService } from "@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service";
|
|
11
13
|
import { IMcpManagementService } from "@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service";
|
|
12
14
|
import { IMcpGalleryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service";
|
|
13
|
-
import { IMcpServerVariable, IMcpServerConfiguration } from "
|
|
15
|
+
import { IMcpServerVariable, IMcpServerConfiguration } from "@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common/vscode/vs/platform/mcp/common/mcpPlatformTypes";
|
|
14
16
|
import { McpResourceTarget } from "./mcpResourceScannerService.js";
|
|
15
17
|
import { IMcpResourceScannerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpResourceScannerService.service";
|
|
16
18
|
export interface ILocalMcpServerInfo {
|
|
@@ -33,7 +35,7 @@ export interface ILocalMcpServerInfo {
|
|
|
33
35
|
location?: URI;
|
|
34
36
|
licenseUrl?: string;
|
|
35
37
|
}
|
|
36
|
-
export declare abstract class AbstractMcpResourceManagementService extends Disposable
|
|
38
|
+
export declare abstract class AbstractMcpResourceManagementService extends Disposable {
|
|
37
39
|
protected readonly mcpResource: URI;
|
|
38
40
|
protected readonly target: McpResourceTarget;
|
|
39
41
|
protected readonly mcpGalleryService: IMcpGalleryService;
|
|
@@ -46,15 +48,15 @@ export declare abstract class AbstractMcpResourceManagementService extends Dispo
|
|
|
46
48
|
private readonly reloadConfigurationScheduler;
|
|
47
49
|
private local;
|
|
48
50
|
protected readonly _onInstallMcpServer: Emitter<InstallMcpServerEvent>;
|
|
49
|
-
readonly onInstallMcpServer:
|
|
51
|
+
readonly onInstallMcpServer: Event<InstallMcpServerEvent>;
|
|
50
52
|
protected readonly _onDidInstallMcpServers: Emitter<InstallMcpServerResult[]>;
|
|
51
|
-
get onDidInstallMcpServers():
|
|
53
|
+
get onDidInstallMcpServers(): Event<InstallMcpServerResult[]>;
|
|
52
54
|
protected readonly _onDidUpdateMcpServers: Emitter<InstallMcpServerResult[]>;
|
|
53
|
-
get onDidUpdateMcpServers():
|
|
55
|
+
get onDidUpdateMcpServers(): Event<InstallMcpServerResult[]>;
|
|
54
56
|
protected readonly _onUninstallMcpServer: Emitter<UninstallMcpServerEvent>;
|
|
55
|
-
get onUninstallMcpServer():
|
|
57
|
+
get onUninstallMcpServer(): Event<UninstallMcpServerEvent>;
|
|
56
58
|
protected _onDidUninstallMcpServer: Emitter<DidUninstallMcpServerEvent>;
|
|
57
|
-
get onDidUninstallMcpServer():
|
|
59
|
+
get onDidUninstallMcpServer(): Event<DidUninstallMcpServerEvent>;
|
|
58
60
|
constructor(mcpResource: URI, target: McpResourceTarget, mcpGalleryService: IMcpGalleryService, fileService: IFileService, uriIdentityService: IUriIdentityService, logService: ILogService, mcpResourceScannerService: IMcpResourceScannerService);
|
|
59
61
|
private initialize;
|
|
60
62
|
private populateLocalServers;
|
|
@@ -73,32 +75,49 @@ export declare abstract class AbstractMcpResourceManagementService extends Dispo
|
|
|
73
75
|
abstract installFromGallery(server: IGalleryMcpServer, options?: InstallOptions): Promise<ILocalMcpServer>;
|
|
74
76
|
abstract updateMetadata(local: ILocalMcpServer, server: IGalleryMcpServer, profileLocation: URI): Promise<ILocalMcpServer>;
|
|
75
77
|
protected abstract getLocalServerInfo(name: string, mcpServerConfig: IMcpServerConfiguration): Promise<ILocalMcpServerInfo | undefined>;
|
|
78
|
+
protected abstract installFromUri(uri: URI, options?: Omit<InstallOptions, "mcpResource">): Promise<ILocalMcpServer>;
|
|
76
79
|
}
|
|
77
|
-
export declare class McpUserResourceManagementService extends AbstractMcpResourceManagementService
|
|
78
|
-
|
|
80
|
+
export declare class McpUserResourceManagementService extends AbstractMcpResourceManagementService {
|
|
81
|
+
protected readonly mcpLocation: URI;
|
|
79
82
|
constructor(mcpResource: URI, mcpGalleryService: IMcpGalleryService, fileService: IFileService, uriIdentityService: IUriIdentityService, logService: ILogService, mcpResourceScannerService: IMcpResourceScannerService, environmentService: IEnvironmentService);
|
|
80
83
|
installFromGallery(server: IGalleryMcpServer, options?: InstallOptions): Promise<ILocalMcpServer>;
|
|
81
84
|
updateMetadata(local: ILocalMcpServer, gallery: IGalleryMcpServer): Promise<ILocalMcpServer>;
|
|
82
85
|
private updateMetadataFromGallery;
|
|
83
86
|
protected getLocalServerInfo(name: string, mcpServerConfig: IMcpServerConfiguration): Promise<ILocalMcpServerInfo | undefined>;
|
|
84
|
-
|
|
87
|
+
protected getLocation(name: string, version?: string): URI;
|
|
88
|
+
protected installFromUri(uri: URI, options?: Omit<InstallOptions, "mcpResource">): Promise<ILocalMcpServer>;
|
|
85
89
|
}
|
|
86
|
-
export declare class
|
|
87
|
-
|
|
88
|
-
private readonly instantiationService;
|
|
90
|
+
export declare abstract class AbstractMcpManagementService extends Disposable implements IMcpManagementService {
|
|
91
|
+
protected readonly allowedMcpServersService: IAllowedMcpServersService;
|
|
89
92
|
readonly _serviceBrand: undefined;
|
|
93
|
+
constructor(allowedMcpServersService: IAllowedMcpServersService);
|
|
94
|
+
canInstall(server: IGalleryMcpServer | IInstallableMcpServer): true | IMarkdownString;
|
|
95
|
+
abstract onInstallMcpServer: Event<InstallMcpServerEvent>;
|
|
96
|
+
abstract onDidInstallMcpServers: Event<readonly InstallMcpServerResult[]>;
|
|
97
|
+
abstract onDidUpdateMcpServers: Event<readonly InstallMcpServerResult[]>;
|
|
98
|
+
abstract onUninstallMcpServer: Event<UninstallMcpServerEvent>;
|
|
99
|
+
abstract onDidUninstallMcpServer: Event<DidUninstallMcpServerEvent>;
|
|
100
|
+
abstract getInstalled(mcpResource?: URI): Promise<ILocalMcpServer[]>;
|
|
101
|
+
abstract install(server: IInstallableMcpServer, options?: InstallOptions): Promise<ILocalMcpServer>;
|
|
102
|
+
abstract installFromGallery(server: IGalleryMcpServer, options?: InstallOptions): Promise<ILocalMcpServer>;
|
|
103
|
+
abstract updateMetadata(local: ILocalMcpServer, server: IGalleryMcpServer, profileLocation?: URI): Promise<ILocalMcpServer>;
|
|
104
|
+
abstract uninstall(server: ILocalMcpServer, options?: UninstallOptions): Promise<void>;
|
|
105
|
+
}
|
|
106
|
+
export declare class McpManagementService extends AbstractMcpManagementService implements IMcpManagementService {
|
|
107
|
+
private readonly userDataProfilesService;
|
|
108
|
+
protected readonly instantiationService: IInstantiationService;
|
|
90
109
|
private readonly _onInstallMcpServer;
|
|
91
|
-
readonly onInstallMcpServer:
|
|
110
|
+
readonly onInstallMcpServer: Event<InstallMcpServerEvent>;
|
|
92
111
|
private readonly _onDidInstallMcpServers;
|
|
93
|
-
readonly onDidInstallMcpServers:
|
|
112
|
+
readonly onDidInstallMcpServers: Event<readonly InstallMcpServerResult[]>;
|
|
94
113
|
private readonly _onDidUpdateMcpServers;
|
|
95
|
-
readonly onDidUpdateMcpServers:
|
|
114
|
+
readonly onDidUpdateMcpServers: Event<readonly InstallMcpServerResult[]>;
|
|
96
115
|
private readonly _onUninstallMcpServer;
|
|
97
|
-
readonly onUninstallMcpServer:
|
|
116
|
+
readonly onUninstallMcpServer: Event<UninstallMcpServerEvent>;
|
|
98
117
|
private readonly _onDidUninstallMcpServer;
|
|
99
|
-
readonly onDidUninstallMcpServer:
|
|
118
|
+
readonly onDidUninstallMcpServer: Event<DidUninstallMcpServerEvent>;
|
|
100
119
|
private readonly mcpResourceManagementServices;
|
|
101
|
-
constructor(userDataProfilesService: IUserDataProfilesService, instantiationService: IInstantiationService);
|
|
120
|
+
constructor(allowedMcpServersService: IAllowedMcpServersService, userDataProfilesService: IUserDataProfilesService, instantiationService: IInstantiationService);
|
|
102
121
|
private getMcpResourceManagementService;
|
|
103
122
|
getInstalled(mcpResource?: URI): Promise<ILocalMcpServer[]>;
|
|
104
123
|
install(server: IInstallableMcpServer, options?: InstallOptions): Promise<ILocalMcpServer>;
|
|
@@ -106,4 +125,5 @@ export declare class McpManagementService extends Disposable implements IMcpMana
|
|
|
106
125
|
installFromGallery(server: IGalleryMcpServer, options?: InstallOptions): Promise<ILocalMcpServer>;
|
|
107
126
|
updateMetadata(local: ILocalMcpServer, gallery: IGalleryMcpServer, mcpResource?: URI): Promise<ILocalMcpServer>;
|
|
108
127
|
dispose(): void;
|
|
128
|
+
protected createMcpResourceManagementService(mcpResource: URI): McpUserResourceManagementService;
|
|
109
129
|
}
|
|
@@ -4,10 +4,12 @@ import { RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/co
|
|
|
4
4
|
import { VSBuffer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
|
|
5
5
|
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
6
6
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
7
|
+
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
7
8
|
import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
8
9
|
import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
9
10
|
import { equals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
|
|
10
11
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
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';
|
|
12
14
|
import { IEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service';
|
|
13
15
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
@@ -16,8 +18,8 @@ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log
|
|
|
16
18
|
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
17
19
|
import { IUserDataProfilesService } from '@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
|
|
18
20
|
import { PackageType } from '@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common/vscode/vs/platform/mcp/common/mcpManagement';
|
|
19
|
-
import { IMcpGalleryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service';
|
|
20
|
-
import { McpServerType, McpServerVariableType } from '
|
|
21
|
+
import { IMcpGalleryService, IAllowedMcpServersService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service';
|
|
22
|
+
import { McpServerType, McpServerVariableType } from '@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common/vscode/vs/platform/mcp/common/mcpPlatformTypes';
|
|
21
23
|
import { IMcpResourceScannerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpResourceScannerService.service';
|
|
22
24
|
|
|
23
25
|
let AbstractMcpResourceManagementService = class AbstractMcpResourceManagementService extends Disposable {
|
|
@@ -46,8 +48,12 @@ let AbstractMcpResourceManagementService = class AbstractMcpResourceManagementSe
|
|
|
46
48
|
initialize() {
|
|
47
49
|
if (!this.initializePromise) {
|
|
48
50
|
this.initializePromise = (async () => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
try {
|
|
52
|
+
this.local = await this.populateLocalServers();
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
this.startWatching();
|
|
56
|
+
}
|
|
51
57
|
})();
|
|
52
58
|
}
|
|
53
59
|
return this.initializePromise;
|
|
@@ -134,7 +140,6 @@ let AbstractMcpResourceManagementService = class AbstractMcpResourceManagementSe
|
|
|
134
140
|
mcpResource: this.mcpResource,
|
|
135
141
|
version: mcpServerInfo.version,
|
|
136
142
|
location: mcpServerInfo.location,
|
|
137
|
-
id: mcpServerInfo.id,
|
|
138
143
|
displayName: mcpServerInfo.displayName,
|
|
139
144
|
description: mcpServerInfo.description,
|
|
140
145
|
publisher: mcpServerInfo.publisher,
|
|
@@ -269,6 +274,12 @@ let AbstractMcpResourceManagementService = class AbstractMcpResourceManagementSe
|
|
|
269
274
|
else if (serverPackage.registry_name === PackageType.DOCKER) {
|
|
270
275
|
args.push(serverPackage.version ? `${serverPackage.name}:${serverPackage.version}` : serverPackage.name);
|
|
271
276
|
}
|
|
277
|
+
else if (serverPackage.registry_name === PackageType.NUGET) {
|
|
278
|
+
args.push(serverPackage.version ? `${serverPackage.name}@${serverPackage.version}` : serverPackage.name);
|
|
279
|
+
}
|
|
280
|
+
if (serverPackage.package_arguments && serverPackage.registry_name === PackageType.NUGET) {
|
|
281
|
+
args.push('--');
|
|
282
|
+
}
|
|
272
283
|
for (const arg of serverPackage.package_arguments ?? []) {
|
|
273
284
|
const variables = arg.variables ? this.getVariables(arg.variables) : [];
|
|
274
285
|
if (arg.type === 'positional') {
|
|
@@ -311,6 +322,7 @@ let AbstractMcpResourceManagementService = class AbstractMcpResourceManagementSe
|
|
|
311
322
|
case PackageType.NODE: return 'npx';
|
|
312
323
|
case PackageType.DOCKER: return 'docker';
|
|
313
324
|
case PackageType.PYTHON: return 'uvx';
|
|
325
|
+
case PackageType.NUGET: return 'dnx';
|
|
314
326
|
}
|
|
315
327
|
return packageType;
|
|
316
328
|
}
|
|
@@ -430,6 +442,9 @@ let McpUserResourceManagementService = class McpUserResourceManagementService ex
|
|
|
430
442
|
name = name.replace('/', '.');
|
|
431
443
|
return this.uriIdentityService.extUri.joinPath(this.mcpLocation, version ? `${name}-${version}` : name);
|
|
432
444
|
}
|
|
445
|
+
installFromUri(uri, options) {
|
|
446
|
+
throw ( new Error('Method not supported.'));
|
|
447
|
+
}
|
|
433
448
|
};
|
|
434
449
|
McpUserResourceManagementService = ( __decorate([
|
|
435
450
|
( __param(1, IMcpGalleryService)),
|
|
@@ -439,9 +454,29 @@ McpUserResourceManagementService = ( __decorate([
|
|
|
439
454
|
( __param(5, IMcpResourceScannerService)),
|
|
440
455
|
( __param(6, IEnvironmentService))
|
|
441
456
|
], McpUserResourceManagementService));
|
|
442
|
-
let
|
|
443
|
-
constructor(
|
|
457
|
+
let AbstractMcpManagementService = class AbstractMcpManagementService extends Disposable {
|
|
458
|
+
constructor(allowedMcpServersService) {
|
|
444
459
|
super();
|
|
460
|
+
this.allowedMcpServersService = allowedMcpServersService;
|
|
461
|
+
}
|
|
462
|
+
canInstall(server) {
|
|
463
|
+
const allowedToInstall = this.allowedMcpServersService.isAllowed(server);
|
|
464
|
+
if (allowedToInstall !== true) {
|
|
465
|
+
return (new MarkdownString(localize(
|
|
466
|
+
1969,
|
|
467
|
+
"This mcp server cannot be installed because {0}",
|
|
468
|
+
allowedToInstall.value
|
|
469
|
+
)));
|
|
470
|
+
}
|
|
471
|
+
return true;
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
AbstractMcpManagementService = ( __decorate([
|
|
475
|
+
( __param(0, IAllowedMcpServersService))
|
|
476
|
+
], AbstractMcpManagementService));
|
|
477
|
+
let McpManagementService = class McpManagementService extends AbstractMcpManagementService {
|
|
478
|
+
constructor(allowedMcpServersService, userDataProfilesService, instantiationService) {
|
|
479
|
+
super(allowedMcpServersService);
|
|
445
480
|
this.userDataProfilesService = userDataProfilesService;
|
|
446
481
|
this.instantiationService = instantiationService;
|
|
447
482
|
this._onInstallMcpServer = this._register(( new Emitter()));
|
|
@@ -460,7 +495,7 @@ let McpManagementService = class McpManagementService extends Disposable {
|
|
|
460
495
|
let mcpResourceManagementService = this.mcpResourceManagementServices.get(mcpResource);
|
|
461
496
|
if (!mcpResourceManagementService) {
|
|
462
497
|
const disposables = ( new DisposableStore());
|
|
463
|
-
const service = disposables.add(this.
|
|
498
|
+
const service = disposables.add(this.createMcpResourceManagementService(mcpResource));
|
|
464
499
|
disposables.add(service.onInstallMcpServer(e => this._onInstallMcpServer.fire(e)));
|
|
465
500
|
disposables.add(service.onDidInstallMcpServers(e => this._onDidInstallMcpServers.fire(e)));
|
|
466
501
|
disposables.add(service.onDidUpdateMcpServers(e => this._onDidUpdateMcpServers.fire(e)));
|
|
@@ -494,10 +529,14 @@ let McpManagementService = class McpManagementService extends Disposable {
|
|
|
494
529
|
this.mcpResourceManagementServices.clear();
|
|
495
530
|
super.dispose();
|
|
496
531
|
}
|
|
532
|
+
createMcpResourceManagementService(mcpResource) {
|
|
533
|
+
return this.instantiationService.createInstance(McpUserResourceManagementService, mcpResource);
|
|
534
|
+
}
|
|
497
535
|
};
|
|
498
536
|
McpManagementService = ( __decorate([
|
|
499
|
-
( __param(0,
|
|
500
|
-
( __param(1,
|
|
537
|
+
( __param(0, IAllowedMcpServersService)),
|
|
538
|
+
( __param(1, IUserDataProfilesService)),
|
|
539
|
+
( __param(2, IInstantiationService))
|
|
501
540
|
], McpManagementService));
|
|
502
541
|
|
|
503
|
-
export { AbstractMcpResourceManagementService, McpManagementService, McpUserResourceManagementService };
|
|
542
|
+
export { AbstractMcpManagementService, AbstractMcpResourceManagementService, McpManagementService, McpUserResourceManagementService };
|
|
@@ -6,7 +6,7 @@ import { ConfigurationTarget } from "@codingame/monaco-vscode-api/vscode/vs/plat
|
|
|
6
6
|
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
7
7
|
import { IUriIdentityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
|
|
8
8
|
import { IInstallableMcpServer } from "@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common/vscode/vs/platform/mcp/common/mcpManagement";
|
|
9
|
-
import { IMcpServerConfiguration, IMcpServerVariable } from "
|
|
9
|
+
import { IMcpServerConfiguration, IMcpServerVariable } from "@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common/vscode/vs/platform/mcp/common/mcpPlatformTypes";
|
|
10
10
|
import { IMcpResourceScannerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpResourceScannerService.service";
|
|
11
11
|
export interface IScannedMcpServers {
|
|
12
12
|
servers?: IStringDictionary<Mutable<IMcpServerConfiguration>>;
|
|
@@ -11,7 +11,7 @@ import { toFileOperationResult, FileOperationResult } from '@codingame/monaco-vs
|
|
|
11
11
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
12
12
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
|
|
13
13
|
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
14
|
-
import { McpServerType } from '
|
|
14
|
+
import { McpServerType } from '@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common/vscode/vs/platform/mcp/common/mcpPlatformTypes';
|
|
15
15
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
16
16
|
|
|
17
17
|
let McpResourceScannerService = class McpResourceScannerService extends Disposable {
|
|
@@ -57,7 +57,7 @@ let McpResourceScannerService = class McpResourceScannerService extends Disposab
|
|
|
57
57
|
try {
|
|
58
58
|
const content = await this.fileService.readFile(mcpResource);
|
|
59
59
|
const errors = [];
|
|
60
|
-
const result = parse(( content.value.toString()), errors, { allowTrailingComma: true, allowEmptyContent: true });
|
|
60
|
+
const result = parse(( content.value.toString()), errors, { allowTrailingComma: true, allowEmptyContent: true }) || {};
|
|
61
61
|
if (errors.length > 0) {
|
|
62
62
|
throw ( new Error('Failed to parse scanned MCP servers: ' + errors.join(', ')));
|
|
63
63
|
}
|
|
@@ -20,6 +20,7 @@ import { mcpServerSchema } from '@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7a
|
|
|
20
20
|
import { McpContextKeysController } from '../common/mcpContextKeys.js';
|
|
21
21
|
import '../common/mcpDevMode.js';
|
|
22
22
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
23
|
+
import { McpLanguageModelToolContribution } from '../common/mcpLanguageModelToolContribution.js';
|
|
23
24
|
import '../common/mcpRegistry.js';
|
|
24
25
|
import { McpResourceFilesystem } from '../common/mcpResourceFilesystem.js';
|
|
25
26
|
import '../common/mcpSamplingService.js';
|
|
@@ -44,6 +45,7 @@ registerWorkbenchContribution2('mcpDiscovery', McpDiscovery, WorkbenchPhase.Afte
|
|
|
44
45
|
registerWorkbenchContribution2('mcpContextKeys', McpContextKeysController, WorkbenchPhase.BlockRestore);
|
|
45
46
|
registerWorkbenchContribution2('mcpLanguageFeatures', McpLanguageFeatures, WorkbenchPhase.Eventually);
|
|
46
47
|
registerWorkbenchContribution2('mcpResourceFilesystem', McpResourceFilesystem, WorkbenchPhase.BlockRestore);
|
|
48
|
+
registerWorkbenchContribution2(McpLanguageModelToolContribution.ID, McpLanguageModelToolContribution, WorkbenchPhase.AfterRestored);
|
|
47
49
|
registerAction2(ListMcpServerCommand);
|
|
48
50
|
registerAction2(McpServerOptionsCommand);
|
|
49
51
|
registerAction2(ResetMcpTrustCommand);
|
|
@@ -73,15 +75,15 @@ registerWorkbenchContribution2(McpConfigMigrationContribution.ID, McpConfigMigra
|
|
|
73
75
|
registerWorkbenchContribution2(McpServersViewsContribution.ID, McpServersViewsContribution, WorkbenchPhase.AfterRestored);
|
|
74
76
|
const jsonRegistry = ( Registry.as(Extensions.JSONContribution));
|
|
75
77
|
jsonRegistry.registerSchema(mcpSchemaId, mcpServerSchema);
|
|
76
|
-
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(McpServerEditor, McpServerEditor.ID, ( localize(
|
|
78
|
+
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(McpServerEditor, McpServerEditor.ID, ( localize(8057, "MCP Server"))), [
|
|
77
79
|
( new SyncDescriptor(McpServerEditorInput))
|
|
78
80
|
]);
|
|
79
81
|
( Registry.as(Extensions$1.Quickaccess)).registerQuickAccessProvider({
|
|
80
82
|
ctor: McpResourceQuickAccess,
|
|
81
83
|
prefix: McpResourceQuickAccess.PREFIX,
|
|
82
|
-
placeholder: ( localize(
|
|
84
|
+
placeholder: ( localize(8058, "Filter to an MCP resource")),
|
|
83
85
|
helpEntries: [{
|
|
84
|
-
description: ( localize(
|
|
86
|
+
description: ( localize(8059, "MCP Server Resources")),
|
|
85
87
|
commandId: McpCommandIds.AddConfiguration
|
|
86
88
|
}]
|
|
87
89
|
});
|
|
@@ -30,10 +30,10 @@ let McpAddContextContribution = class McpAddContextContribution extends Disposab
|
|
|
30
30
|
_registerAddContextMenu() {
|
|
31
31
|
this._addContextMenu.value = this._chatContextPickService.registerChatContextItem({
|
|
32
32
|
type: 'pickerPick',
|
|
33
|
-
label: ( localize(
|
|
33
|
+
label: ( localize(8060, "MCP Resources...")),
|
|
34
34
|
icon: Codicon.mcp,
|
|
35
35
|
asPicker: () => ({
|
|
36
|
-
placeholder: ( localize(
|
|
36
|
+
placeholder: ( localize(8061, "Select MCP Resource...")),
|
|
37
37
|
picks: (_query, token) => this._getResourcePicks(token),
|
|
38
38
|
}),
|
|
39
39
|
});
|
|
@@ -4,6 +4,7 @@ import { IActionViewItemService } from "@codingame/monaco-vscode-api/vscode/vs/p
|
|
|
4
4
|
import { Action2 } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions";
|
|
5
5
|
import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
|
|
6
6
|
import { ConfigurationTarget } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration";
|
|
7
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
7
8
|
import { IInstantiationService, ServicesAccessor } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
8
9
|
import { StorageScope } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage";
|
|
9
10
|
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
@@ -20,7 +21,7 @@ export declare class McpServerOptionsCommand extends Action2 {
|
|
|
20
21
|
private _handleAuth;
|
|
21
22
|
}
|
|
22
23
|
export declare class MCPServerActionRendering extends Disposable implements IWorkbenchContribution {
|
|
23
|
-
constructor(actionViewItemService: IActionViewItemService, mcpService: IMcpService, instaService: IInstantiationService, commandService: ICommandService);
|
|
24
|
+
constructor(actionViewItemService: IActionViewItemService, mcpService: IMcpService, instaService: IInstantiationService, commandService: ICommandService, configurationService: IConfigurationService);
|
|
24
25
|
}
|
|
25
26
|
export declare class ResetMcpTrustCommand extends Action2 {
|
|
26
27
|
constructor();
|