@codingame/monaco-vscode-mcp-service-override 18.4.0 → 19.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.
- package/index.js +10 -5
- package/package.json +14 -14
- package/vscode/src/vs/platform/mcp/common/mcpGalleryService.d.ts +2 -1
- package/vscode/src/vs/platform/mcp/common/mcpGalleryService.js +34 -11
- package/vscode/src/vs/platform/mcp/common/mcpManagementIpc.d.ts +39 -0
- package/vscode/src/vs/platform/mcp/common/mcpManagementIpc.js +59 -0
- package/vscode/src/vs/platform/mcp/common/mcpManagementService.d.ts +89 -15
- package/vscode/src/vs/platform/mcp/common/mcpManagementService.js +393 -182
- package/vscode/src/vs/platform/mcp/common/mcpPlatformTypes.d.ts +16 -29
- package/vscode/src/vs/platform/mcp/common/mcpPlatformTypes.js +6 -1
- package/vscode/src/vs/platform/mcp/common/mcpResourceScannerService.d.ts +33 -0
- package/vscode/src/vs/platform/mcp/common/mcpResourceScannerService.js +191 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js +25 -45
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.d.ts +109 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.js +826 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommandsAddConfiguration.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommandsAddConfiguration.js +420 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpDiscovery.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +305 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +30 -32
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpMigration.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpMigration.js +161 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess.d.ts +60 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess.js +423 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.d.ts +60 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.js +299 -45
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.d.ts +12 -4
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +237 -37
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +29 -18
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.d.ts +26 -1
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +182 -28
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.d.ts +59 -9
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +316 -31
- package/vscode/src/vs/workbench/contrib/mcp/browser/media/mcpServerEditor.css +73 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/media/mcpServersView.css +35 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/openPanelChatAndGetWidget.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/openPanelChatAndGetWidget.js +18 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/installedMcpServersDiscovery.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/installedMcpServersDiscovery.js +151 -0
- 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 +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceMcpDiscoveryAdapter.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +60 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +8 -8
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpResourceFilesystem.js +12 -12
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js +18 -15
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.d.ts +9 -5
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.js +77 -34
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.js +6 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.js +14 -13
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpAccessService.js +27 -1
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +9 -9
- package/vscode/src/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.d.ts +72 -0
- package/vscode/src/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.js +475 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/configMcpDiscovery.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/configMcpDiscovery.js +0 -167
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpConfigPathsService.d.ts +0 -33
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpConfigPathsService.js +0 -112
package/index.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import '@codingame/monaco-vscode-api/vscode/vs/editor/standalone/browser/standaloneServices';
|
|
3
3
|
import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
|
|
4
|
-
import {
|
|
5
|
-
import { IMcpSamplingService, IMcpWorkbenchService, IMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
|
|
4
|
+
import { IMcpElicitationService, IMcpSamplingService, IMcpWorkbenchService, IMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
|
|
6
5
|
import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
|
|
7
|
-
import { McpConfigPathsService } from './vscode/src/vs/workbench/contrib/mcp/common/mcpConfigPathsService.js';
|
|
8
6
|
import { McpService } from './vscode/src/vs/workbench/contrib/mcp/common/mcpService.js';
|
|
9
7
|
import { McpRegistry } from './vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js';
|
|
10
8
|
import './vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js';
|
|
@@ -19,10 +17,15 @@ import { IMcpManagementService, IMcpGalleryService } from '@codingame/monaco-vsc
|
|
|
19
17
|
import { McpGalleryService } from './vscode/src/vs/platform/mcp/common/mcpGalleryService.js';
|
|
20
18
|
import { McpManagementService } from './vscode/src/vs/platform/mcp/common/mcpManagementService.js';
|
|
21
19
|
import { McpSamplingService } from './vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js';
|
|
20
|
+
import { IMcpResourceScannerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpResourceScannerService.service';
|
|
21
|
+
import { McpResourceScannerService } from './vscode/src/vs/platform/mcp/common/mcpResourceScannerService.js';
|
|
22
|
+
import { McpElicitationService } from './vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js';
|
|
23
|
+
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/common/mcpWorkbenchManagementService.js';
|
|
22
25
|
|
|
23
26
|
function getServiceOverride() {
|
|
24
27
|
return {
|
|
25
|
-
[
|
|
28
|
+
[IMcpResourceScannerService.toString()]: new SyncDescriptor(McpResourceScannerService, [], true),
|
|
26
29
|
[IMcpService.toString()]: new SyncDescriptor(McpService, [], true),
|
|
27
30
|
[IMcpRegistry.toString()]: new SyncDescriptor(McpRegistry, [], true),
|
|
28
31
|
[IAuthenticationMcpService.toString()]: new SyncDescriptor(AuthenticationMcpService, [], true),
|
|
@@ -31,7 +34,9 @@ function getServiceOverride() {
|
|
|
31
34
|
[IMcpWorkbenchService.toString()]: new SyncDescriptor(McpWorkbenchService, [], true),
|
|
32
35
|
[IMcpGalleryService.toString()]: new SyncDescriptor(McpGalleryService, [], true),
|
|
33
36
|
[IMcpManagementService.toString()]: new SyncDescriptor(McpManagementService, [], true),
|
|
34
|
-
[IMcpSamplingService.toString()]: new SyncDescriptor(McpSamplingService, [], true)
|
|
37
|
+
[IMcpSamplingService.toString()]: new SyncDescriptor(McpSamplingService, [], true),
|
|
38
|
+
[IMcpElicitationService.toString()]: new SyncDescriptor(McpElicitationService, [], true),
|
|
39
|
+
[IWorkbenchMcpManagementService.toString()]: new SyncDescriptor(WorkbenchMcpManagementService, [], true)
|
|
35
40
|
};
|
|
36
41
|
}
|
|
37
42
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-mcp-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - mcp service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-
|
|
19
|
-
"@codingame/monaco-vscode-
|
|
20
|
-
"@codingame/monaco-vscode-
|
|
21
|
-
"@codingame/monaco-vscode-
|
|
22
|
-
"@codingame/monaco-vscode-60014c9d-b815-501d-83a9-4b08725c2ec2-common": "
|
|
23
|
-
"@codingame/monaco-vscode-937ecbdf-94c7-5b16-aefa-ad78ae557a93-common": "
|
|
24
|
-
"@codingame/monaco-vscode-
|
|
25
|
-
"@codingame/monaco-vscode-
|
|
26
|
-
"@codingame/monaco-vscode-api": "
|
|
27
|
-
"@codingame/monaco-vscode-
|
|
28
|
-
"@codingame/monaco-vscode-
|
|
29
|
-
"@codingame/monaco-vscode-
|
|
30
|
-
"@codingame/monaco-vscode-
|
|
18
|
+
"@codingame/monaco-vscode-2673c6e2-17c1-5710-b169-46f3d4a28696-common": "19.0.0",
|
|
19
|
+
"@codingame/monaco-vscode-4a3ac544-9a61-534c-88df-756262793ef7-common": "19.0.0",
|
|
20
|
+
"@codingame/monaco-vscode-501b06ab-3f58-516b-8a1a-c29d375d3da4-common": "19.0.0",
|
|
21
|
+
"@codingame/monaco-vscode-516ccb00-d5b9-5317-baf0-fcc96e99669a-common": "19.0.0",
|
|
22
|
+
"@codingame/monaco-vscode-60014c9d-b815-501d-83a9-4b08725c2ec2-common": "19.0.0",
|
|
23
|
+
"@codingame/monaco-vscode-937ecbdf-94c7-5b16-aefa-ad78ae557a93-common": "19.0.0",
|
|
24
|
+
"@codingame/monaco-vscode-9911aec2-e4dd-5483-8369-9d695cc70d8a-common": "19.0.0",
|
|
25
|
+
"@codingame/monaco-vscode-9ed6fe06-a052-57c2-a234-5d9b94d2e7e0-common": "19.0.0",
|
|
26
|
+
"@codingame/monaco-vscode-api": "19.0.0",
|
|
27
|
+
"@codingame/monaco-vscode-ce7c734f-7712-563c-9335-d7acb43306af-common": "19.0.0",
|
|
28
|
+
"@codingame/monaco-vscode-cf77987b-b1b7-5359-aaf8-a259c63d9f03-common": "19.0.0",
|
|
29
|
+
"@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common": "19.0.0",
|
|
30
|
+
"@codingame/monaco-vscode-f24e325c-2ce0-5bba-8236-bfc4f53180ab-common": "19.0.0"
|
|
31
31
|
},
|
|
32
32
|
"main": "index.js",
|
|
33
33
|
"module": "index.js",
|
|
@@ -5,7 +5,7 @@ import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/fi
|
|
|
5
5
|
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
6
6
|
import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
|
|
7
7
|
import { IRequestService } from "@codingame/monaco-vscode-api/vscode/vs/platform/request/common/request.service";
|
|
8
|
-
import { IGalleryMcpServer, IMcpServerManifest, IQueryOptions } from "@codingame/monaco-vscode-
|
|
8
|
+
import { IGalleryMcpServer, IMcpServerManifest, IQueryOptions } from "@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common/vscode/vs/platform/mcp/common/mcpManagement";
|
|
9
9
|
import { IMcpGalleryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service";
|
|
10
10
|
export declare class McpGalleryService extends Disposable implements IMcpGalleryService {
|
|
11
11
|
private readonly configurationService;
|
|
@@ -17,6 +17,7 @@ export declare class McpGalleryService extends Disposable implements IMcpGallery
|
|
|
17
17
|
constructor(configurationService: IConfigurationService, requestService: IRequestService, fileService: IFileService, productService: IProductService, logService: ILogService);
|
|
18
18
|
isEnabled(): boolean;
|
|
19
19
|
query(options?: IQueryOptions, token?: CancellationToken): Promise<IGalleryMcpServer[]>;
|
|
20
|
+
getMcpServers(names: string[]): Promise<IGalleryMcpServer[]>;
|
|
20
21
|
getManifest(gallery: IGalleryMcpServer, token: CancellationToken): Promise<IMcpServerManifest>;
|
|
21
22
|
getReadme(gallery: IGalleryMcpServer, token: CancellationToken): Promise<string>;
|
|
22
23
|
private toGalleryMcpServer;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
4
|
+
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
4
5
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
6
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
6
7
|
import { joinPath, dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
7
8
|
import { uppercaseFirstLetter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
9
|
+
import { isString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
8
10
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
9
11
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
10
12
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
@@ -13,7 +15,7 @@ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log
|
|
|
13
15
|
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
14
16
|
import { asJson, asText } from '@codingame/monaco-vscode-api/vscode/vs/platform/request/common/request';
|
|
15
17
|
import { IRequestService } from '@codingame/monaco-vscode-api/vscode/vs/platform/request/common/request.service';
|
|
16
|
-
import { mcpGalleryServiceUrlConfig } from '@codingame/monaco-vscode-
|
|
18
|
+
import { mcpGalleryServiceUrlConfig } from '@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common/vscode/vs/platform/mcp/common/mcpManagement';
|
|
17
19
|
|
|
18
20
|
let McpGalleryService = class McpGalleryService extends Disposable {
|
|
19
21
|
constructor(configurationService, requestService, fileService, productService, logService) {
|
|
@@ -39,7 +41,22 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
39
41
|
}
|
|
40
42
|
return galleryServers;
|
|
41
43
|
}
|
|
44
|
+
async getMcpServers(names) {
|
|
45
|
+
const mcpUrl = this.getMcpGalleryUrl() ?? this.productService.extensionsGallery?.mcpUrl;
|
|
46
|
+
if (!mcpUrl) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
const { servers } = await this.fetchGallery(mcpUrl, CancellationToken.None);
|
|
50
|
+
const filteredServers = servers.filter(item => names.includes(item.name));
|
|
51
|
+
return ( filteredServers.map(item => this.toGalleryMcpServer(item)));
|
|
52
|
+
}
|
|
42
53
|
async getManifest(gallery, token) {
|
|
54
|
+
if (gallery.manifest) {
|
|
55
|
+
return gallery.manifest;
|
|
56
|
+
}
|
|
57
|
+
if (!gallery.manifestUrl) {
|
|
58
|
+
throw ( new Error(`No manifest URL found for ${gallery.name}`));
|
|
59
|
+
}
|
|
43
60
|
const uri = ( URI.parse(gallery.manifestUrl));
|
|
44
61
|
if (uri.scheme === Schemas.file) {
|
|
45
62
|
try {
|
|
@@ -67,7 +84,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
67
84
|
async getReadme(gallery, token) {
|
|
68
85
|
const readmeUrl = gallery.readmeUrl;
|
|
69
86
|
if (!readmeUrl) {
|
|
70
|
-
return Promise.resolve(( localize(
|
|
87
|
+
return Promise.resolve(( localize(1954, 'No README available')));
|
|
71
88
|
}
|
|
72
89
|
const uri = ( URI.parse(readmeUrl));
|
|
73
90
|
if (uri.scheme === Schemas.file) {
|
|
@@ -79,6 +96,9 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
79
96
|
this.logService.error(`Failed to read file from ${uri}: ${error}`);
|
|
80
97
|
}
|
|
81
98
|
}
|
|
99
|
+
if (uri.authority !== 'raw.githubusercontent.com') {
|
|
100
|
+
return ( new MarkdownString(( localize(1955, "You can find information about this server [here]({0})", readmeUrl)))).value;
|
|
101
|
+
}
|
|
82
102
|
const context = await this.requestService.request({
|
|
83
103
|
type: 'GET',
|
|
84
104
|
url: readmeUrl,
|
|
@@ -99,14 +119,15 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
99
119
|
}
|
|
100
120
|
}
|
|
101
121
|
return {
|
|
102
|
-
id: item.id,
|
|
122
|
+
id: item.id ?? item.name,
|
|
103
123
|
name: item.name,
|
|
104
124
|
displayName: item.displayName ?? ( nameParts[nameParts.length - 1].split('-').map(s => uppercaseFirstLetter(s))).join(' '),
|
|
105
|
-
url: item.repository
|
|
125
|
+
url: item.repository?.url,
|
|
106
126
|
description: item.description,
|
|
107
|
-
version: item.version_detail
|
|
108
|
-
lastUpdated: Date.parse(item.version_detail.release_date),
|
|
109
|
-
repositoryUrl: item.repository
|
|
127
|
+
version: item.version_detail?.version,
|
|
128
|
+
lastUpdated: item.version_detail ? Date.parse(item.version_detail.release_date) : undefined,
|
|
129
|
+
repositoryUrl: item.repository?.url,
|
|
130
|
+
codicon: item.codicon,
|
|
110
131
|
readmeUrl: item.readmeUrl,
|
|
111
132
|
manifestUrl: this.getManifestUrl(item),
|
|
112
133
|
packageTypes: item.package_types ?? [],
|
|
@@ -116,13 +137,15 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
116
137
|
link: item.publisher.url,
|
|
117
138
|
verified: item.publisher.is_verified,
|
|
118
139
|
} : undefined,
|
|
140
|
+
manifest: item.manifest
|
|
119
141
|
};
|
|
120
142
|
}
|
|
121
|
-
async fetchGallery(
|
|
122
|
-
const mcpGalleryUrl = this.getMcpGalleryUrl();
|
|
143
|
+
async fetchGallery(arg1, arg2) {
|
|
144
|
+
const mcpGalleryUrl = isString(arg1) ? arg1 : this.getMcpGalleryUrl();
|
|
123
145
|
if (!mcpGalleryUrl) {
|
|
124
146
|
return Promise.resolve({ servers: [] });
|
|
125
147
|
}
|
|
148
|
+
const token = isString(arg1) ? arg2 : arg1;
|
|
126
149
|
const uri = ( URI.parse(mcpGalleryUrl));
|
|
127
150
|
if (uri.scheme === Schemas.file) {
|
|
128
151
|
try {
|
|
@@ -144,11 +167,11 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
144
167
|
getManifestUrl(item) {
|
|
145
168
|
const mcpGalleryUrl = this.getMcpGalleryUrl();
|
|
146
169
|
if (!mcpGalleryUrl) {
|
|
147
|
-
return
|
|
170
|
+
return undefined;
|
|
148
171
|
}
|
|
149
172
|
const uri = ( URI.parse(mcpGalleryUrl));
|
|
150
173
|
if (uri.scheme === Schemas.file) {
|
|
151
|
-
return joinPath(dirname(uri), item.id).fsPath;
|
|
174
|
+
return joinPath(dirname(uri), item.id ?? item.name).fsPath;
|
|
152
175
|
}
|
|
153
176
|
return `${mcpGalleryUrl}/${item.id}`;
|
|
154
177
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
|
+
import { IURITransformer } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uriIpc";
|
|
5
|
+
import { IChannel, IServerChannel } from "@codingame/monaco-vscode-4a3ac544-9a61-534c-88df-756262793ef7-common/vscode/vs/base/parts/ipc/common/ipc";
|
|
6
|
+
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";
|
|
7
|
+
import { IMcpManagementService } from "@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service";
|
|
8
|
+
export declare class McpManagementChannel implements IServerChannel {
|
|
9
|
+
private service;
|
|
10
|
+
private getUriTransformer;
|
|
11
|
+
readonly onInstallMcpServer: Event<InstallMcpServerEvent>;
|
|
12
|
+
readonly onDidInstallMcpServers: Event<readonly InstallMcpServerResult[]>;
|
|
13
|
+
readonly onDidUpdateMcpServers: Event<readonly InstallMcpServerResult[]>;
|
|
14
|
+
readonly onUninstallMcpServer: Event<UninstallMcpServerEvent>;
|
|
15
|
+
readonly onDidUninstallMcpServer: Event<DidUninstallMcpServerEvent>;
|
|
16
|
+
constructor(service: IMcpManagementService, getUriTransformer: (requestContext: any) => IURITransformer | null);
|
|
17
|
+
listen(context: any, event: string): Event<any>;
|
|
18
|
+
call(context: any, command: string, args?: any): Promise<any>;
|
|
19
|
+
}
|
|
20
|
+
export declare class McpManagementChannelClient extends Disposable implements IMcpManagementService {
|
|
21
|
+
private readonly channel;
|
|
22
|
+
readonly _serviceBrand: undefined;
|
|
23
|
+
private readonly _onInstallMcpServer;
|
|
24
|
+
get onInstallMcpServer(): Event<InstallMcpServerEvent>;
|
|
25
|
+
private readonly _onDidInstallMcpServers;
|
|
26
|
+
get onDidInstallMcpServers(): Event<readonly InstallMcpServerResult[]>;
|
|
27
|
+
private readonly _onUninstallMcpServer;
|
|
28
|
+
get onUninstallMcpServer(): Event<UninstallMcpServerEvent>;
|
|
29
|
+
private readonly _onDidUninstallMcpServer;
|
|
30
|
+
get onDidUninstallMcpServer(): Event<DidUninstallMcpServerEvent>;
|
|
31
|
+
private readonly _onDidUpdateMcpServers;
|
|
32
|
+
get onDidUpdateMcpServers(): Event<InstallMcpServerResult[]>;
|
|
33
|
+
constructor(channel: IChannel);
|
|
34
|
+
install(server: IInstallableMcpServer, options?: InstallOptions): Promise<ILocalMcpServer>;
|
|
35
|
+
installFromGallery(extension: IGalleryMcpServer, installOptions?: InstallOptions): Promise<ILocalMcpServer>;
|
|
36
|
+
uninstall(extension: ILocalMcpServer, options?: UninstallOptions): Promise<void>;
|
|
37
|
+
getInstalled(mcpResource?: URI): Promise<ILocalMcpServer[]>;
|
|
38
|
+
updateMetadata(local: ILocalMcpServer, gallery: IGalleryMcpServer, mcpResource?: URI): Promise<ILocalMcpServer>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
|
|
2
|
+
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
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
5
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
6
|
+
import { DefaultURITransformer, transformAndReviveIncomingURIs } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uriIpc';
|
|
7
|
+
|
|
8
|
+
function transformIncomingURI(uri, transformer) {
|
|
9
|
+
return uri ? URI.revive(uri) : undefined;
|
|
10
|
+
}
|
|
11
|
+
function transformIncomingServer(mcpServer, transformer) {
|
|
12
|
+
transformer = transformer ? transformer : DefaultURITransformer;
|
|
13
|
+
const manifest = mcpServer.manifest;
|
|
14
|
+
const transformed = transformAndReviveIncomingURIs({ ...mcpServer, ...{ manifest: undefined } }, transformer);
|
|
15
|
+
return { ...transformed, ...{ manifest } };
|
|
16
|
+
}
|
|
17
|
+
class McpManagementChannelClient extends Disposable {
|
|
18
|
+
get onInstallMcpServer() { return this._onInstallMcpServer.event; }
|
|
19
|
+
get onDidInstallMcpServers() { return this._onDidInstallMcpServers.event; }
|
|
20
|
+
get onUninstallMcpServer() { return this._onUninstallMcpServer.event; }
|
|
21
|
+
get onDidUninstallMcpServer() { return this._onDidUninstallMcpServer.event; }
|
|
22
|
+
get onDidUpdateMcpServers() { return this._onDidUpdateMcpServers.event; }
|
|
23
|
+
constructor(channel) {
|
|
24
|
+
super();
|
|
25
|
+
this.channel = channel;
|
|
26
|
+
this._onInstallMcpServer = this._register(( new Emitter()));
|
|
27
|
+
this._onDidInstallMcpServers = this._register(( new Emitter()));
|
|
28
|
+
this._onUninstallMcpServer = this._register(( new Emitter()));
|
|
29
|
+
this._onDidUninstallMcpServer = this._register(( new Emitter()));
|
|
30
|
+
this._onDidUpdateMcpServers = this._register(( new Emitter()));
|
|
31
|
+
this._register(this.channel.listen('onInstallMcpServer')(e => this._onInstallMcpServer.fire(({ ...e, mcpResource: transformIncomingURI(e.mcpResource) }))));
|
|
32
|
+
this._register(this.channel.listen('onDidInstallMcpServers')(results => this._onDidInstallMcpServers.fire(( results.map(
|
|
33
|
+
e => ({ ...e, local: e.local ? transformIncomingServer(e.local, null) : e.local, mcpResource: transformIncomingURI(e.mcpResource) })
|
|
34
|
+
)))));
|
|
35
|
+
this._register(this.channel.listen('onDidUpdateMcpServers')(results => this._onDidUpdateMcpServers.fire(( results.map(
|
|
36
|
+
e => ({ ...e, local: e.local ? transformIncomingServer(e.local, null) : e.local, mcpResource: transformIncomingURI(e.mcpResource) })
|
|
37
|
+
)))));
|
|
38
|
+
this._register(this.channel.listen('onUninstallMcpServer')(e => this._onUninstallMcpServer.fire(({ ...e, mcpResource: transformIncomingURI(e.mcpResource) }))));
|
|
39
|
+
this._register(this.channel.listen('onDidUninstallMcpServer')(e => this._onDidUninstallMcpServer.fire(({ ...e, mcpResource: transformIncomingURI(e.mcpResource) }))));
|
|
40
|
+
}
|
|
41
|
+
install(server, options) {
|
|
42
|
+
return Promise.resolve(this.channel.call('install', [server, options])).then(local => transformIncomingServer(local, null));
|
|
43
|
+
}
|
|
44
|
+
installFromGallery(extension, installOptions) {
|
|
45
|
+
return Promise.resolve(this.channel.call('installFromGallery', [extension, installOptions])).then(local => transformIncomingServer(local, null));
|
|
46
|
+
}
|
|
47
|
+
uninstall(extension, options) {
|
|
48
|
+
return Promise.resolve(this.channel.call('uninstall', [extension, options]));
|
|
49
|
+
}
|
|
50
|
+
getInstalled(mcpResource) {
|
|
51
|
+
return Promise.resolve(this.channel.call('getInstalled', [mcpResource]))
|
|
52
|
+
.then(servers => ( servers.map(server => transformIncomingServer(server, null))));
|
|
53
|
+
}
|
|
54
|
+
updateMetadata(local, gallery, mcpResource) {
|
|
55
|
+
return Promise.resolve(this.channel.call('updateMetadata', [local, gallery, mcpResource])).then(local => transformIncomingServer(local, null));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { McpManagementChannelClient };
|
|
@@ -1,35 +1,109 @@
|
|
|
1
1
|
import { Emitter } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
2
2
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
-
import {
|
|
3
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
4
|
import { IEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service";
|
|
5
5
|
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
6
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
6
7
|
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
7
8
|
import { IUriIdentityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
|
|
8
|
-
import {
|
|
9
|
+
import { IUserDataProfilesService } from "@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfile.service";
|
|
10
|
+
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";
|
|
9
11
|
import { IMcpManagementService } from "@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service";
|
|
10
12
|
import { IMcpGalleryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement.service";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
import { IMcpServerVariable, IMcpServerConfiguration } from "./mcpPlatformTypes.js";
|
|
14
|
+
import { McpResourceTarget } from "./mcpResourceScannerService.js";
|
|
15
|
+
import { IMcpResourceScannerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpResourceScannerService.service";
|
|
16
|
+
export interface ILocalMcpServerInfo {
|
|
17
|
+
name: string;
|
|
18
|
+
version?: string;
|
|
19
|
+
id?: string;
|
|
20
|
+
displayName?: string;
|
|
21
|
+
url?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
repositoryUrl?: string;
|
|
24
|
+
publisher?: string;
|
|
25
|
+
publisherDisplayName?: string;
|
|
26
|
+
icon?: {
|
|
27
|
+
dark: string;
|
|
28
|
+
light: string;
|
|
29
|
+
};
|
|
30
|
+
codicon?: string;
|
|
31
|
+
manifest?: IMcpServerManifest;
|
|
32
|
+
readmeUrl?: URI;
|
|
33
|
+
location?: URI;
|
|
34
|
+
licenseUrl?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare abstract class AbstractMcpResourceManagementService extends Disposable implements IMcpManagementService {
|
|
37
|
+
protected readonly mcpResource: URI;
|
|
38
|
+
protected readonly target: McpResourceTarget;
|
|
39
|
+
protected readonly mcpGalleryService: IMcpGalleryService;
|
|
40
|
+
protected readonly fileService: IFileService;
|
|
41
|
+
protected readonly uriIdentityService: IUriIdentityService;
|
|
42
|
+
protected readonly logService: ILogService;
|
|
43
|
+
protected readonly mcpResourceScannerService: IMcpResourceScannerService;
|
|
17
44
|
_serviceBrand: undefined;
|
|
18
|
-
private
|
|
19
|
-
private readonly
|
|
45
|
+
private initializePromise;
|
|
46
|
+
private readonly reloadConfigurationScheduler;
|
|
47
|
+
private local;
|
|
48
|
+
protected readonly _onInstallMcpServer: Emitter<InstallMcpServerEvent>;
|
|
20
49
|
readonly onInstallMcpServer: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<InstallMcpServerEvent>;
|
|
21
50
|
protected readonly _onDidInstallMcpServers: Emitter<InstallMcpServerResult[]>;
|
|
22
51
|
get onDidInstallMcpServers(): import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<InstallMcpServerResult[]>;
|
|
52
|
+
protected readonly _onDidUpdateMcpServers: Emitter<InstallMcpServerResult[]>;
|
|
53
|
+
get onDidUpdateMcpServers(): import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<InstallMcpServerResult[]>;
|
|
23
54
|
protected readonly _onUninstallMcpServer: Emitter<UninstallMcpServerEvent>;
|
|
24
55
|
get onUninstallMcpServer(): import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<UninstallMcpServerEvent>;
|
|
25
56
|
protected _onDidUninstallMcpServer: Emitter<DidUninstallMcpServerEvent>;
|
|
26
57
|
get onDidUninstallMcpServer(): import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<DidUninstallMcpServerEvent>;
|
|
27
|
-
constructor(
|
|
58
|
+
constructor(mcpResource: URI, target: McpResourceTarget, mcpGalleryService: IMcpGalleryService, fileService: IFileService, uriIdentityService: IUriIdentityService, logService: ILogService, mcpResourceScannerService: IMcpResourceScannerService);
|
|
59
|
+
private initialize;
|
|
60
|
+
private populateLocalServers;
|
|
61
|
+
private startWatching;
|
|
62
|
+
protected updateLocal(): Promise<void>;
|
|
28
63
|
getInstalled(): Promise<ILocalMcpServer[]>;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
uninstall(server: ILocalMcpServer): Promise<void>;
|
|
32
|
-
|
|
64
|
+
protected scanLocalServer(name: string, config: IMcpServerConfiguration): Promise<ILocalMcpServer>;
|
|
65
|
+
install(server: IInstallableMcpServer, options?: Omit<InstallOptions, "mcpResource">): Promise<ILocalMcpServer>;
|
|
66
|
+
uninstall(server: ILocalMcpServer, options?: Omit<UninstallOptions, "mcpResource">): Promise<void>;
|
|
67
|
+
protected toScannedMcpServerAndInputs(manifest: IMcpServerManifest, packageType?: PackageType): {
|
|
68
|
+
config: IMcpServerConfiguration;
|
|
69
|
+
inputs?: IMcpServerVariable[];
|
|
70
|
+
};
|
|
33
71
|
private getCommandName;
|
|
34
72
|
private getVariables;
|
|
73
|
+
abstract installFromGallery(server: IGalleryMcpServer, options?: InstallOptions): Promise<ILocalMcpServer>;
|
|
74
|
+
abstract updateMetadata(local: ILocalMcpServer, server: IGalleryMcpServer, profileLocation: URI): Promise<ILocalMcpServer>;
|
|
75
|
+
protected abstract getLocalServerInfo(name: string, mcpServerConfig: IMcpServerConfiguration): Promise<ILocalMcpServerInfo | undefined>;
|
|
76
|
+
}
|
|
77
|
+
export declare class McpUserResourceManagementService extends AbstractMcpResourceManagementService implements IMcpManagementService {
|
|
78
|
+
private readonly mcpLocation;
|
|
79
|
+
constructor(mcpResource: URI, mcpGalleryService: IMcpGalleryService, fileService: IFileService, uriIdentityService: IUriIdentityService, logService: ILogService, mcpResourceScannerService: IMcpResourceScannerService, environmentService: IEnvironmentService);
|
|
80
|
+
installFromGallery(server: IGalleryMcpServer, options?: InstallOptions): Promise<ILocalMcpServer>;
|
|
81
|
+
updateMetadata(local: ILocalMcpServer, gallery: IGalleryMcpServer): Promise<ILocalMcpServer>;
|
|
82
|
+
private updateMetadataFromGallery;
|
|
83
|
+
protected getLocalServerInfo(name: string, mcpServerConfig: IMcpServerConfiguration): Promise<ILocalMcpServerInfo | undefined>;
|
|
84
|
+
private getLocation;
|
|
85
|
+
}
|
|
86
|
+
export declare class McpManagementService extends Disposable implements IMcpManagementService {
|
|
87
|
+
private readonly userDataProfilesService;
|
|
88
|
+
private readonly instantiationService;
|
|
89
|
+
readonly _serviceBrand: undefined;
|
|
90
|
+
private readonly _onInstallMcpServer;
|
|
91
|
+
readonly onInstallMcpServer: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<InstallMcpServerEvent>;
|
|
92
|
+
private readonly _onDidInstallMcpServers;
|
|
93
|
+
readonly onDidInstallMcpServers: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<readonly InstallMcpServerResult[]>;
|
|
94
|
+
private readonly _onDidUpdateMcpServers;
|
|
95
|
+
readonly onDidUpdateMcpServers: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<readonly InstallMcpServerResult[]>;
|
|
96
|
+
private readonly _onUninstallMcpServer;
|
|
97
|
+
readonly onUninstallMcpServer: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<UninstallMcpServerEvent>;
|
|
98
|
+
private readonly _onDidUninstallMcpServer;
|
|
99
|
+
readonly onDidUninstallMcpServer: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<DidUninstallMcpServerEvent>;
|
|
100
|
+
private readonly mcpResourceManagementServices;
|
|
101
|
+
constructor(userDataProfilesService: IUserDataProfilesService, instantiationService: IInstantiationService);
|
|
102
|
+
private getMcpResourceManagementService;
|
|
103
|
+
getInstalled(mcpResource?: URI): Promise<ILocalMcpServer[]>;
|
|
104
|
+
install(server: IInstallableMcpServer, options?: InstallOptions): Promise<ILocalMcpServer>;
|
|
105
|
+
uninstall(server: ILocalMcpServer, options?: UninstallOptions): Promise<void>;
|
|
106
|
+
installFromGallery(server: IGalleryMcpServer, options?: InstallOptions): Promise<ILocalMcpServer>;
|
|
107
|
+
updateMetadata(local: ILocalMcpServer, gallery: IGalleryMcpServer, mcpResource?: URI): Promise<ILocalMcpServer>;
|
|
108
|
+
dispose(): void;
|
|
35
109
|
}
|