Skip to content

Commit c809b74

Browse files
authored
show iconUrl for mcp servers from gallery (microsoft#254081)
1 parent 116cbcd commit c809b74

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/vs/platform/mcp/common/mcpGalleryService.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,22 @@ export class McpGalleryService extends Disposable implements IMcpGalleryService
177177
}
178178
}
179179

180+
let icon: { light: string; dark: string } | undefined;
181+
if (this.productService.extensionsGallery?.mcpUrl !== this.getMcpGalleryUrl()) {
182+
if (item.iconUrl) {
183+
icon = {
184+
light: item.iconUrl,
185+
dark: item.iconUrl
186+
};
187+
}
188+
if (item.iconUrlLight && item.iconUrlDark) {
189+
icon = {
190+
light: item.iconUrlLight,
191+
dark: item.iconUrlDark
192+
};
193+
}
194+
}
195+
180196
return {
181197
id: item.id ?? item.name,
182198
name: item.name,
@@ -187,6 +203,7 @@ export class McpGalleryService extends Disposable implements IMcpGalleryService
187203
lastUpdated: item.version_detail ? Date.parse(item.version_detail.release_date) : undefined,
188204
repositoryUrl: item.repository?.url,
189205
codicon: item.codicon,
206+
icon,
190207
readmeUrl: item.readmeUrl,
191208
manifestUrl: this.getManifestUrl(item),
192209
packageTypes: item.package_types ?? [],

0 commit comments

Comments
 (0)