@codingame/monaco-vscode-mcp-service-override 22.1.8 → 23.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 +15 -16
- package/vscode/src/vs/platform/mcp/common/allowedMcpServersService.js +1 -1
- package/vscode/src/vs/platform/mcp/common/mcpGalleryManifestService.d.ts +9 -2
- package/vscode/src/vs/platform/mcp/common/mcpGalleryManifestService.js +60 -11
- package/vscode/src/vs/platform/mcp/common/mcpGalleryService.d.ts +11 -9
- package/vscode/src/vs/platform/mcp/common/mcpGalleryService.js +234 -623
- package/vscode/src/vs/platform/mcp/common/mcpManagementIpc.d.ts +5 -4
- package/vscode/src/vs/platform/mcp/common/mcpManagementService.d.ts +1 -1
- package/vscode/src/vs/platform/mcp/common/mcpManagementService.js +9 -4
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcp.contribution.js +6 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpAddContextContribution.js +5 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommands.js +108 -92
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpElicitationService.js +22 -21
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpLanguageFeatures.js +19 -19
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpMigration.js +6 -6
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpResourceQuickAccess.js +8 -9
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.d.ts +85 -22
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.js +347 -96
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +62 -65
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.d.ts +5 -4
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +22 -26
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServersView.js +68 -60
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.d.ts +20 -10
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.js +177 -84
- 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 +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/installedMcpServersDiscovery.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/installedMcpServersDiscovery.js +33 -13
- package/vscode/src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.js +1 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpContextKeys.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpDevMode.js +0 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpIcons.d.ts +12 -1
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpIcons.js +27 -5
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.js +25 -34
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistry.js +12 -12
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingLog.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpSamplingService.js +13 -13
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.js +91 -76
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServerConnection.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.d.ts +7 -7
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpService.js +67 -73
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationMcpService.js +10 -10
- package/vscode/src/vs/workbench/services/mcp/browser/mcpGalleryManifestService.d.ts +3 -1
- package/vscode/src/vs/workbench/services/mcp/browser/mcpGalleryManifestService.js +7 -3
- package/vscode/src/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/mcp/common/mcpWorkbenchManagementService.js +82 -6
|
@@ -9,20 +9,34 @@ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
|
9
9
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
10
10
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
11
11
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
12
|
-
import {
|
|
12
|
+
import { asText, asJson } from '@codingame/monaco-vscode-api/vscode/vs/platform/request/common/request';
|
|
13
13
|
import { IRequestService } from '@codingame/monaco-vscode-api/vscode/vs/platform/request/common/request.service';
|
|
14
14
|
import { TransportType, RegistryType, GalleryMcpServerStatus } from '@codingame/monaco-vscode-dc3fa21d-a483-5b99-a7ab-173235644a34-common/vscode/vs/platform/mcp/common/mcpManagement';
|
|
15
15
|
import { McpGalleryManifestStatus, getMcpGalleryManifestResourceUri, McpGalleryResourceType } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpGalleryManifest';
|
|
16
16
|
import { IMcpGalleryManifestService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpGalleryManifest.service';
|
|
17
|
-
import { singlePagePager, PageIteratorPager } from '@codingame/monaco-vscode-62190c26-af1c-5f7a-a364-e05a59cfb7c7-common/vscode/vs/base/common/paging';
|
|
18
17
|
import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
19
|
-
import {
|
|
18
|
+
import { isString, isObject } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
20
19
|
|
|
21
|
-
var
|
|
22
|
-
(function (
|
|
20
|
+
var IconMimeType;
|
|
21
|
+
(function (IconMimeType) {
|
|
22
|
+
IconMimeType["PNG"] = "image/png";
|
|
23
|
+
IconMimeType["JPEG"] = "image/jpeg";
|
|
24
|
+
IconMimeType["JPG"] = "image/jpg";
|
|
25
|
+
IconMimeType["SVG"] = "image/svg+xml";
|
|
26
|
+
IconMimeType["WEBP"] = "image/webp";
|
|
27
|
+
})(IconMimeType || (IconMimeType = {}));
|
|
28
|
+
var IconTheme;
|
|
29
|
+
(function (IconTheme) {
|
|
30
|
+
IconTheme["LIGHT"] = "light";
|
|
31
|
+
IconTheme["DARK"] = "dark";
|
|
32
|
+
})(IconTheme || (IconTheme = {}));
|
|
33
|
+
var McpServerSchemaVersion_v2025_07_09;
|
|
34
|
+
(function (McpServerSchemaVersion_v2025_07_09) {
|
|
35
|
+
McpServerSchemaVersion_v2025_07_09.VERSION = 'v0-2025-07-09';
|
|
36
|
+
McpServerSchemaVersion_v2025_07_09.SCHEMA = `https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json`;
|
|
23
37
|
class Serializer {
|
|
24
38
|
toRawGalleryMcpServerResult(input) {
|
|
25
|
-
if (!input || !Array.isArray(input.servers)) {
|
|
39
|
+
if (!input || typeof input !== 'object' || !Array.isArray(input.servers)) {
|
|
26
40
|
return undefined;
|
|
27
41
|
}
|
|
28
42
|
const from = input;
|
|
@@ -35,167 +49,27 @@ var McpServerOldSchema;
|
|
|
35
49
|
servers.push(rawServer);
|
|
36
50
|
}
|
|
37
51
|
return {
|
|
38
|
-
metadata:
|
|
52
|
+
metadata: {
|
|
53
|
+
count: from.metadata.count ?? 0,
|
|
54
|
+
nextCursor: from.metadata?.next_cursor
|
|
55
|
+
},
|
|
39
56
|
servers
|
|
40
57
|
};
|
|
41
58
|
}
|
|
42
59
|
toRawGalleryMcpServer(input) {
|
|
43
|
-
if (!input ||
|
|
60
|
+
if (!input || typeof input !== 'object') {
|
|
44
61
|
return undefined;
|
|
45
62
|
}
|
|
46
63
|
const from = input;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
...input,
|
|
51
|
-
isRequired: input.is_required,
|
|
52
|
-
isSecret: input.is_secret,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function convertVariables(variables) {
|
|
56
|
-
const result = {};
|
|
57
|
-
for (const [key, value] of Object.entries(variables)) {
|
|
58
|
-
result[key] = convertServerInput(value);
|
|
59
|
-
}
|
|
60
|
-
return result;
|
|
61
|
-
}
|
|
62
|
-
function convertServerArgument(arg) {
|
|
63
|
-
if (arg.type === 'positional') {
|
|
64
|
-
return {
|
|
65
|
-
...arg,
|
|
66
|
-
valueHint: arg.value_hint,
|
|
67
|
-
isRepeated: arg.is_repeated,
|
|
68
|
-
isRequired: arg.is_required,
|
|
69
|
-
isSecret: arg.is_secret,
|
|
70
|
-
variables: arg.variables ? convertVariables(arg.variables) : undefined,
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
...arg,
|
|
75
|
-
isRepeated: arg.is_repeated,
|
|
76
|
-
isRequired: arg.is_required,
|
|
77
|
-
isSecret: arg.is_secret,
|
|
78
|
-
variables: arg.variables ? convertVariables(arg.variables) : undefined,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
function convertKeyValueInput(input) {
|
|
82
|
-
return {
|
|
83
|
-
...input,
|
|
84
|
-
isRequired: input.is_required,
|
|
85
|
-
isSecret: input.is_secret,
|
|
86
|
-
variables: input.variables ? convertVariables(input.variables) : undefined,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function convertTransport(input) {
|
|
90
|
-
switch (input.type) {
|
|
91
|
-
case 'stdio':
|
|
92
|
-
return {
|
|
93
|
-
type: TransportType.STDIO,
|
|
94
|
-
};
|
|
95
|
-
case 'streamable-http':
|
|
96
|
-
return {
|
|
97
|
-
type: TransportType.STREAMABLE_HTTP,
|
|
98
|
-
url: input.url,
|
|
99
|
-
headers: input.headers?.map(convertKeyValueInput),
|
|
100
|
-
};
|
|
101
|
-
case 'sse':
|
|
102
|
-
return {
|
|
103
|
-
type: TransportType.SSE,
|
|
104
|
-
url: input.url,
|
|
105
|
-
headers: input.headers?.map(convertKeyValueInput),
|
|
106
|
-
};
|
|
107
|
-
default:
|
|
108
|
-
return undefined;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
function convertRegistryType(input) {
|
|
112
|
-
switch (input) {
|
|
113
|
-
case 'npm':
|
|
114
|
-
return RegistryType.NODE;
|
|
115
|
-
case 'docker':
|
|
116
|
-
case 'docker-hub':
|
|
117
|
-
case 'oci':
|
|
118
|
-
return RegistryType.DOCKER;
|
|
119
|
-
case 'pypi':
|
|
120
|
-
return RegistryType.PYTHON;
|
|
121
|
-
case 'nuget':
|
|
122
|
-
return RegistryType.NUGET;
|
|
123
|
-
case 'mcpb':
|
|
124
|
-
return RegistryType.MCPB;
|
|
125
|
-
default:
|
|
126
|
-
return RegistryType.NODE;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return {
|
|
130
|
-
name: from.server.name,
|
|
131
|
-
description: from.server.description,
|
|
132
|
-
repository: from.server.repository ? {
|
|
133
|
-
url: from.server.repository.url,
|
|
134
|
-
source: from.server.repository.source,
|
|
135
|
-
id: from.server.repository.id,
|
|
136
|
-
readme: from.server.repository.readme
|
|
137
|
-
} : undefined,
|
|
138
|
-
version: from.server.version_detail.version,
|
|
139
|
-
createdAt: from.server.created_at,
|
|
140
|
-
updatedAt: from.server.updated_at,
|
|
141
|
-
packages: from.server.packages?.map(p => ({
|
|
142
|
-
identifier: p.identifier ?? p.name,
|
|
143
|
-
registryType: convertRegistryType(p.registry_type ?? p.registry_name),
|
|
144
|
-
version: p.version,
|
|
145
|
-
fileSha256: p.file_sha256,
|
|
146
|
-
registryBaseUrl: p.registry_base_url,
|
|
147
|
-
transport: p.transport ? convertTransport(p.transport) : undefined,
|
|
148
|
-
packageArguments: p.package_arguments?.map(convertServerArgument),
|
|
149
|
-
runtimeHint: p.runtime_hint,
|
|
150
|
-
runtimeArguments: p.runtime_arguments?.map(convertServerArgument),
|
|
151
|
-
environmentVariables: p.environment_variables?.map(convertKeyValueInput),
|
|
152
|
-
})),
|
|
153
|
-
remotes: from.server.remotes?.map(remote => {
|
|
154
|
-
const type = remote.type ?? remote.transport_type ?? remote.transport;
|
|
155
|
-
return {
|
|
156
|
-
type: type === TransportType.SSE ? TransportType.SSE : TransportType.STREAMABLE_HTTP,
|
|
157
|
-
url: remote.url,
|
|
158
|
-
headers: remote.headers?.map(convertKeyValueInput)
|
|
159
|
-
};
|
|
160
|
-
}),
|
|
161
|
-
registryInfo: {
|
|
162
|
-
id: registryInfo.id,
|
|
163
|
-
isLatest: registryInfo.is_latest,
|
|
164
|
-
publishedAt: registryInfo.published_at,
|
|
165
|
-
updatedAt: registryInfo.updated_at,
|
|
166
|
-
},
|
|
167
|
-
githubInfo: from['x-github'],
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
McpServerOldSchema.SERIALIZER = ( new Serializer());
|
|
172
|
-
})(McpServerOldSchema || (McpServerOldSchema = {}));
|
|
173
|
-
var McpServer1ESSchema;
|
|
174
|
-
(function (McpServer1ESSchema) {
|
|
175
|
-
class Serializer {
|
|
176
|
-
toRawGalleryMcpServerResult(input) {
|
|
177
|
-
if (!input || !Array.isArray(input.servers)) {
|
|
64
|
+
if ((!from.name || !isString(from.name))
|
|
65
|
+
|| (!from.description || !isString(from.description))
|
|
66
|
+
|| (!from.version || !isString(from.version))) {
|
|
178
67
|
return undefined;
|
|
179
68
|
}
|
|
180
|
-
|
|
181
|
-
const servers = [];
|
|
182
|
-
for (const server of from.servers) {
|
|
183
|
-
const rawServer = this.toRawGalleryMcpServer(server);
|
|
184
|
-
if (!rawServer) {
|
|
185
|
-
return undefined;
|
|
186
|
-
}
|
|
187
|
-
servers.push(rawServer);
|
|
188
|
-
}
|
|
189
|
-
return {
|
|
190
|
-
metadata: from.metadata,
|
|
191
|
-
servers
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
toRawGalleryMcpServer(input) {
|
|
195
|
-
if (!input || input.server || input.$schema) {
|
|
69
|
+
if (from.$schema && from.$schema !== McpServerSchemaVersion_v2025_07_09.SCHEMA) {
|
|
196
70
|
return undefined;
|
|
197
71
|
}
|
|
198
|
-
const
|
|
72
|
+
const registryInfo = from._meta?.['io.modelcontextprotocol.registry/official'];
|
|
199
73
|
function convertServerInput(input) {
|
|
200
74
|
return {
|
|
201
75
|
...input,
|
|
@@ -256,159 +130,9 @@ var McpServer1ESSchema;
|
|
|
256
130
|
headers: input.headers?.map(convertKeyValueInput),
|
|
257
131
|
};
|
|
258
132
|
default:
|
|
259
|
-
return undefined;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
function convertRegistryType(input) {
|
|
263
|
-
switch (input) {
|
|
264
|
-
case 'npm':
|
|
265
|
-
return RegistryType.NODE;
|
|
266
|
-
case 'docker':
|
|
267
|
-
case 'docker-hub':
|
|
268
|
-
case 'oci':
|
|
269
|
-
return RegistryType.DOCKER;
|
|
270
|
-
case 'pypi':
|
|
271
|
-
return RegistryType.PYTHON;
|
|
272
|
-
case 'nuget':
|
|
273
|
-
return RegistryType.NUGET;
|
|
274
|
-
case 'mcpb':
|
|
275
|
-
return RegistryType.MCPB;
|
|
276
|
-
default:
|
|
277
|
-
return RegistryType.NODE;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
return {
|
|
281
|
-
name: from.name,
|
|
282
|
-
description: from.description,
|
|
283
|
-
repository: from.repository ? {
|
|
284
|
-
url: from.repository.url,
|
|
285
|
-
source: from.repository.source,
|
|
286
|
-
id: from.repository.id,
|
|
287
|
-
readme: from.repository.readme
|
|
288
|
-
} : undefined,
|
|
289
|
-
version: from.version_detail.version,
|
|
290
|
-
createdAt: from.created_at,
|
|
291
|
-
updatedAt: from.updated_at,
|
|
292
|
-
packages: from.packages?.map(p => ({
|
|
293
|
-
identifier: p.identifier ?? p.name,
|
|
294
|
-
registryType: convertRegistryType(p.registry_type ?? p.registry_name),
|
|
295
|
-
version: p.version,
|
|
296
|
-
fileSha256: p.file_sha256,
|
|
297
|
-
registryBaseUrl: p.registry_base_url,
|
|
298
|
-
transport: p.transport ? convertTransport(p.transport) : undefined,
|
|
299
|
-
packageArguments: p.package_arguments?.map(convertServerArgument),
|
|
300
|
-
runtimeHint: p.runtime_hint,
|
|
301
|
-
runtimeArguments: p.runtime_arguments?.map(convertServerArgument),
|
|
302
|
-
environmentVariables: p.environment_variables?.map(convertKeyValueInput),
|
|
303
|
-
})),
|
|
304
|
-
remotes: from.remotes?.map(remote => {
|
|
305
|
-
const type = remote.type ?? remote.transport_type ?? remote.transport;
|
|
306
|
-
return {
|
|
307
|
-
type: type === TransportType.SSE ? TransportType.SSE : TransportType.STREAMABLE_HTTP,
|
|
308
|
-
url: remote.url,
|
|
309
|
-
headers: remote.headers?.map(convertKeyValueInput)
|
|
310
|
-
};
|
|
311
|
-
}),
|
|
312
|
-
registryInfo: {
|
|
313
|
-
id: from.id,
|
|
314
|
-
isLatest: true,
|
|
315
|
-
updatedAt: from.updated_at,
|
|
316
|
-
},
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
McpServer1ESSchema.SERIALIZER = ( new Serializer());
|
|
321
|
-
})(McpServer1ESSchema || (McpServer1ESSchema = {}));
|
|
322
|
-
var McpServerSchemaVersion_2025_01_09;
|
|
323
|
-
(function (McpServerSchemaVersion_2025_01_09) {
|
|
324
|
-
McpServerSchemaVersion_2025_01_09.VERSION = '2025-09-01';
|
|
325
|
-
McpServerSchemaVersion_2025_01_09.SCHEMA = `https://static.modelcontextprotocol.io/schemas/${McpServerSchemaVersion_2025_01_09.VERSION}/server.schema.json`;
|
|
326
|
-
class Serializer {
|
|
327
|
-
toRawGalleryMcpServerResult(input) {
|
|
328
|
-
if (!input || !Array.isArray(input.servers)) {
|
|
329
|
-
return undefined;
|
|
330
|
-
}
|
|
331
|
-
const from = input;
|
|
332
|
-
const servers = [];
|
|
333
|
-
for (const server of from.servers) {
|
|
334
|
-
const rawServer = this.toRawGalleryMcpServer(server);
|
|
335
|
-
if (!rawServer) {
|
|
336
|
-
return undefined;
|
|
337
|
-
}
|
|
338
|
-
servers.push(rawServer);
|
|
339
|
-
}
|
|
340
|
-
return {
|
|
341
|
-
metadata: from.metadata,
|
|
342
|
-
servers
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
toRawGalleryMcpServer(input) {
|
|
346
|
-
if (!input || input.$schema !== McpServerSchemaVersion_2025_01_09.SCHEMA) {
|
|
347
|
-
return undefined;
|
|
348
|
-
}
|
|
349
|
-
const from = input;
|
|
350
|
-
const registryInfo = from._meta?.['io.modelcontextprotocol.registry'];
|
|
351
|
-
function convertServerInput(input) {
|
|
352
|
-
return {
|
|
353
|
-
...input,
|
|
354
|
-
isRequired: input.is_required,
|
|
355
|
-
isSecret: input.is_secret,
|
|
356
|
-
};
|
|
357
|
-
}
|
|
358
|
-
function convertVariables(variables) {
|
|
359
|
-
const result = {};
|
|
360
|
-
for (const [key, value] of Object.entries(variables)) {
|
|
361
|
-
result[key] = convertServerInput(value);
|
|
362
|
-
}
|
|
363
|
-
return result;
|
|
364
|
-
}
|
|
365
|
-
function convertServerArgument(arg) {
|
|
366
|
-
if (arg.type === 'positional') {
|
|
367
|
-
return {
|
|
368
|
-
...arg,
|
|
369
|
-
valueHint: arg.value_hint,
|
|
370
|
-
isRepeated: arg.is_repeated,
|
|
371
|
-
isRequired: arg.is_required,
|
|
372
|
-
isSecret: arg.is_secret,
|
|
373
|
-
variables: arg.variables ? convertVariables(arg.variables) : undefined,
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
return {
|
|
377
|
-
...arg,
|
|
378
|
-
isRepeated: arg.is_repeated,
|
|
379
|
-
isRequired: arg.is_required,
|
|
380
|
-
isSecret: arg.is_secret,
|
|
381
|
-
variables: arg.variables ? convertVariables(arg.variables) : undefined,
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
function convertKeyValueInput(input) {
|
|
385
|
-
return {
|
|
386
|
-
...input,
|
|
387
|
-
isRequired: input.is_required,
|
|
388
|
-
isSecret: input.is_secret,
|
|
389
|
-
variables: input.variables ? convertVariables(input.variables) : undefined,
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
function convertTransport(input) {
|
|
393
|
-
switch (input.type) {
|
|
394
|
-
case 'stdio':
|
|
395
133
|
return {
|
|
396
134
|
type: TransportType.STDIO,
|
|
397
135
|
};
|
|
398
|
-
case 'streamable-http':
|
|
399
|
-
return {
|
|
400
|
-
type: TransportType.STREAMABLE_HTTP,
|
|
401
|
-
url: input.url,
|
|
402
|
-
headers: input.headers?.map(convertKeyValueInput),
|
|
403
|
-
};
|
|
404
|
-
case 'sse':
|
|
405
|
-
return {
|
|
406
|
-
type: TransportType.SSE,
|
|
407
|
-
url: input.url,
|
|
408
|
-
headers: input.headers?.map(convertKeyValueInput),
|
|
409
|
-
};
|
|
410
|
-
default:
|
|
411
|
-
return undefined;
|
|
412
136
|
}
|
|
413
137
|
}
|
|
414
138
|
function convertRegistryType(input) {
|
|
@@ -429,16 +153,18 @@ var McpServerSchemaVersion_2025_01_09;
|
|
|
429
153
|
return RegistryType.NODE;
|
|
430
154
|
}
|
|
431
155
|
}
|
|
156
|
+
const gitHubInfo = from._meta['io.modelcontextprotocol.registry/publisher-provided']?.github;
|
|
432
157
|
return {
|
|
158
|
+
id: registryInfo.id,
|
|
433
159
|
name: from.name,
|
|
434
160
|
description: from.description,
|
|
435
161
|
repository: from.repository ? {
|
|
436
162
|
url: from.repository.url,
|
|
437
163
|
source: from.repository.source,
|
|
438
164
|
id: from.repository.id,
|
|
439
|
-
readme: from.repository.readme
|
|
440
165
|
} : undefined,
|
|
441
|
-
|
|
166
|
+
readme: from.repository?.readme,
|
|
167
|
+
version: from.version,
|
|
442
168
|
createdAt: from.created_at,
|
|
443
169
|
updatedAt: from.updated_at,
|
|
444
170
|
packages: from.packages?.map(p => ({
|
|
@@ -447,7 +173,7 @@ var McpServerSchemaVersion_2025_01_09;
|
|
|
447
173
|
version: p.version,
|
|
448
174
|
fileSha256: p.file_sha256,
|
|
449
175
|
registryBaseUrl: p.registry_base_url,
|
|
450
|
-
transport: p.transport ? convertTransport(p.transport) :
|
|
176
|
+
transport: p.transport ? convertTransport(p.transport) : { type: TransportType.STDIO },
|
|
451
177
|
packageArguments: p.package_arguments?.map(convertServerArgument),
|
|
452
178
|
runtimeHint: p.runtime_hint,
|
|
453
179
|
runtimeArguments: p.runtime_arguments?.map(convertServerArgument),
|
|
@@ -462,24 +188,37 @@ var McpServerSchemaVersion_2025_01_09;
|
|
|
462
188
|
};
|
|
463
189
|
}),
|
|
464
190
|
registryInfo: {
|
|
465
|
-
id: registryInfo.id,
|
|
466
191
|
isLatest: registryInfo.is_latest,
|
|
467
192
|
publishedAt: registryInfo.published_at,
|
|
468
193
|
updatedAt: registryInfo.updated_at,
|
|
469
194
|
},
|
|
470
|
-
githubInfo:
|
|
195
|
+
githubInfo: gitHubInfo ? {
|
|
196
|
+
name: gitHubInfo.name,
|
|
197
|
+
nameWithOwner: gitHubInfo.name_with_owner,
|
|
198
|
+
displayName: gitHubInfo.display_name,
|
|
199
|
+
isInOrganization: gitHubInfo.is_in_organization,
|
|
200
|
+
license: gitHubInfo.license,
|
|
201
|
+
opengraphImageUrl: gitHubInfo.opengraph_image_url,
|
|
202
|
+
ownerAvatarUrl: gitHubInfo.owner_avatar_url,
|
|
203
|
+
primaryLanguage: gitHubInfo.primary_language,
|
|
204
|
+
primaryLanguageColor: gitHubInfo.primary_language_color,
|
|
205
|
+
pushedAt: gitHubInfo.pushed_at,
|
|
206
|
+
stargazerCount: gitHubInfo.stargazer_count,
|
|
207
|
+
topics: gitHubInfo.topics,
|
|
208
|
+
usesCustomOpengraphImage: gitHubInfo.uses_custom_opengraph_image
|
|
209
|
+
} : undefined
|
|
471
210
|
};
|
|
472
211
|
}
|
|
473
212
|
}
|
|
474
|
-
|
|
475
|
-
})(
|
|
476
|
-
var
|
|
477
|
-
(function (
|
|
478
|
-
|
|
479
|
-
|
|
213
|
+
McpServerSchemaVersion_v2025_07_09.SERIALIZER = ( new Serializer());
|
|
214
|
+
})(McpServerSchemaVersion_v2025_07_09 || (McpServerSchemaVersion_v2025_07_09 = {}));
|
|
215
|
+
var McpServerSchemaVersion_v0_1;
|
|
216
|
+
(function (McpServerSchemaVersion_v0_1) {
|
|
217
|
+
McpServerSchemaVersion_v0_1.VERSION = 'v0.1';
|
|
218
|
+
McpServerSchemaVersion_v0_1.SCHEMA = `https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json`;
|
|
480
219
|
class Serializer {
|
|
481
220
|
toRawGalleryMcpServerResult(input) {
|
|
482
|
-
if (!input || !Array.isArray(input.servers)) {
|
|
221
|
+
if (!input || typeof input !== 'object' || !Array.isArray(input.servers)) {
|
|
483
222
|
return undefined;
|
|
484
223
|
}
|
|
485
224
|
const from = input;
|
|
@@ -487,7 +226,12 @@ var McpServerSchemaVersion_2025_07_09;
|
|
|
487
226
|
for (const server of from.servers) {
|
|
488
227
|
const rawServer = this.toRawGalleryMcpServer(server);
|
|
489
228
|
if (!rawServer) {
|
|
490
|
-
|
|
229
|
+
if (servers.length === 0) {
|
|
230
|
+
return undefined;
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
491
235
|
}
|
|
492
236
|
servers.push(rawServer);
|
|
493
237
|
}
|
|
@@ -497,187 +241,75 @@ var McpServerSchemaVersion_2025_07_09;
|
|
|
497
241
|
};
|
|
498
242
|
}
|
|
499
243
|
toRawGalleryMcpServer(input) {
|
|
500
|
-
if (!input || input
|
|
244
|
+
if (!input || typeof input !== 'object') {
|
|
501
245
|
return undefined;
|
|
502
246
|
}
|
|
503
247
|
const from = input;
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
isSecret: input.is_secret,
|
|
510
|
-
};
|
|
511
|
-
}
|
|
512
|
-
function convertVariables(variables) {
|
|
513
|
-
const result = {};
|
|
514
|
-
for (const [key, value] of Object.entries(variables)) {
|
|
515
|
-
result[key] = convertServerInput(value);
|
|
516
|
-
}
|
|
517
|
-
return result;
|
|
518
|
-
}
|
|
519
|
-
function convertServerArgument(arg) {
|
|
520
|
-
if (arg.type === 'positional') {
|
|
521
|
-
return {
|
|
522
|
-
...arg,
|
|
523
|
-
valueHint: arg.value_hint,
|
|
524
|
-
isRepeated: arg.is_repeated,
|
|
525
|
-
isRequired: arg.is_required,
|
|
526
|
-
isSecret: arg.is_secret,
|
|
527
|
-
variables: arg.variables ? convertVariables(arg.variables) : undefined,
|
|
528
|
-
};
|
|
529
|
-
}
|
|
530
|
-
return {
|
|
531
|
-
...arg,
|
|
532
|
-
isRepeated: arg.is_repeated,
|
|
533
|
-
isRequired: arg.is_required,
|
|
534
|
-
isSecret: arg.is_secret,
|
|
535
|
-
variables: arg.variables ? convertVariables(arg.variables) : undefined,
|
|
536
|
-
};
|
|
537
|
-
}
|
|
538
|
-
function convertKeyValueInput(input) {
|
|
539
|
-
return {
|
|
540
|
-
...input,
|
|
541
|
-
isRequired: input.is_required,
|
|
542
|
-
isSecret: input.is_secret,
|
|
543
|
-
variables: input.variables ? convertVariables(input.variables) : undefined,
|
|
544
|
-
};
|
|
545
|
-
}
|
|
546
|
-
function convertTransport(input) {
|
|
547
|
-
switch (input.type) {
|
|
548
|
-
case 'stdio':
|
|
549
|
-
return {
|
|
550
|
-
type: TransportType.STDIO,
|
|
551
|
-
};
|
|
552
|
-
case 'streamable-http':
|
|
553
|
-
return {
|
|
554
|
-
type: TransportType.STREAMABLE_HTTP,
|
|
555
|
-
url: input.url,
|
|
556
|
-
headers: input.headers?.map(convertKeyValueInput),
|
|
557
|
-
};
|
|
558
|
-
case 'sse':
|
|
559
|
-
return {
|
|
560
|
-
type: TransportType.SSE,
|
|
561
|
-
url: input.url,
|
|
562
|
-
headers: input.headers?.map(convertKeyValueInput),
|
|
563
|
-
};
|
|
564
|
-
default:
|
|
565
|
-
return undefined;
|
|
566
|
-
}
|
|
248
|
+
if ((!from.server || !isObject(from.server))
|
|
249
|
+
|| (!from.server.name || !isString(from.server.name))
|
|
250
|
+
|| (!from.server.description || !isString(from.server.description))
|
|
251
|
+
|| (!from.server.version || !isString(from.server.version))) {
|
|
252
|
+
return undefined;
|
|
567
253
|
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
case 'npm':
|
|
571
|
-
return RegistryType.NODE;
|
|
572
|
-
case 'docker':
|
|
573
|
-
case 'docker-hub':
|
|
574
|
-
case 'oci':
|
|
575
|
-
return RegistryType.DOCKER;
|
|
576
|
-
case 'pypi':
|
|
577
|
-
return RegistryType.PYTHON;
|
|
578
|
-
case 'nuget':
|
|
579
|
-
return RegistryType.NUGET;
|
|
580
|
-
case 'mcpb':
|
|
581
|
-
return RegistryType.MCPB;
|
|
582
|
-
default:
|
|
583
|
-
return RegistryType.NODE;
|
|
584
|
-
}
|
|
254
|
+
if (from.server.$schema && from.server.$schema !== McpServerSchemaVersion_v0_1.SCHEMA) {
|
|
255
|
+
return undefined;
|
|
585
256
|
}
|
|
257
|
+
const { 'io.modelcontextprotocol.registry/official': registryInfo, ...apicInfo } = from._meta;
|
|
258
|
+
const githubInfo = from.server._meta?.['io.modelcontextprotocol.registry/publisher-provided']?.github;
|
|
586
259
|
return {
|
|
587
|
-
name: from.name,
|
|
588
|
-
description: from.description,
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
260
|
+
name: from.server.name,
|
|
261
|
+
description: from.server.description,
|
|
262
|
+
version: from.server.version,
|
|
263
|
+
title: from.server.title,
|
|
264
|
+
repository: from.server.repository ? {
|
|
265
|
+
url: from.server.repository.url,
|
|
266
|
+
source: from.server.repository.source,
|
|
267
|
+
id: from.server.repository.id,
|
|
594
268
|
} : undefined,
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
packages: from.packages
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
transport: p.transport ? convertTransport(p.transport) : undefined,
|
|
605
|
-
packageArguments: p.package_arguments?.map(convertServerArgument),
|
|
606
|
-
runtimeHint: p.runtime_hint,
|
|
607
|
-
runtimeArguments: p.runtime_arguments?.map(convertServerArgument),
|
|
608
|
-
environmentVariables: p.environment_variables?.map(convertKeyValueInput),
|
|
609
|
-
})),
|
|
610
|
-
remotes: from.remotes?.map(remote => {
|
|
611
|
-
const type = remote.type ?? remote.transport_type ?? remote.transport;
|
|
612
|
-
return {
|
|
613
|
-
type: type === TransportType.SSE ? TransportType.SSE : TransportType.STREAMABLE_HTTP,
|
|
614
|
-
url: remote.url,
|
|
615
|
-
headers: remote.headers?.map(convertKeyValueInput)
|
|
616
|
-
};
|
|
617
|
-
}),
|
|
618
|
-
registryInfo: {
|
|
619
|
-
id: registryInfo.id,
|
|
620
|
-
isLatest: registryInfo.is_latest,
|
|
621
|
-
publishedAt: registryInfo.published_at,
|
|
622
|
-
updatedAt: registryInfo.updated_at,
|
|
623
|
-
},
|
|
624
|
-
githubInfo: from._meta['io.modelcontextprotocol.registry/publisher-provided']?.github,
|
|
269
|
+
readme: githubInfo?.readme,
|
|
270
|
+
icons: from.server.icons,
|
|
271
|
+
websiteUrl: from.server.websiteUrl,
|
|
272
|
+
packages: from.server.packages,
|
|
273
|
+
remotes: from.server.remotes,
|
|
274
|
+
status: registryInfo?.status,
|
|
275
|
+
registryInfo,
|
|
276
|
+
githubInfo,
|
|
277
|
+
apicInfo
|
|
625
278
|
};
|
|
626
279
|
}
|
|
627
280
|
}
|
|
628
|
-
|
|
629
|
-
})(
|
|
630
|
-
var
|
|
631
|
-
(function (
|
|
632
|
-
|
|
633
|
-
McpServerSchemaVersion_2025_16_09.SCHEMA = `https://static.modelcontextprotocol.io/schemas/${McpServerSchemaVersion_2025_16_09.VERSION}/server.schema.json`;
|
|
281
|
+
McpServerSchemaVersion_v0_1.SERIALIZER = ( new Serializer());
|
|
282
|
+
})(McpServerSchemaVersion_v0_1 || (McpServerSchemaVersion_v0_1 = {}));
|
|
283
|
+
var McpServerSchemaVersion_v0;
|
|
284
|
+
(function (McpServerSchemaVersion_v0) {
|
|
285
|
+
McpServerSchemaVersion_v0.VERSION = 'v0';
|
|
634
286
|
class Serializer {
|
|
287
|
+
constructor() {
|
|
288
|
+
this.galleryMcpServerDataSerializers = [];
|
|
289
|
+
this.galleryMcpServerDataSerializers.push(McpServerSchemaVersion_v0_1.SERIALIZER);
|
|
290
|
+
this.galleryMcpServerDataSerializers.push(McpServerSchemaVersion_v2025_07_09.SERIALIZER);
|
|
291
|
+
}
|
|
635
292
|
toRawGalleryMcpServerResult(input) {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
const servers = [];
|
|
641
|
-
for (const server of from.servers) {
|
|
642
|
-
const rawServer = this.toRawGalleryMcpServer(server);
|
|
643
|
-
if (!rawServer) {
|
|
644
|
-
return undefined;
|
|
293
|
+
for (const serializer of this.galleryMcpServerDataSerializers) {
|
|
294
|
+
const result = serializer.toRawGalleryMcpServerResult(input);
|
|
295
|
+
if (result) {
|
|
296
|
+
return result;
|
|
645
297
|
}
|
|
646
|
-
servers.push(rawServer);
|
|
647
298
|
}
|
|
648
|
-
return
|
|
649
|
-
metadata: from.metadata,
|
|
650
|
-
servers
|
|
651
|
-
};
|
|
299
|
+
return undefined;
|
|
652
300
|
}
|
|
653
301
|
toRawGalleryMcpServer(input) {
|
|
654
|
-
|
|
655
|
-
|
|
302
|
+
for (const serializer of this.galleryMcpServerDataSerializers) {
|
|
303
|
+
const result = serializer.toRawGalleryMcpServer(input);
|
|
304
|
+
if (result) {
|
|
305
|
+
return result;
|
|
306
|
+
}
|
|
656
307
|
}
|
|
657
|
-
|
|
658
|
-
return {
|
|
659
|
-
name: from.name,
|
|
660
|
-
description: from.description,
|
|
661
|
-
repository: from.repository ? {
|
|
662
|
-
url: from.repository.url,
|
|
663
|
-
source: from.repository.source,
|
|
664
|
-
id: from.repository.id,
|
|
665
|
-
readme: from.repository.readme
|
|
666
|
-
} : undefined,
|
|
667
|
-
version: from.version,
|
|
668
|
-
status: from.status,
|
|
669
|
-
websiteUrl: from.websiteUrl,
|
|
670
|
-
createdAt: from.createdAt,
|
|
671
|
-
updatedAt: from.updatedAt,
|
|
672
|
-
packages: from.packages,
|
|
673
|
-
remotes: from.remotes,
|
|
674
|
-
registryInfo: from._meta?.['io.modelcontextprotocol.registry/official'],
|
|
675
|
-
githubInfo: from._meta['io.modelcontextprotocol.registry/publisher-provided']?.github,
|
|
676
|
-
};
|
|
308
|
+
return undefined;
|
|
677
309
|
}
|
|
678
310
|
}
|
|
679
|
-
|
|
680
|
-
})(
|
|
311
|
+
McpServerSchemaVersion_v0.SERIALIZER = ( new Serializer());
|
|
312
|
+
})(McpServerSchemaVersion_v0 || (McpServerSchemaVersion_v0 = {}));
|
|
681
313
|
const DefaultPageSize = 50;
|
|
682
314
|
const DefaultQueryState = {
|
|
683
315
|
pageSize: DefaultPageSize,
|
|
@@ -704,11 +336,8 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
704
336
|
this.logService = logService;
|
|
705
337
|
this.mcpGalleryManifestService = mcpGalleryManifestService;
|
|
706
338
|
this.galleryMcpServerDataSerializers = ( new Map());
|
|
707
|
-
this.galleryMcpServerDataSerializers.set(
|
|
708
|
-
this.galleryMcpServerDataSerializers.set(
|
|
709
|
-
this.galleryMcpServerDataSerializers.set('old', McpServerOldSchema.SERIALIZER);
|
|
710
|
-
this.galleryMcpServerDataSerializers.set('1es', McpServer1ESSchema.SERIALIZER);
|
|
711
|
-
this.galleryMcpServerDataSerializers.set(McpServerSchemaVersion_2025_16_09.VERSION, McpServerSchemaVersion_2025_16_09.SERIALIZER);
|
|
339
|
+
this.galleryMcpServerDataSerializers.set(McpServerSchemaVersion_v0.VERSION, McpServerSchemaVersion_v0.SERIALIZER);
|
|
340
|
+
this.galleryMcpServerDataSerializers.set(McpServerSchemaVersion_v0_1.VERSION, McpServerSchemaVersion_v0_1.SERIALIZER);
|
|
712
341
|
}
|
|
713
342
|
isEnabled() {
|
|
714
343
|
return this.mcpGalleryManifestService.mcpGalleryManifestStatus === McpGalleryManifestStatus.Available;
|
|
@@ -716,80 +345,74 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
716
345
|
async query(options, token = CancellationToken.None) {
|
|
717
346
|
const mcpGalleryManifest = await this.mcpGalleryManifestService.getMcpGalleryManifest();
|
|
718
347
|
if (!mcpGalleryManifest) {
|
|
719
|
-
return
|
|
348
|
+
return {
|
|
349
|
+
firstPage: { items: [], hasMore: false },
|
|
350
|
+
getNextPage: async () => ({ items: [], hasMore: false })
|
|
351
|
+
};
|
|
720
352
|
}
|
|
721
353
|
let query = ( new Query());
|
|
722
354
|
if (options?.text) {
|
|
723
355
|
query = query.withSearchText(options.text.trim());
|
|
724
356
|
}
|
|
725
357
|
const { servers, metadata } = await this.queryGalleryMcpServers(query, mcpGalleryManifest, token);
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
358
|
+
let currentCursor = metadata.nextCursor;
|
|
359
|
+
return {
|
|
360
|
+
firstPage: { items: servers, hasMore: !!metadata.nextCursor },
|
|
361
|
+
getNextPage: async (ct) => {
|
|
362
|
+
if (ct.isCancellationRequested) {
|
|
363
|
+
throw ( new CancellationError());
|
|
364
|
+
}
|
|
365
|
+
if (!currentCursor) {
|
|
366
|
+
return { items: [], hasMore: false };
|
|
367
|
+
}
|
|
368
|
+
const { servers, metadata: nextMetadata } = await this.queryGalleryMcpServers(query.withPage(currentCursor).withSearchText(undefined), mcpGalleryManifest, ct);
|
|
369
|
+
currentCursor = nextMetadata.nextCursor;
|
|
370
|
+
return { items: servers, hasMore: !!nextMetadata.nextCursor };
|
|
730
371
|
}
|
|
731
|
-
const { servers, metadata } = cursor ? await this.queryGalleryMcpServers(query.withPage(cursor).withSearchText(undefined), mcpGalleryManifest, token) : { servers: [], metadata: undefined };
|
|
732
|
-
return {
|
|
733
|
-
elements: servers,
|
|
734
|
-
total,
|
|
735
|
-
hasNextPage: !!cursor,
|
|
736
|
-
getNextPage: (token) => getNextPage(metadata?.next_cursor, token)
|
|
737
|
-
};
|
|
738
372
|
};
|
|
739
|
-
return ( new PageIteratorPager({
|
|
740
|
-
elements: servers,
|
|
741
|
-
total,
|
|
742
|
-
hasNextPage: !!metadata?.next_cursor,
|
|
743
|
-
getNextPage: (token) => getNextPage(metadata?.next_cursor, token),
|
|
744
|
-
}));
|
|
745
373
|
}
|
|
746
|
-
async getMcpServersFromGallery(
|
|
374
|
+
async getMcpServersFromGallery(infos) {
|
|
747
375
|
const mcpGalleryManifest = await this.mcpGalleryManifestService.getMcpGalleryManifest();
|
|
748
376
|
if (!mcpGalleryManifest) {
|
|
749
377
|
return [];
|
|
750
378
|
}
|
|
751
379
|
const mcpServers = [];
|
|
752
|
-
await Promise.allSettled((
|
|
753
|
-
const
|
|
754
|
-
if (mcpServerUrl !== url) {
|
|
755
|
-
return;
|
|
756
|
-
}
|
|
757
|
-
const mcpServer = await this.getMcpServer(mcpServerUrl);
|
|
380
|
+
await Promise.allSettled(( infos.map(async (info) => {
|
|
381
|
+
const mcpServer = await this.getMcpServerByName(info, mcpGalleryManifest);
|
|
758
382
|
if (mcpServer) {
|
|
759
383
|
mcpServers.push(mcpServer);
|
|
760
384
|
}
|
|
761
385
|
})));
|
|
762
386
|
return mcpServers;
|
|
763
387
|
}
|
|
764
|
-
async
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
const context = await this.requestService.request({
|
|
772
|
-
type: 'GET',
|
|
773
|
-
url: gallery.url,
|
|
774
|
-
}, token);
|
|
775
|
-
const result = await asJson(context);
|
|
776
|
-
if (!result) {
|
|
777
|
-
throw ( new Error(`Failed to fetch configuration from ${gallery.url}`));
|
|
388
|
+
async getMcpServerByName({ name, id }, mcpGalleryManifest) {
|
|
389
|
+
const mcpServerUrl = this.getLatestServerVersionUrl(name, mcpGalleryManifest);
|
|
390
|
+
if (mcpServerUrl) {
|
|
391
|
+
const mcpServer = await this.getMcpServer(mcpServerUrl);
|
|
392
|
+
if (mcpServer) {
|
|
393
|
+
return mcpServer;
|
|
394
|
+
}
|
|
778
395
|
}
|
|
779
|
-
const
|
|
780
|
-
if (
|
|
781
|
-
|
|
396
|
+
const byNameUrl = this.getNamedServerUrl(name, mcpGalleryManifest);
|
|
397
|
+
if (byNameUrl) {
|
|
398
|
+
const mcpServer = await this.getMcpServer(byNameUrl);
|
|
399
|
+
if (mcpServer) {
|
|
400
|
+
return mcpServer;
|
|
401
|
+
}
|
|
782
402
|
}
|
|
783
|
-
const
|
|
784
|
-
if (
|
|
785
|
-
|
|
403
|
+
const byIdUrl = id ? this.getServerIdUrl(id, mcpGalleryManifest) : undefined;
|
|
404
|
+
if (byIdUrl) {
|
|
405
|
+
const mcpServer = await this.getMcpServer(byIdUrl);
|
|
406
|
+
if (mcpServer) {
|
|
407
|
+
return mcpServer;
|
|
408
|
+
}
|
|
786
409
|
}
|
|
787
|
-
return
|
|
410
|
+
return undefined;
|
|
788
411
|
}
|
|
789
412
|
async getReadme(gallery, token) {
|
|
790
413
|
const readmeUrl = gallery.readmeUrl;
|
|
791
414
|
if (!readmeUrl) {
|
|
792
|
-
return Promise.resolve(( localize(
|
|
415
|
+
return Promise.resolve(( localize(1982, 'No README available')));
|
|
793
416
|
}
|
|
794
417
|
const uri = ( URI.parse(readmeUrl));
|
|
795
418
|
if (uri.scheme === Schemas.file) {
|
|
@@ -802,7 +425,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
802
425
|
}
|
|
803
426
|
}
|
|
804
427
|
if (uri.authority !== 'raw.githubusercontent.com') {
|
|
805
|
-
return ( new MarkdownString(( localize(
|
|
428
|
+
return ( new MarkdownString(( localize(1983, "You can find information about this server [here]({0})", readmeUrl)))).value;
|
|
806
429
|
}
|
|
807
430
|
const context = await this.requestService.request({
|
|
808
431
|
type: 'GET',
|
|
@@ -816,12 +439,14 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
816
439
|
}
|
|
817
440
|
toGalleryMcpServer(server, manifest) {
|
|
818
441
|
let publisher = '';
|
|
819
|
-
let displayName =
|
|
442
|
+
let displayName = server.title;
|
|
820
443
|
if (server.githubInfo?.name) {
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
444
|
+
if (!displayName) {
|
|
445
|
+
displayName = ( server.githubInfo.name.split('-').map(
|
|
446
|
+
s => s.toLowerCase() === 'mcp' ? 'MCP' : s.toLowerCase() === 'github' ? 'GitHub' : uppercaseFirstLetter(s)
|
|
447
|
+
)).join(' ');
|
|
448
|
+
}
|
|
449
|
+
publisher = server.githubInfo.nameWithOwner.split('/')[0];
|
|
825
450
|
}
|
|
826
451
|
else {
|
|
827
452
|
const nameParts = server.name.split('/');
|
|
@@ -831,48 +456,66 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
831
456
|
publisher = domainParts[domainParts.length - 1];
|
|
832
457
|
}
|
|
833
458
|
}
|
|
834
|
-
|
|
459
|
+
if (!displayName) {
|
|
460
|
+
displayName = ( nameParts[nameParts.length - 1].split('-').map(s => uppercaseFirstLetter(s))).join(' ');
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
if (server.githubInfo?.displayName) {
|
|
464
|
+
displayName = server.githubInfo.displayName;
|
|
835
465
|
}
|
|
836
|
-
|
|
837
|
-
|
|
466
|
+
let icon;
|
|
467
|
+
if (server.githubInfo?.preferredImage) {
|
|
468
|
+
icon = {
|
|
469
|
+
light: server.githubInfo.preferredImage,
|
|
470
|
+
dark: server.githubInfo.preferredImage
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
else if (server.githubInfo?.ownerAvatarUrl) {
|
|
474
|
+
icon = {
|
|
475
|
+
light: server.githubInfo.ownerAvatarUrl,
|
|
476
|
+
dark: server.githubInfo.ownerAvatarUrl
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
else if (server.apicInfo?.['x-ms-icon']) {
|
|
480
|
+
icon = {
|
|
481
|
+
light: server.apicInfo['x-ms-icon'],
|
|
482
|
+
dark: server.apicInfo['x-ms-icon']
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
else if (server.icons && server.icons.length > 0) {
|
|
486
|
+
const lightIcon = server.icons.find(icon => icon.theme === 'light') ?? server.icons[0];
|
|
487
|
+
const darkIcon = server.icons.find(icon => icon.theme === 'dark') ?? lightIcon;
|
|
488
|
+
icon = {
|
|
489
|
+
light: lightIcon.src,
|
|
490
|
+
dark: darkIcon.src
|
|
491
|
+
};
|
|
838
492
|
}
|
|
839
|
-
const icon = server.githubInfo?.owner_avatar_url ? {
|
|
840
|
-
light: server.githubInfo.owner_avatar_url,
|
|
841
|
-
dark: server.githubInfo.owner_avatar_url
|
|
842
|
-
} : undefined;
|
|
843
|
-
const serverUrl = manifest ? this.getServerUrl(server.registryInfo.id, manifest) : undefined;
|
|
844
493
|
const webUrl = manifest ? this.getWebUrl(server.name, manifest) : undefined;
|
|
845
494
|
const publisherUrl = manifest ? this.getPublisherUrl(publisher, manifest) : undefined;
|
|
846
495
|
return {
|
|
847
|
-
id: server.
|
|
496
|
+
id: server.id,
|
|
848
497
|
name: server.name,
|
|
849
498
|
displayName,
|
|
850
|
-
|
|
499
|
+
galleryUrl: manifest?.url,
|
|
851
500
|
webUrl,
|
|
852
501
|
description: server.description,
|
|
853
502
|
status: server.status ?? GalleryMcpServerStatus.Active,
|
|
854
503
|
version: server.version,
|
|
855
|
-
isLatest: server.registryInfo
|
|
856
|
-
publishDate: server.registryInfo
|
|
857
|
-
lastUpdated: server.githubInfo?.
|
|
504
|
+
isLatest: server.registryInfo?.isLatest ?? true,
|
|
505
|
+
publishDate: server.registryInfo?.publishedAt ? Date.parse(server.registryInfo.publishedAt) : undefined,
|
|
506
|
+
lastUpdated: server.githubInfo?.pushedAt ? Date.parse(server.githubInfo.pushedAt) : server.registryInfo?.updatedAt ? Date.parse(server.registryInfo.updatedAt) : undefined,
|
|
858
507
|
repositoryUrl: server.repository?.url,
|
|
859
|
-
readme: server.
|
|
508
|
+
readme: server.readme,
|
|
860
509
|
icon,
|
|
861
510
|
publisher,
|
|
862
511
|
publisherUrl,
|
|
863
512
|
license: server.githubInfo?.license,
|
|
864
|
-
starsCount: server.githubInfo?.
|
|
513
|
+
starsCount: server.githubInfo?.stargazerCount,
|
|
865
514
|
topics: server.githubInfo?.topics,
|
|
866
|
-
configuration:
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
if (!packages && !remotes) {
|
|
871
|
-
return undefined;
|
|
872
|
-
}
|
|
873
|
-
return {
|
|
874
|
-
packages,
|
|
875
|
-
remotes
|
|
515
|
+
configuration: {
|
|
516
|
+
packages: server.packages,
|
|
517
|
+
remotes: server.remotes
|
|
518
|
+
}
|
|
876
519
|
};
|
|
877
520
|
}
|
|
878
521
|
async queryGalleryMcpServers(query, mcpGalleryManifest, token) {
|
|
@@ -883,9 +526,9 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
883
526
|
};
|
|
884
527
|
}
|
|
885
528
|
async queryRawGalleryMcpServers(query, mcpGalleryManifest, token) {
|
|
886
|
-
const mcpGalleryUrl =
|
|
529
|
+
const mcpGalleryUrl = this.getMcpGalleryUrl(mcpGalleryManifest);
|
|
887
530
|
if (!mcpGalleryUrl) {
|
|
888
|
-
return { servers: [] };
|
|
531
|
+
return { servers: [], metadata: { count: 0 } };
|
|
889
532
|
}
|
|
890
533
|
const uri = ( URI.parse(mcpGalleryUrl));
|
|
891
534
|
if (uri.scheme === Schemas.file) {
|
|
@@ -904,7 +547,7 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
904
547
|
}
|
|
905
548
|
if (query.searchText) {
|
|
906
549
|
const text = encodeURIComponent(query.searchText);
|
|
907
|
-
url += `&
|
|
550
|
+
url += `&search=${text}`;
|
|
908
551
|
}
|
|
909
552
|
const context = await this.requestService.request({
|
|
910
553
|
type: 'GET',
|
|
@@ -912,9 +555,9 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
912
555
|
}, token);
|
|
913
556
|
const data = await asJson(context);
|
|
914
557
|
if (!data) {
|
|
915
|
-
return { servers: [] };
|
|
558
|
+
return { servers: [], metadata: { count: 0 } };
|
|
916
559
|
}
|
|
917
|
-
const result = this.serializeMcpServersResult(data);
|
|
560
|
+
const result = this.serializeMcpServersResult(data, mcpGalleryManifest);
|
|
918
561
|
if (!result) {
|
|
919
562
|
throw ( new Error(`Failed to serialize MCP servers result from ${mcpGalleryUrl}`, data));
|
|
920
563
|
}
|
|
@@ -932,68 +575,25 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
932
575
|
if (!data) {
|
|
933
576
|
return undefined;
|
|
934
577
|
}
|
|
935
|
-
const server = this.serializeMcpServer(data);
|
|
936
|
-
if (!server) {
|
|
937
|
-
throw ( new Error(`Failed to serialize MCP server from ${mcpServerUrl}`, data));
|
|
938
|
-
}
|
|
939
578
|
if (!mcpGalleryManifest) {
|
|
940
579
|
mcpGalleryManifest = await this.mcpGalleryManifestService.getMcpGalleryManifest();
|
|
941
|
-
if (mcpGalleryManifest && mcpServerUrl !== this.getServerUrl(basename(mcpServerUrl), mcpGalleryManifest)) {
|
|
942
|
-
mcpGalleryManifest = null;
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
return this.toGalleryMcpServer(server, mcpGalleryManifest);
|
|
946
|
-
}
|
|
947
|
-
async getMcpServerByName(name) {
|
|
948
|
-
const mcpGalleryManifest = await this.mcpGalleryManifestService.getMcpGalleryManifest();
|
|
949
|
-
if (!mcpGalleryManifest) {
|
|
950
|
-
return undefined;
|
|
951
580
|
}
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
return undefined;
|
|
955
|
-
}
|
|
956
|
-
const context = await this.requestService.request({
|
|
957
|
-
type: 'GET',
|
|
958
|
-
url: mcpServerUrl,
|
|
959
|
-
}, CancellationToken.None);
|
|
960
|
-
if (context.res.statusCode && context.res.statusCode >= 400 && context.res.statusCode < 500) {
|
|
961
|
-
return undefined;
|
|
962
|
-
}
|
|
963
|
-
const data = await asJson(context);
|
|
964
|
-
if (!data) {
|
|
965
|
-
return undefined;
|
|
966
|
-
}
|
|
967
|
-
const server = this.serializeMcpServer(data);
|
|
581
|
+
mcpGalleryManifest = mcpGalleryManifest && mcpServerUrl.startsWith(mcpGalleryManifest.url) ? mcpGalleryManifest : null;
|
|
582
|
+
const server = this.serializeMcpServer(data, mcpGalleryManifest);
|
|
968
583
|
if (!server) {
|
|
969
584
|
throw ( new Error(`Failed to serialize MCP server from ${mcpServerUrl}`, data));
|
|
970
585
|
}
|
|
971
586
|
return this.toGalleryMcpServer(server, mcpGalleryManifest);
|
|
972
587
|
}
|
|
973
|
-
serializeMcpServer(data) {
|
|
974
|
-
|
|
975
|
-
const result = serializer.toRawGalleryMcpServer(data);
|
|
976
|
-
if (result) {
|
|
977
|
-
return result;
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
return undefined;
|
|
588
|
+
serializeMcpServer(data, mcpGalleryManifest) {
|
|
589
|
+
return this.getSerializer(mcpGalleryManifest)?.toRawGalleryMcpServer(data);
|
|
981
590
|
}
|
|
982
|
-
serializeMcpServersResult(data) {
|
|
983
|
-
|
|
984
|
-
const result = serializer.toRawGalleryMcpServerResult(data);
|
|
985
|
-
if (result) {
|
|
986
|
-
return result;
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
return undefined;
|
|
591
|
+
serializeMcpServersResult(data, mcpGalleryManifest) {
|
|
592
|
+
return this.getSerializer(mcpGalleryManifest)?.toRawGalleryMcpServerResult(data);
|
|
990
593
|
}
|
|
991
|
-
|
|
992
|
-
const
|
|
993
|
-
|
|
994
|
-
return undefined;
|
|
995
|
-
}
|
|
996
|
-
return format2(resourceUriTemplate, { id });
|
|
594
|
+
getSerializer(mcpGalleryManifest) {
|
|
595
|
+
const version = mcpGalleryManifest?.version ?? 'v0';
|
|
596
|
+
return this.galleryMcpServerDataSerializers.get(version);
|
|
997
597
|
}
|
|
998
598
|
getNamedServerUrl(name, mcpGalleryManifest) {
|
|
999
599
|
const namedResourceUriTemplate = getMcpGalleryManifestResourceUri(mcpGalleryManifest, McpGalleryResourceType.McpServerNamedResourceUri);
|
|
@@ -1002,8 +602,19 @@ let McpGalleryService = class McpGalleryService extends Disposable {
|
|
|
1002
602
|
}
|
|
1003
603
|
return format2(namedResourceUriTemplate, { name });
|
|
1004
604
|
}
|
|
1005
|
-
|
|
1006
|
-
|
|
605
|
+
getServerIdUrl(id, mcpGalleryManifest) {
|
|
606
|
+
const resourceUriTemplate = getMcpGalleryManifestResourceUri(mcpGalleryManifest, McpGalleryResourceType.McpServerIdUri);
|
|
607
|
+
if (!resourceUriTemplate) {
|
|
608
|
+
return undefined;
|
|
609
|
+
}
|
|
610
|
+
return format2(resourceUriTemplate, { id });
|
|
611
|
+
}
|
|
612
|
+
getLatestServerVersionUrl(name, mcpGalleryManifest) {
|
|
613
|
+
const latestVersionResourceUriTemplate = getMcpGalleryManifestResourceUri(mcpGalleryManifest, McpGalleryResourceType.McpServerLatestVersionUri);
|
|
614
|
+
if (!latestVersionResourceUriTemplate) {
|
|
615
|
+
return undefined;
|
|
616
|
+
}
|
|
617
|
+
return format2(latestVersionResourceUriTemplate, { name: encodeURIComponent(name) });
|
|
1007
618
|
}
|
|
1008
619
|
getWebUrl(name, mcpGalleryManifest) {
|
|
1009
620
|
const resourceUriTemplate = getMcpGalleryManifestResourceUri(mcpGalleryManifest, McpGalleryResourceType.McpServerWebUri);
|