@codingame/monaco-vscode-mcp-service-override 25.1.2 → 26.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/package.json +2 -2
- package/vscode/src/vs/platform/mcp/common/allowedMcpServersService.js +5 -5
- package/vscode/src/vs/platform/mcp/common/mcpGalleryManifestService.js +20 -30
- package/vscode/src/vs/platform/mcp/common/mcpGalleryService.js +195 -135
- package/vscode/src/vs/platform/mcp/common/mcpManagementIpc.js +65 -26
- package/vscode/src/vs/platform/mcp/common/mcpManagementService.js +222 -139
- package/vscode/src/vs/platform/mcp/common/mcpResourceScannerService.js +45 -34
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js +65 -32
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.js +11 -14
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.d.ts +7 -1
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.js +437 -362
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpDiscovery.js +4 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +298 -160
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +184 -141
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpMigration.js +52 -56
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess.js +169 -118
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.js +369 -237
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +425 -252
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +9 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +127 -91
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +229 -160
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +220 -120
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.js +28 -27
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/installedMcpServersDiscovery.js +33 -26
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +31 -29
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.js +43 -20
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpRemoteDiscovery.js +20 -13
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/workspaceMcpDiscoveryAdapter.js +21 -16
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpConfigFileUtils.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +32 -27
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.service.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.js +157 -81
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +208 -139
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistryInputStorage.js +42 -25
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpResourceFilesystem.js +86 -50
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.js +31 -23
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js +124 -74
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +46 -23
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerRequestHandler.js +282 -195
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.js +59 -35
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpAccessService.js +22 -23
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +109 -73
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpUsageService.js +14 -17
- package/vscode/src/vs/workbench/services/mcp/browser/mcpGalleryManifestService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/mcp/browser/mcpGalleryManifestService.js +25 -21
- package/vscode/src/vs/workbench/services/mcp/browser/mcpWorkbenchManagementService.js +24 -13
- package/vscode/src/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.js +215 -108
- package/vscode/src/vs/base/common/uriTransformer.d.ts +0 -2
- package/vscode/src/vs/base/common/uriTransformer.js +0 -39
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.js +0 -90
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpIcons.d.ts +0 -36
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpIcons.js +0 -107
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.d.ts +0 -206
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.js +0 -886
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpTaskManager.d.ts +0 -68
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpTaskManager.js +0 -168
- package/vscode/src/vs/workbench/contrib/mcp/common/uriTemplate.d.ts +0 -37
- package/vscode/src/vs/workbench/contrib/mcp/common/uriTemplate.js +0 -296
|
@@ -18,7 +18,7 @@ import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/c
|
|
|
18
18
|
import { isString, isObject } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
19
19
|
|
|
20
20
|
var IconMimeType;
|
|
21
|
-
(function
|
|
21
|
+
(function(IconMimeType) {
|
|
22
22
|
IconMimeType["PNG"] = "image/png";
|
|
23
23
|
IconMimeType["JPEG"] = "image/jpeg";
|
|
24
24
|
IconMimeType["JPG"] = "image/jpg";
|
|
@@ -26,17 +26,17 @@ var IconMimeType;
|
|
|
26
26
|
IconMimeType["WEBP"] = "image/webp";
|
|
27
27
|
})(IconMimeType || (IconMimeType = {}));
|
|
28
28
|
var IconTheme;
|
|
29
|
-
(function
|
|
29
|
+
(function(IconTheme) {
|
|
30
30
|
IconTheme["LIGHT"] = "light";
|
|
31
31
|
IconTheme["DARK"] = "dark";
|
|
32
32
|
})(IconTheme || (IconTheme = {}));
|
|
33
33
|
var McpServerSchemaVersion_v2025_07_09;
|
|
34
|
-
(function
|
|
35
|
-
McpServerSchemaVersion_v2025_07_09.VERSION =
|
|
34
|
+
(function(McpServerSchemaVersion_v2025_07_09) {
|
|
35
|
+
McpServerSchemaVersion_v2025_07_09.VERSION = "v0-2025-07-09";
|
|
36
36
|
McpServerSchemaVersion_v2025_07_09.SCHEMA = `https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json`;
|
|
37
37
|
class Serializer {
|
|
38
38
|
toRawGalleryMcpServerResult(input) {
|
|
39
|
-
if (!input || typeof input !==
|
|
39
|
+
if (!input || typeof input !== "object" || !Array.isArray(input.servers)) {
|
|
40
40
|
return undefined;
|
|
41
41
|
}
|
|
42
42
|
const from = input;
|
|
@@ -57,24 +57,22 @@ var McpServerSchemaVersion_v2025_07_09;
|
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
toRawGalleryMcpServer(input) {
|
|
60
|
-
if (!input || typeof input !==
|
|
60
|
+
if (!input || typeof input !== "object") {
|
|
61
61
|
return undefined;
|
|
62
62
|
}
|
|
63
63
|
const from = input;
|
|
64
|
-
if ((!from.name || !isString(from.name))
|
|
65
|
-
|| (!from.description || !isString(from.description))
|
|
66
|
-
|| (!from.version || !isString(from.version))) {
|
|
64
|
+
if ((!from.name || !isString(from.name)) || (!from.description || !isString(from.description)) || (!from.version || !isString(from.version))) {
|
|
67
65
|
return undefined;
|
|
68
66
|
}
|
|
69
67
|
if (from.$schema && from.$schema !== McpServerSchemaVersion_v2025_07_09.SCHEMA) {
|
|
70
68
|
return undefined;
|
|
71
69
|
}
|
|
72
|
-
const registryInfo = from._meta?.[
|
|
70
|
+
const registryInfo = from._meta?.["io.modelcontextprotocol.registry/official"];
|
|
73
71
|
function convertServerInput(input) {
|
|
74
72
|
return {
|
|
75
73
|
...input,
|
|
76
74
|
isRequired: input.is_required,
|
|
77
|
-
isSecret: input.is_secret
|
|
75
|
+
isSecret: input.is_secret
|
|
78
76
|
};
|
|
79
77
|
}
|
|
80
78
|
function convertVariables(variables) {
|
|
@@ -85,14 +83,14 @@ var McpServerSchemaVersion_v2025_07_09;
|
|
|
85
83
|
return result;
|
|
86
84
|
}
|
|
87
85
|
function convertServerArgument(arg) {
|
|
88
|
-
if (arg.type ===
|
|
86
|
+
if (arg.type === "positional") {
|
|
89
87
|
return {
|
|
90
88
|
...arg,
|
|
91
89
|
valueHint: arg.value_hint,
|
|
92
90
|
isRepeated: arg.is_repeated,
|
|
93
91
|
isRequired: arg.is_required,
|
|
94
92
|
isSecret: arg.is_secret,
|
|
95
|
-
variables: arg.variables ? convertVariables(arg.variables) : undefined
|
|
93
|
+
variables: arg.variables ? convertVariables(arg.variables) : undefined
|
|
96
94
|
};
|
|
97
95
|
}
|
|
98
96
|
return {
|
|
@@ -100,7 +98,7 @@ var McpServerSchemaVersion_v2025_07_09;
|
|
|
100
98
|
isRepeated: arg.is_repeated,
|
|
101
99
|
isRequired: arg.is_required,
|
|
102
100
|
isSecret: arg.is_secret,
|
|
103
|
-
variables: arg.variables ? convertVariables(arg.variables) : undefined
|
|
101
|
+
variables: arg.variables ? convertVariables(arg.variables) : undefined
|
|
104
102
|
};
|
|
105
103
|
}
|
|
106
104
|
function convertKeyValueInput(input) {
|
|
@@ -108,52 +106,52 @@ var McpServerSchemaVersion_v2025_07_09;
|
|
|
108
106
|
...input,
|
|
109
107
|
isRequired: input.is_required,
|
|
110
108
|
isSecret: input.is_secret,
|
|
111
|
-
variables: input.variables ? convertVariables(input.variables) : undefined
|
|
109
|
+
variables: input.variables ? convertVariables(input.variables) : undefined
|
|
112
110
|
};
|
|
113
111
|
}
|
|
114
112
|
function convertTransport(input) {
|
|
115
113
|
switch (input.type) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
114
|
+
case "stdio":
|
|
115
|
+
return {
|
|
116
|
+
type: TransportType.STDIO
|
|
117
|
+
};
|
|
118
|
+
case "streamable-http":
|
|
119
|
+
return {
|
|
120
|
+
type: TransportType.STREAMABLE_HTTP,
|
|
121
|
+
url: input.url,
|
|
122
|
+
headers: input.headers?.map(convertKeyValueInput)
|
|
123
|
+
};
|
|
124
|
+
case "sse":
|
|
125
|
+
return {
|
|
126
|
+
type: TransportType.SSE,
|
|
127
|
+
url: input.url,
|
|
128
|
+
headers: input.headers?.map(convertKeyValueInput)
|
|
129
|
+
};
|
|
130
|
+
default:
|
|
131
|
+
return {
|
|
132
|
+
type: TransportType.STDIO
|
|
133
|
+
};
|
|
136
134
|
}
|
|
137
135
|
}
|
|
138
136
|
function convertRegistryType(input) {
|
|
139
137
|
switch (input) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
138
|
+
case "npm":
|
|
139
|
+
return RegistryType.NODE;
|
|
140
|
+
case "docker":
|
|
141
|
+
case "docker-hub":
|
|
142
|
+
case "oci":
|
|
143
|
+
return RegistryType.DOCKER;
|
|
144
|
+
case "pypi":
|
|
145
|
+
return RegistryType.PYTHON;
|
|
146
|
+
case "nuget":
|
|
147
|
+
return RegistryType.NUGET;
|
|
148
|
+
case "mcpb":
|
|
149
|
+
return RegistryType.MCPB;
|
|
150
|
+
default:
|
|
151
|
+
return RegistryType.NODE;
|
|
154
152
|
}
|
|
155
153
|
}
|
|
156
|
-
const gitHubInfo = from._meta[
|
|
154
|
+
const gitHubInfo = from._meta["io.modelcontextprotocol.registry/publisher-provided"]?.github;
|
|
157
155
|
return {
|
|
158
156
|
id: registryInfo.id,
|
|
159
157
|
name: from.name,
|
|
@@ -161,7 +159,7 @@ var McpServerSchemaVersion_v2025_07_09;
|
|
|
161
159
|
repository: from.repository ? {
|
|
162
160
|
url: from.repository.url,
|
|
163
161
|
source: from.repository.source,
|
|
164
|
-
id: from.repository.id
|
|
162
|
+
id: from.repository.id
|
|
165
163
|
} : undefined,
|
|
166
164
|
readme: from.repository?.readme,
|
|
167
165
|
version: from.version,
|
|
@@ -173,11 +171,13 @@ var McpServerSchemaVersion_v2025_07_09;
|
|
|
173
171
|
version: p.version,
|
|
174
172
|
fileSha256: p.file_sha256,
|
|
175
173
|
registryBaseUrl: p.registry_base_url,
|
|
176
|
-
transport: p.transport ? convertTransport(p.transport) : {
|
|
174
|
+
transport: p.transport ? convertTransport(p.transport) : {
|
|
175
|
+
type: TransportType.STDIO
|
|
176
|
+
},
|
|
177
177
|
packageArguments: p.package_arguments?.map(convertServerArgument),
|
|
178
178
|
runtimeHint: p.runtime_hint,
|
|
179
179
|
runtimeArguments: p.runtime_arguments?.map(convertServerArgument),
|
|
180
|
-
environmentVariables: p.environment_variables?.map(convertKeyValueInput)
|
|
180
|
+
environmentVariables: p.environment_variables?.map(convertKeyValueInput)
|
|
181
181
|
})),
|
|
182
182
|
remotes: from.remotes?.map(remote => {
|
|
183
183
|
const type = remote.type ?? remote.transport_type ?? remote.transport;
|
|
@@ -190,7 +190,7 @@ var McpServerSchemaVersion_v2025_07_09;
|
|
|
190
190
|
registryInfo: {
|
|
191
191
|
isLatest: registryInfo.is_latest,
|
|
192
192
|
publishedAt: registryInfo.published_at,
|
|
193
|
-
updatedAt: registryInfo.updated_at
|
|
193
|
+
updatedAt: registryInfo.updated_at
|
|
194
194
|
},
|
|
195
195
|
githubInfo: gitHubInfo ? {
|
|
196
196
|
name: gitHubInfo.name,
|
|
@@ -211,13 +211,15 @@ var McpServerSchemaVersion_v2025_07_09;
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
McpServerSchemaVersion_v2025_07_09.SERIALIZER = ( new Serializer());
|
|
214
|
-
})(
|
|
214
|
+
})(
|
|
215
|
+
McpServerSchemaVersion_v2025_07_09 || (McpServerSchemaVersion_v2025_07_09 = {})
|
|
216
|
+
);
|
|
215
217
|
var McpServerSchemaVersion_v0_1;
|
|
216
|
-
(function
|
|
217
|
-
McpServerSchemaVersion_v0_1.VERSION =
|
|
218
|
+
(function(McpServerSchemaVersion_v0_1) {
|
|
219
|
+
McpServerSchemaVersion_v0_1.VERSION = "v0.1";
|
|
218
220
|
class Serializer {
|
|
219
221
|
toRawGalleryMcpServerResult(input) {
|
|
220
|
-
if (!input || typeof input !==
|
|
222
|
+
if (!input || typeof input !== "object" || !Array.isArray(input.servers)) {
|
|
221
223
|
return undefined;
|
|
222
224
|
}
|
|
223
225
|
const from = input;
|
|
@@ -227,8 +229,7 @@ var McpServerSchemaVersion_v0_1;
|
|
|
227
229
|
if (!rawServer) {
|
|
228
230
|
if (servers.length === 0) {
|
|
229
231
|
return undefined;
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
+
} else {
|
|
232
233
|
continue;
|
|
233
234
|
}
|
|
234
235
|
}
|
|
@@ -240,18 +241,18 @@ var McpServerSchemaVersion_v0_1;
|
|
|
240
241
|
};
|
|
241
242
|
}
|
|
242
243
|
toRawGalleryMcpServer(input) {
|
|
243
|
-
if (!input || typeof input !==
|
|
244
|
+
if (!input || typeof input !== "object") {
|
|
244
245
|
return undefined;
|
|
245
246
|
}
|
|
246
247
|
const from = input;
|
|
247
|
-
if ((!from.server || !isObject(from.server))
|
|
248
|
-
|| (!from.server.name || !isString(from.server.name))
|
|
249
|
-
|| (!from.server.description || !isString(from.server.description))
|
|
250
|
-
|| (!from.server.version || !isString(from.server.version))) {
|
|
248
|
+
if ((!from.server || !isObject(from.server)) || (!from.server.name || !isString(from.server.name)) || (!from.server.description || !isString(from.server.description)) || (!from.server.version || !isString(from.server.version))) {
|
|
251
249
|
return undefined;
|
|
252
250
|
}
|
|
253
|
-
const {
|
|
254
|
-
|
|
251
|
+
const {
|
|
252
|
+
"io.modelcontextprotocol.registry/official": registryInfo,
|
|
253
|
+
...apicInfo
|
|
254
|
+
} = from._meta;
|
|
255
|
+
const githubInfo = from.server._meta?.["io.modelcontextprotocol.registry/publisher-provided"]?.github;
|
|
255
256
|
return {
|
|
256
257
|
name: from.server.name,
|
|
257
258
|
description: from.server.description,
|
|
@@ -260,7 +261,7 @@ var McpServerSchemaVersion_v0_1;
|
|
|
260
261
|
repository: from.server.repository ? {
|
|
261
262
|
url: from.server.repository.url,
|
|
262
263
|
source: from.server.repository.source,
|
|
263
|
-
id: from.server.repository.id
|
|
264
|
+
id: from.server.repository.id
|
|
264
265
|
} : undefined,
|
|
265
266
|
readme: githubInfo?.readme,
|
|
266
267
|
icons: from.server.icons,
|
|
@@ -277,8 +278,8 @@ var McpServerSchemaVersion_v0_1;
|
|
|
277
278
|
McpServerSchemaVersion_v0_1.SERIALIZER = ( new Serializer());
|
|
278
279
|
})(McpServerSchemaVersion_v0_1 || (McpServerSchemaVersion_v0_1 = {}));
|
|
279
280
|
var McpServerSchemaVersion_v0;
|
|
280
|
-
(function
|
|
281
|
-
McpServerSchemaVersion_v0.VERSION =
|
|
281
|
+
(function(McpServerSchemaVersion_v0) {
|
|
282
|
+
McpServerSchemaVersion_v0.VERSION = "v0";
|
|
282
283
|
class Serializer {
|
|
283
284
|
constructor() {
|
|
284
285
|
this.galleryMcpServerDataSerializers = [];
|
|
@@ -308,20 +309,33 @@ var McpServerSchemaVersion_v0;
|
|
|
308
309
|
})(McpServerSchemaVersion_v0 || (McpServerSchemaVersion_v0 = {}));
|
|
309
310
|
const DefaultPageSize = 50;
|
|
310
311
|
const DefaultQueryState = {
|
|
311
|
-
pageSize: DefaultPageSize
|
|
312
|
+
pageSize: DefaultPageSize
|
|
312
313
|
};
|
|
313
314
|
class Query {
|
|
314
315
|
constructor(state = DefaultQueryState) {
|
|
315
316
|
this.state = state;
|
|
316
317
|
}
|
|
317
|
-
get pageSize() {
|
|
318
|
-
|
|
319
|
-
|
|
318
|
+
get pageSize() {
|
|
319
|
+
return this.state.pageSize;
|
|
320
|
+
}
|
|
321
|
+
get searchText() {
|
|
322
|
+
return this.state.searchText;
|
|
323
|
+
}
|
|
324
|
+
get cursor() {
|
|
325
|
+
return this.state.cursor;
|
|
326
|
+
}
|
|
320
327
|
withPage(cursor, pageSize = this.pageSize) {
|
|
321
|
-
return ( new Query({
|
|
328
|
+
return ( new Query({
|
|
329
|
+
...this.state,
|
|
330
|
+
pageSize,
|
|
331
|
+
cursor
|
|
332
|
+
}));
|
|
322
333
|
}
|
|
323
334
|
withSearchText(searchText) {
|
|
324
|
-
return ( new Query({
|
|
335
|
+
return ( new Query({
|
|
336
|
+
...this.state,
|
|
337
|
+
searchText
|
|
338
|
+
}));
|
|
325
339
|
}
|
|
326
340
|
}
|
|
327
341
|
let McpGalleryService = class McpGalleryService extends Disposable {
|
|
@@ -333,7 +347,10 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
333
347
|
this.mcpGalleryManifestService = mcpGalleryManifestService;
|
|
334
348
|
this.galleryMcpServerDataSerializers = ( new Map());
|
|
335
349
|
this.galleryMcpServerDataSerializers.set(McpServerSchemaVersion_v0.VERSION, McpServerSchemaVersion_v0.SERIALIZER);
|
|
336
|
-
this.galleryMcpServerDataSerializers.set(
|
|
350
|
+
this.galleryMcpServerDataSerializers.set(
|
|
351
|
+
McpServerSchemaVersion_v0_1.VERSION,
|
|
352
|
+
McpServerSchemaVersion_v0_1.SERIALIZER
|
|
353
|
+
);
|
|
337
354
|
}
|
|
338
355
|
isEnabled() {
|
|
339
356
|
return this.mcpGalleryManifestService.mcpGalleryManifestStatus === McpGalleryManifestStatus.Available;
|
|
@@ -342,28 +359,53 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
342
359
|
const mcpGalleryManifest = await this.mcpGalleryManifestService.getMcpGalleryManifest();
|
|
343
360
|
if (!mcpGalleryManifest) {
|
|
344
361
|
return {
|
|
345
|
-
firstPage: {
|
|
346
|
-
|
|
362
|
+
firstPage: {
|
|
363
|
+
items: [],
|
|
364
|
+
hasMore: false
|
|
365
|
+
},
|
|
366
|
+
getNextPage: async () => ({
|
|
367
|
+
items: [],
|
|
368
|
+
hasMore: false
|
|
369
|
+
})
|
|
347
370
|
};
|
|
348
371
|
}
|
|
349
372
|
let query = ( new Query());
|
|
350
373
|
if (options?.text) {
|
|
351
374
|
query = query.withSearchText(options.text.trim());
|
|
352
375
|
}
|
|
353
|
-
const {
|
|
376
|
+
const {
|
|
377
|
+
servers,
|
|
378
|
+
metadata
|
|
379
|
+
} = await this.queryGalleryMcpServers(query, mcpGalleryManifest, token);
|
|
354
380
|
let currentCursor = metadata.nextCursor;
|
|
355
381
|
return {
|
|
356
|
-
firstPage: {
|
|
357
|
-
|
|
382
|
+
firstPage: {
|
|
383
|
+
items: servers,
|
|
384
|
+
hasMore: !!metadata.nextCursor
|
|
385
|
+
},
|
|
386
|
+
getNextPage: async ct => {
|
|
358
387
|
if (ct.isCancellationRequested) {
|
|
359
388
|
throw ( new CancellationError());
|
|
360
389
|
}
|
|
361
390
|
if (!currentCursor) {
|
|
362
|
-
return {
|
|
391
|
+
return {
|
|
392
|
+
items: [],
|
|
393
|
+
hasMore: false
|
|
394
|
+
};
|
|
363
395
|
}
|
|
364
|
-
const {
|
|
396
|
+
const {
|
|
397
|
+
servers,
|
|
398
|
+
metadata: nextMetadata
|
|
399
|
+
} = await this.queryGalleryMcpServers(
|
|
400
|
+
query.withPage(currentCursor).withSearchText(undefined),
|
|
401
|
+
mcpGalleryManifest,
|
|
402
|
+
ct
|
|
403
|
+
);
|
|
365
404
|
currentCursor = nextMetadata.nextCursor;
|
|
366
|
-
return {
|
|
405
|
+
return {
|
|
406
|
+
items: servers,
|
|
407
|
+
hasMore: !!nextMetadata.nextCursor
|
|
408
|
+
};
|
|
367
409
|
}
|
|
368
410
|
};
|
|
369
411
|
}
|
|
@@ -373,7 +415,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
373
415
|
return [];
|
|
374
416
|
}
|
|
375
417
|
const mcpServers = [];
|
|
376
|
-
await Promise.allSettled(( infos.map(async
|
|
418
|
+
await Promise.allSettled(( infos.map(async info => {
|
|
377
419
|
const mcpServer = await this.getMcpServerByName(info, mcpGalleryManifest);
|
|
378
420
|
if (mcpServer) {
|
|
379
421
|
mcpServers.push(mcpServer);
|
|
@@ -381,7 +423,13 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
381
423
|
})));
|
|
382
424
|
return mcpServers;
|
|
383
425
|
}
|
|
384
|
-
async getMcpServerByName(
|
|
426
|
+
async getMcpServerByName(
|
|
427
|
+
{
|
|
428
|
+
name,
|
|
429
|
+
id
|
|
430
|
+
},
|
|
431
|
+
mcpGalleryManifest
|
|
432
|
+
) {
|
|
385
433
|
const mcpServerUrl = this.getLatestServerVersionUrl(name, mcpGalleryManifest);
|
|
386
434
|
if (mcpServerUrl) {
|
|
387
435
|
const mcpServer = await this.getMcpServer(mcpServerUrl);
|
|
@@ -408,24 +456,23 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
408
456
|
async getReadme(gallery, token) {
|
|
409
457
|
const readmeUrl = gallery.readmeUrl;
|
|
410
458
|
if (!readmeUrl) {
|
|
411
|
-
return Promise.resolve(( localize(
|
|
459
|
+
return Promise.resolve(( localize(2003, "No README available")));
|
|
412
460
|
}
|
|
413
461
|
const uri = ( URI.parse(readmeUrl));
|
|
414
462
|
if (uri.scheme === Schemas.file) {
|
|
415
463
|
try {
|
|
416
464
|
const content = await this.fileService.readFile(uri);
|
|
417
465
|
return ( content.value.toString());
|
|
418
|
-
}
|
|
419
|
-
catch (error) {
|
|
466
|
+
} catch (error) {
|
|
420
467
|
this.logService.error(`Failed to read file from ${uri}: ${error}`);
|
|
421
468
|
}
|
|
422
469
|
}
|
|
423
|
-
if (uri.authority !==
|
|
424
|
-
return ( new MarkdownString(( localize(
|
|
470
|
+
if (uri.authority !== "raw.githubusercontent.com") {
|
|
471
|
+
return ( new MarkdownString(( localize(2004, "You can find information about this server [here]({0})", readmeUrl)))).value;
|
|
425
472
|
}
|
|
426
473
|
const context = await this.requestService.request({
|
|
427
|
-
type:
|
|
428
|
-
url: readmeUrl
|
|
474
|
+
type: "GET",
|
|
475
|
+
url: readmeUrl
|
|
429
476
|
}, token);
|
|
430
477
|
const result = await asText(context);
|
|
431
478
|
if (!result) {
|
|
@@ -434,26 +481,25 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
434
481
|
return result;
|
|
435
482
|
}
|
|
436
483
|
toGalleryMcpServer(server, manifest) {
|
|
437
|
-
let publisher =
|
|
484
|
+
let publisher = "";
|
|
438
485
|
let displayName = server.title;
|
|
439
486
|
if (server.githubInfo?.name) {
|
|
440
487
|
if (!displayName) {
|
|
441
|
-
displayName = ( server.githubInfo.name.split(
|
|
442
|
-
s => s.toLowerCase() ===
|
|
443
|
-
)).join(
|
|
488
|
+
displayName = ( server.githubInfo.name.split("-").map(
|
|
489
|
+
s => s.toLowerCase() === "mcp" ? "MCP" : s.toLowerCase() === "github" ? "GitHub" : uppercaseFirstLetter(s)
|
|
490
|
+
)).join(" ");
|
|
444
491
|
}
|
|
445
|
-
publisher = server.githubInfo.nameWithOwner.split(
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
const nameParts = server.name.split('/');
|
|
492
|
+
publisher = server.githubInfo.nameWithOwner.split("/")[0];
|
|
493
|
+
} else {
|
|
494
|
+
const nameParts = server.name.split("/");
|
|
449
495
|
if (nameParts.length > 0) {
|
|
450
|
-
const domainParts = nameParts[0].split(
|
|
496
|
+
const domainParts = nameParts[0].split(".");
|
|
451
497
|
if (domainParts.length > 0) {
|
|
452
498
|
publisher = domainParts[domainParts.length - 1];
|
|
453
499
|
}
|
|
454
500
|
}
|
|
455
501
|
if (!displayName) {
|
|
456
|
-
displayName = ( nameParts[nameParts.length - 1].split(
|
|
502
|
+
displayName = ( nameParts[nameParts.length - 1].split("-").map(s => uppercaseFirstLetter(s))).join(" ");
|
|
457
503
|
}
|
|
458
504
|
}
|
|
459
505
|
if (server.githubInfo?.displayName) {
|
|
@@ -465,22 +511,19 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
465
511
|
light: server.githubInfo.preferredImage,
|
|
466
512
|
dark: server.githubInfo.preferredImage
|
|
467
513
|
};
|
|
468
|
-
}
|
|
469
|
-
else if (server.githubInfo?.ownerAvatarUrl) {
|
|
514
|
+
} else if (server.githubInfo?.ownerAvatarUrl) {
|
|
470
515
|
icon = {
|
|
471
516
|
light: server.githubInfo.ownerAvatarUrl,
|
|
472
517
|
dark: server.githubInfo.ownerAvatarUrl
|
|
473
518
|
};
|
|
474
|
-
}
|
|
475
|
-
else if (server.apicInfo?.['x-ms-icon']) {
|
|
519
|
+
} else if (server.apicInfo?.["x-ms-icon"]) {
|
|
476
520
|
icon = {
|
|
477
|
-
light: server.apicInfo[
|
|
478
|
-
dark: server.apicInfo[
|
|
521
|
+
light: server.apicInfo["x-ms-icon"],
|
|
522
|
+
dark: server.apicInfo["x-ms-icon"]
|
|
479
523
|
};
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
const
|
|
483
|
-
const darkIcon = server.icons.find(icon => icon.theme === 'dark') ?? lightIcon;
|
|
524
|
+
} else if (server.icons && server.icons.length > 0) {
|
|
525
|
+
const lightIcon = server.icons.find(icon => icon.theme === "light") ?? server.icons[0];
|
|
526
|
+
const darkIcon = server.icons.find(icon => icon.theme === "dark") ?? lightIcon;
|
|
484
527
|
icon = {
|
|
485
528
|
light: lightIcon.src,
|
|
486
529
|
dark: darkIcon.src
|
|
@@ -515,7 +558,10 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
515
558
|
};
|
|
516
559
|
}
|
|
517
560
|
async queryGalleryMcpServers(query, mcpGalleryManifest, token) {
|
|
518
|
-
const {
|
|
561
|
+
const {
|
|
562
|
+
servers,
|
|
563
|
+
metadata
|
|
564
|
+
} = await this.queryRawGalleryMcpServers(query, mcpGalleryManifest, token);
|
|
519
565
|
return {
|
|
520
566
|
servers: ( servers.map(item => this.toGalleryMcpServer(item, mcpGalleryManifest))),
|
|
521
567
|
metadata
|
|
@@ -524,7 +570,12 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
524
570
|
async queryRawGalleryMcpServers(query, mcpGalleryManifest, token) {
|
|
525
571
|
const mcpGalleryUrl = this.getMcpGalleryUrl(mcpGalleryManifest);
|
|
526
572
|
if (!mcpGalleryUrl) {
|
|
527
|
-
return {
|
|
573
|
+
return {
|
|
574
|
+
servers: [],
|
|
575
|
+
metadata: {
|
|
576
|
+
count: 0
|
|
577
|
+
}
|
|
578
|
+
};
|
|
528
579
|
}
|
|
529
580
|
const uri = ( URI.parse(mcpGalleryUrl));
|
|
530
581
|
if (uri.scheme === Schemas.file) {
|
|
@@ -532,8 +583,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
532
583
|
const content = await this.fileService.readFile(uri);
|
|
533
584
|
const data = ( content.value.toString());
|
|
534
585
|
return JSON.parse(data);
|
|
535
|
-
}
|
|
536
|
-
catch (error) {
|
|
586
|
+
} catch (error) {
|
|
537
587
|
this.logService.error(`Failed to read file from ${uri}: ${error}`);
|
|
538
588
|
}
|
|
539
589
|
}
|
|
@@ -546,12 +596,17 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
546
596
|
url += `&search=${text}`;
|
|
547
597
|
}
|
|
548
598
|
const context = await this.requestService.request({
|
|
549
|
-
type:
|
|
550
|
-
url
|
|
599
|
+
type: "GET",
|
|
600
|
+
url
|
|
551
601
|
}, token);
|
|
552
602
|
const data = await asJson(context);
|
|
553
603
|
if (!data) {
|
|
554
|
-
return {
|
|
604
|
+
return {
|
|
605
|
+
servers: [],
|
|
606
|
+
metadata: {
|
|
607
|
+
count: 0
|
|
608
|
+
}
|
|
609
|
+
};
|
|
555
610
|
}
|
|
556
611
|
const result = this.serializeMcpServersResult(data, mcpGalleryManifest);
|
|
557
612
|
if (!result) {
|
|
@@ -561,8 +616,8 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
561
616
|
}
|
|
562
617
|
async getMcpServer(mcpServerUrl, mcpGalleryManifest) {
|
|
563
618
|
const context = await this.requestService.request({
|
|
564
|
-
type:
|
|
565
|
-
url: mcpServerUrl
|
|
619
|
+
type: "GET",
|
|
620
|
+
url: mcpServerUrl
|
|
566
621
|
}, CancellationToken.None);
|
|
567
622
|
if (context.res.statusCode && context.res.statusCode >= 400 && context.res.statusCode < 500) {
|
|
568
623
|
return undefined;
|
|
@@ -588,7 +643,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
588
643
|
return this.getSerializer(mcpGalleryManifest)?.toRawGalleryMcpServerResult(data);
|
|
589
644
|
}
|
|
590
645
|
getSerializer(mcpGalleryManifest) {
|
|
591
|
-
const version = mcpGalleryManifest?.version ??
|
|
646
|
+
const version = mcpGalleryManifest?.version ?? "v0";
|
|
592
647
|
return this.galleryMcpServerDataSerializers.get(version);
|
|
593
648
|
}
|
|
594
649
|
getNamedServerUrl(name, mcpGalleryManifest) {
|
|
@@ -596,45 +651,50 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
596
651
|
if (!namedResourceUriTemplate) {
|
|
597
652
|
return undefined;
|
|
598
653
|
}
|
|
599
|
-
return format2(namedResourceUriTemplate, {
|
|
654
|
+
return format2(namedResourceUriTemplate, {
|
|
655
|
+
name
|
|
656
|
+
});
|
|
600
657
|
}
|
|
601
658
|
getServerIdUrl(id, mcpGalleryManifest) {
|
|
602
659
|
const resourceUriTemplate = getMcpGalleryManifestResourceUri(mcpGalleryManifest, McpGalleryResourceType.McpServerIdUri);
|
|
603
660
|
if (!resourceUriTemplate) {
|
|
604
661
|
return undefined;
|
|
605
662
|
}
|
|
606
|
-
return format2(resourceUriTemplate, {
|
|
663
|
+
return format2(resourceUriTemplate, {
|
|
664
|
+
id
|
|
665
|
+
});
|
|
607
666
|
}
|
|
608
667
|
getLatestServerVersionUrl(name, mcpGalleryManifest) {
|
|
609
668
|
const latestVersionResourceUriTemplate = getMcpGalleryManifestResourceUri(mcpGalleryManifest, McpGalleryResourceType.McpServerLatestVersionUri);
|
|
610
669
|
if (!latestVersionResourceUriTemplate) {
|
|
611
670
|
return undefined;
|
|
612
671
|
}
|
|
613
|
-
return format2(latestVersionResourceUriTemplate, {
|
|
672
|
+
return format2(latestVersionResourceUriTemplate, {
|
|
673
|
+
name: encodeURIComponent(name)
|
|
674
|
+
});
|
|
614
675
|
}
|
|
615
676
|
getWebUrl(name, mcpGalleryManifest) {
|
|
616
677
|
const resourceUriTemplate = getMcpGalleryManifestResourceUri(mcpGalleryManifest, McpGalleryResourceType.McpServerWebUri);
|
|
617
678
|
if (!resourceUriTemplate) {
|
|
618
679
|
return undefined;
|
|
619
680
|
}
|
|
620
|
-
return format2(resourceUriTemplate, {
|
|
681
|
+
return format2(resourceUriTemplate, {
|
|
682
|
+
name
|
|
683
|
+
});
|
|
621
684
|
}
|
|
622
685
|
getPublisherUrl(name, mcpGalleryManifest) {
|
|
623
686
|
const resourceUriTemplate = getMcpGalleryManifestResourceUri(mcpGalleryManifest, McpGalleryResourceType.PublisherUriTemplate);
|
|
624
687
|
if (!resourceUriTemplate) {
|
|
625
688
|
return undefined;
|
|
626
689
|
}
|
|
627
|
-
return format2(resourceUriTemplate, {
|
|
690
|
+
return format2(resourceUriTemplate, {
|
|
691
|
+
name
|
|
692
|
+
});
|
|
628
693
|
}
|
|
629
694
|
getMcpGalleryUrl(mcpGalleryManifest) {
|
|
630
695
|
return getMcpGalleryManifestResourceUri(mcpGalleryManifest, McpGalleryResourceType.McpServersQueryService);
|
|
631
696
|
}
|
|
632
697
|
};
|
|
633
|
-
McpGalleryService = ( __decorate([
|
|
634
|
-
( __param(0, IRequestService)),
|
|
635
|
-
( __param(1, IFileService)),
|
|
636
|
-
( __param(2, ILogService)),
|
|
637
|
-
( __param(3, IMcpGalleryManifestService))
|
|
638
|
-
], McpGalleryService));
|
|
698
|
+
McpGalleryService = ( __decorate([( __param(0, IRequestService)), ( __param(1, IFileService)), ( __param(2, ILogService)), ( __param(3, IMcpGalleryManifestService))], McpGalleryService));
|
|
639
699
|
|
|
640
700
|
export { McpGalleryService };
|