diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts index d52be9f2cce..c9be42c6a66 100644 --- a/src/vs/base/common/product.ts +++ b/src/vs/base/common/product.ts @@ -105,7 +105,6 @@ export interface IProductConfiguration { readonly extensionsGallery?: { readonly serviceUrl: string; readonly controlUrl: string; - readonly mcpUrl: string; readonly extensionUrlTemplate: string; readonly resourceUrlTemplate: string; readonly nlsBaseUrl: string; diff --git a/src/vs/platform/mcp/common/mcpGalleryManifestService.ts b/src/vs/platform/mcp/common/mcpGalleryManifestService.ts index a366e79c1f6..cdd12bfc1fa 100644 --- a/src/vs/platform/mcp/common/mcpGalleryManifestService.ts +++ b/src/vs/platform/mcp/common/mcpGalleryManifestService.ts @@ -33,22 +33,19 @@ export class McpGalleryManifestService extends Disposable implements IMcpGallery protected createMcpGalleryManifest(url: string): IMcpGalleryManifest { url = url.endsWith('/') ? url.slice(0, -1) : url; - const isVSCodeGalleryUrl = this.productService.extensionsGallery?.mcpUrl === url; const isProductGalleryUrl = this.productService.mcpGallery?.serviceUrl === url; - const version = isVSCodeGalleryUrl ? undefined : 'v0'; - const serversUrl = isVSCodeGalleryUrl ? url : `${url}/${version}/servers`; + const version = 'v0'; + const serversUrl = `${url}/${version}/servers`; const resources = [ { id: serversUrl, type: McpGalleryResourceType.McpServersQueryService - } - ]; - if (!isVSCodeGalleryUrl) { - resources.push({ + }, + { id: `${serversUrl}/{id}`, type: McpGalleryResourceType.McpServerResourceUri - }); - } + } + ]; if (isProductGalleryUrl) { resources.push({ diff --git a/src/vs/platform/mcp/common/mcpGalleryService.ts b/src/vs/platform/mcp/common/mcpGalleryService.ts index 500ffa5ca19..8ed8ee5173d 100644 --- a/src/vs/platform/mcp/common/mcpGalleryService.ts +++ b/src/vs/platform/mcp/common/mcpGalleryService.ts @@ -12,7 +12,6 @@ import { URI } from '../../../base/common/uri.js'; import { localize } from '../../../nls.js'; import { IFileService } from '../../files/common/files.js'; import { ILogService } from '../../log/common/log.js'; -import { IProductService } from '../../product/common/productService.js'; import { asJson, asText, IRequestService } from '../../request/common/request.js'; import { IGalleryMcpServer, GalleryMcpServerStatus, IMcpGalleryService, IGalleryMcpServerConfiguration, IMcpServerPackage, IQueryOptions, SseTransport, StreamableHttpTransport, IMcpServerKeyValueInput, Transport, TransportType } from './mcpManagement.js'; import { IMcpGalleryManifestService, McpGalleryManifestStatus, getMcpGalleryManifestResourceUri, McpGalleryResourceType, IMcpGalleryManifest } from './mcpGalleryManifest.js'; @@ -196,30 +195,6 @@ interface IRawGalleryServersResult { readonly servers: readonly IRawGalleryMcpServer[]; } -interface IVSCodeGalleryMcpServerDetail { - readonly name: string; - readonly displayName: string; - readonly description: string; - readonly repository?: { - readonly url: string; - readonly source: string; - }; - readonly codicon?: string; - readonly iconUrl?: string; - readonly iconUrlDark?: string; - readonly iconUrlLight?: string; - readonly readmeUrl: string; - readonly publisher?: { - readonly displayName: string; - readonly url: string; - readonly is_verified: boolean; - }; - readonly manifest: { - readonly packages?: readonly IRawGalleryMcpServerPackage[]; - readonly remotes?: McpServerRemotes; - }; -} - const DefaultPageSize = 50; interface IQueryState { @@ -256,7 +231,6 @@ export class McpGalleryService extends Disposable implements IMcpGalleryService constructor( @IRequestService private readonly requestService: IRequestService, @IFileService private readonly fileService: IFileService, - @IProductService private readonly productService: IProductService, @ILogService private readonly logService: ILogService, @IMcpGalleryManifestService private readonly mcpGalleryManifestService: IMcpGalleryManifestService, ) { @@ -324,11 +298,6 @@ export class McpGalleryService extends Disposable implements IMcpGalleryService return mcpServers; } - async getMcpServersFromVSCodeGallery(names: string[]): Promise { - const servers = await this.fetchMcpServersFromVSCodeGallery(); - return servers.filter(item => names.includes(item.name)); - } - async getMcpServerConfiguration(gallery: IGalleryMcpServer, token: CancellationToken): Promise { if (gallery.configuration) { return gallery.configuration; @@ -468,11 +437,6 @@ export class McpGalleryService extends Disposable implements IMcpGalleryService } private async queryGalleryMcpServers(query: Query, mcpGalleryManifest: IMcpGalleryManifest, token: CancellationToken): Promise<{ servers: IGalleryMcpServer[]; metadata?: IRawGalleryServerListMetadata }> { - if (mcpGalleryManifest.url === this.productService.extensionsGallery?.mcpUrl) { - return { - servers: await this.fetchMcpServersFromVSCodeGallery() - }; - } const { servers, metadata } = await this.queryRawGalleryMcpServers(query, mcpGalleryManifest, token); return { servers: servers.map(item => this.toGalleryMcpServer(item, mcpGalleryManifest)), @@ -635,45 +599,6 @@ export class McpGalleryService extends Disposable implements IMcpGalleryService throw new Error('Unsupported MCP server schema version'); } - private async fetchMcpServersFromVSCodeGallery(): Promise { - const mcpGalleryUrl = this.productService.extensionsGallery?.mcpUrl; - if (!mcpGalleryUrl) { - return []; - } - - const context = await this.requestService.request({ - type: 'GET', - url: mcpGalleryUrl, - }, CancellationToken.None); - - const result = await asJson<{ servers: IVSCodeGalleryMcpServerDetail[] }>(context); - if (!result) { - return []; - } - - return result.servers.map(item => { - return { - id: item.name, - name: item.name, - displayName: item.displayName, - description: item.description, - version: '0.0.1', - isLatest: true, - status: GalleryMcpServerStatus.Active, - repositoryUrl: item.repository?.url, - codicon: item.codicon, - publisher: '', - publisherDisplayName: item.publisher?.displayName, - publisherDomain: item.publisher ? { - link: item.publisher.url, - verified: item.publisher.is_verified, - } : undefined, - readmeUrl: item.readmeUrl, - configuration: this.toGalleryMcpServerConfiguration(item.manifest.packages, item.manifest.remotes) - }; - }); - } - private getServerUrl(id: string, mcpGalleryManifest: IMcpGalleryManifest): string | undefined { const resourceUriTemplate = getMcpGalleryManifestResourceUri(mcpGalleryManifest, McpGalleryResourceType.McpServerResourceUri); if (!resourceUriTemplate) { diff --git a/src/vs/platform/mcp/common/mcpManagement.ts b/src/vs/platform/mcp/common/mcpManagement.ts index 76cd674a410..5832aec9d90 100644 --- a/src/vs/platform/mcp/common/mcpManagement.ts +++ b/src/vs/platform/mcp/common/mcpManagement.ts @@ -168,7 +168,6 @@ export interface IMcpGalleryService { readonly _serviceBrand: undefined; isEnabled(): boolean; query(options?: IQueryOptions, token?: CancellationToken): Promise>; - getMcpServersFromVSCodeGallery(servers: string[]): Promise; getMcpServersFromGallery(urls: string[]): Promise; getMcpServer(url: string): Promise; getMcpServerByName(name: string): Promise; diff --git a/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.ts b/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.ts index 725a920a030..a4fe9847364 100644 --- a/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.ts +++ b/src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.ts @@ -294,7 +294,6 @@ export class McpWorkbenchService extends Disposable implements IMcpWorkbenchServ private async syncInstalledMcpServers(resetGallery?: boolean): Promise { const galleryMcpServerUrls: string[] = []; - const vscodeGalleryMcpServerNames: string[] = []; for (const installed of this.local) { if (installed.local?.source !== 'gallery') { @@ -302,8 +301,6 @@ export class McpWorkbenchService extends Disposable implements IMcpWorkbenchServ } if (installed.local.galleryUrl) { galleryMcpServerUrls.push(installed.local.galleryUrl); - } else if (!installed.local.manifest) { - vscodeGalleryMcpServerNames.push(installed.local.name); } } @@ -313,13 +310,6 @@ export class McpWorkbenchService extends Disposable implements IMcpWorkbenchServ await this.syncInstalledMcpServersWithGallery(galleryServers, false, resetGallery); } } - - if (vscodeGalleryMcpServerNames.length) { - const galleryServers = await this.mcpGalleryService.getMcpServersFromVSCodeGallery(vscodeGalleryMcpServerNames); - if (galleryServers.length) { - await this.syncInstalledMcpServersWithGallery(galleryServers, true, resetGallery); - } - } } private async syncInstalledMcpServersWithGallery(gallery: IGalleryMcpServer[], vscodeGallery: boolean, resetGallery?: boolean): Promise { @@ -648,21 +638,10 @@ export class McpWorkbenchService extends Disposable implements IMcpWorkbenchServ try { const { name, inputs, gallery, ...config } = parsed; - - if (gallery || !config || Object.keys(config).length === 0) { - const [galleryServer] = await this.mcpGalleryService.getMcpServersFromVSCodeGallery([name]); - if (!galleryServer) { - throw new Error(`MCP server '${name}' not found in gallery`); - } - const local = this.local.find(e => e.name === name && e.local?.scope !== LocalMcpServerScope.Workspace) - ?? this.instantiationService.createInstance(McpWorkbenchServer, e => this.getInstallState(e), undefined, galleryServer, undefined); - this.open(local); - } else { - if (config.type === undefined) { - (>config).type = (parsed).command ? McpServerType.LOCAL : McpServerType.REMOTE; - } - this.open(this.instantiationService.createInstance(McpWorkbenchServer, e => this.getInstallState(e), undefined, undefined, { name, config, inputs })); + if (config.type === undefined) { + (>config).type = (parsed).command ? McpServerType.LOCAL : McpServerType.REMOTE; } + this.open(this.instantiationService.createInstance(McpWorkbenchServer, e => this.getInstallState(e), undefined, undefined, { name, config, inputs })); } catch (e) { // ignore }