:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(mcp-store): replace icon assets with logo.dev icon_domain resolution (#70159)
Chris Volzerde2eb9e2e5a6
diff --git a/frontend/src/scenes/inbox/components/shell/AgentSetupColumn.tsx b/frontend/src/scenes/inbox/components/shell/AgentSetupColumn.tsxindex e461191e40c2..b4de80dc8392 100644--- a/frontend/src/scenes/inbox/components/shell/AgentSetupColumn.tsx+++ b/frontend/src/scenes/inbox/components/shell/AgentSetupColumn.tsx@@ -234,7 +234,12 @@ function McpServersWidget(): JSX.Element {{count > 0 && (<div className="flex items-center gap-1 pt-1">{installations.slice(0, 6).map((installation) => (- <ServerIcon key={installation.id} iconKey={installation.icon_key} size={16} />+ <ServerIcon+ key={installation.id}+ iconDomain={installation.icon_domain}+ serverUrl={installation.url}+ size={16}+ />))}{count > 6 && <span className="text-[11px] text-muted">+{count - 6}</span>}</div>diff --git a/products/mcp_store/README.md b/products/mcp_store/README.mdnew file mode 100644index 000000000000..6684ca0025bb--- /dev/null+++ b/products/mcp_store/README.md@@ -0,0 +1,18 @@+# MCP store++A curated catalog of MCP servers that PostHog users can install with one click, plus support for custom per-team installations.++## Server icons (logo.dev)++Catalog icons are not committed image assets.+Each `MCPServerTemplate` carries an `icon_domain` (the vendor's brand domain, e.g. `linear.app`), and the frontend renders it through the authenticated proxy endpoint `GET /api/projects/:team_id/mcp_servers/icon/?domain=<domain>`.+The proxy fetches the brand icon from [logo.dev](https://logo.dev) via the egress-gated `CDPIconsService`.+Icon bytes are never stored on PostHog infrastructure (our logo.dev plan does not include a data-caching license); browsers cache responses via `Cache-Control`, and only the fact of a definitive miss is cached server-side.+Custom installations without a template derive a best-effort brand domain from their server URL.++### Self-hosted instances++Icon resolution requires the `LOGO_DEV_TOKEN` environment variable (a logo.dev API token) and outbound network access to `img.logo.dev`.+Without the token, which is the default on self-hosted and air-gapped deployments, the icon endpoint returns 404 and the UI falls back to a generic server glyph for every server.+This is cosmetic only: installing and using MCP servers works exactly the same without icons.+To get brand icons on a self-hosted instance, create a logo.dev account, generate an API token, and set `LOGO_DEV_TOKEN` in the environment of the web service.diff --git a/products/mcp_store/backend/admin.py b/products/mcp_store/backend/admin.pyindex 3b69b8dd2b3e..0693ad733984 100644--- a/products/mcp_store/backend/admin.py+++ b/products/mcp_store/backend/admin.py@@ -28,6 +28,7 @@ class MCPServerTemplateAdminForm(forms.ModelForm):"description","auth_type","icon_key",+ "icon_domain","category","oauth_issuer_url","oauth_metadata",diff --git a/products/mcp_store/backend/migrations/0014_mcpservertemplate_icon_domain.py b/products/mcp_store/backend/migrations/0014_mcpservertemplate_icon_domain.pynew file mode 100644index 000000000000..14bf3af2250d--- /dev/null+++ b/products/mcp_store/backend/migrations/0014_mcpservertemplate_icon_domain.py@@ -0,0 +1,17 @@+# Generated by Django 5.2.14 on 2026-07-10 21:03++from django.db import migrations, models+++class Migration(migrations.Migration):+ dependencies = [+ ("mcp_store", "0013_alter_mcpservertemplate_category_db_default"),+ ]++ operations = [+ migrations.AddField(+ model_name="mcpservertemplate",+ name="icon_domain",+ field=models.CharField(blank=True, default="", max_length=253),+ ),+ ]diff --git a/products/mcp_store/backend/migrations/0015_backfill_mcp_template_icon_domains.py b/products/mcp_store/backend/migrations/0015_backfill_mcp_template_icon_domains.pynew file mode 100644index 000000000000..a0f800bd9bf0--- /dev/null+++ b/products/mcp_store/backend/migrations/0015_backfill_mcp_template_icon_domains.py@@ -0,0 +1,79 @@+from urllib.parse import urlparse++from django.db import migrations++# Brand domains for every icon_key known to have shipped (the curated seeds from 0007 plus+# admin-added templates that had bundled frontend assets). logo.dev keys brand icons on these.+ICON_KEY_TO_DOMAIN = {+ "airops": "airops.com",+ "atlassian": "atlassian.com",+ "attio": "attio.com",+ "box": "box.com",+ "browserbase": "browserbase.com",+ "canva": "canva.com",+ "circle": "circle.com",+ "cisco_thousandeyes": "thousandeyes.com",+ "clerk": "clerk.com",+ "clickhouse": "clickhouse.com",+ "cloudflare": "cloudflare.com",+ "context7": "context7.com",+ "datadog": "datadoghq.com",+ "dbt_labs": "getdbt.com",+ "figma": "figma.com",+ "firetiger": "firetiger.com",+ "github": "github.com",+ "gitlab": "gitlab.com",+ "hex": "hex.tech",+ "hubspot": "hubspot.com",+ "launchdarkly": "launchdarkly.com",+ "linear": "linear.app",+ "monday": "monday.com",+ "neon": "neon.tech",+ "notion": "notion.com",+ "pagerduty": "pagerduty.com",+ "planetscale": "planetscale.com",+ "postman": "postman.com",+ "prisma": "prisma.io",+ "render": "render.com",+ "sanity": "sanity.io",+ "semgrep": "semgrep.dev",+ "sentry": "sentry.io",+ "slack": "slack.com",+ "sourcegraph": "sourcegraph.com",+ "stripe": "stripe.com",+ "supabase": "supabase.com",+ "svelte": "svelte.dev",+ "thoughtspot": "thoughtspot.com",+ "wix": "wix.com",+}++_STRIPPED_SUBDOMAINS = ("mcp.", "api.", "www.")+++def _domain_from_server_url(server_url: str) -> str:+ host = (urlparse(server_url).hostname or "").lower()+ for prefix in _STRIPPED_SUBDOMAINS:+ if host.startswith(prefix) and host.count(".") >= 2:+ return host[len(prefix) :]+ return host+++def backfill_icon_domains(apps, schema_editor) -> None:+ MCPServerTemplate = apps.get_model("mcp_store", "MCPServerTemplate")+ to_update = []+ for template in MCPServerTemplate.objects.filter(icon_domain=""):+ domain = ICON_KEY_TO_DOMAIN.get(template.icon_key) or _domain_from_server_url(template.url)+ if domain:+ template.icon_domain = domain+ to_update.append(template)+ MCPServerTemplate.objects.bulk_update(to_update, ["icon_domain"], batch_size=100)+++class Migration(migrations.Migration):+ dependencies = [+ ("mcp_store", "0014_mcpservertemplate_icon_domain"),+ ]++ operations = [+ migrations.RunPython(backfill_icon_domains, migrations.RunPython.noop, elidable=True),+ ]diff --git a/products/mcp_store/backend/migrations/max_migration.txt b/products/mcp_store/backend/migrations/max_migration.txtindex bfbdac6daf1c..08632c5c75f9 100644--- a/products/mcp_store/backend/migrations/max_migration.txt+++ b/products/mcp_store/backend/migrations/max_migration.txt@@ -1 +1 @@-0013_alter_mcpservertemplate_category_db_default+0015_backfill_mcp_template_icon_domainsdiff --git a/products/mcp_store/backend/models.py b/products/mcp_store/backend/models.pyindex 69fa0e32d982..4ba2ce271580 100644--- a/products/mcp_store/backend/models.py+++ b/products/mcp_store/backend/models.py@@ -1,4 +1,5 @@from typing import Literal, TypedDict+from urllib.parse import urlparsefrom django.db import modelsfrom django.db.models import Q@@ -66,6 +67,17 @@ def normalize_mcp_template_icon_key(value: str) -> str:return "_".join((value or "").lower().split())+def normalize_mcp_icon_domain(value: str) -> str:+ """Lowercase hostname, no scheme/path/query/port — the id logo.dev keys brand icons on."""+ value = (value or "").strip().lower()+ if not value:+ return ""+ # urlparse only treats the leading segment as a host when a netloc separator is present.+ if "//" not in value:+ value = f"//{value}"+ return (urlparse(value).hostname or "").rstrip(".")++class MCPServerTemplate(CreatedMetaFields, UpdatedMetaFields, UUIDModel):"""A curated, pre-registered MCP server. PostHog operators register a realOAuth app with the provider ahead of time and paste the client_id /@@ -79,7 +91,11 @@ class MCPServerTemplate(CreatedMetaFields, UpdatedMetaFields, UUIDModel):docs_url = models.URLField(max_length=2048, blank=True, default="")description = models.TextField(blank=True, default="")auth_type = models.CharField(max_length=20, choices=AUTH_TYPE_CHOICES, default="oauth")+ # Deprecated: icons resolve from icon_domain via logo.dev; the column drop is a follow-up.icon_key = models.CharField(max_length=100, blank=True, default="")+ # The vendor's brand domain (e.g. "linear.app") — resolved to an icon at render time via+ # the logo.dev proxy, so catalog entries need no committed image assets.+ icon_domain = models.CharField(max_length=253, blank=True, default="")category = models.CharField(max_length=20, choices=CATEGORY_CHOICES, default="dev", db_default="dev")oauth_issuer_url = models.URLField(max_length=2048, blank=True, default="")oauth_metadata = models.JSONField(default=dict, blank=True)@@ -90,6 +106,8 @@ class MCPServerTemplate(CreatedMetaFields, UpdatedMetaFields, UUIDModel):update_fields = kwargs.get("update_fields")if update_fields is None or "icon_key" in update_fields:self.icon_key = normalize_mcp_template_icon_key(self.icon_key or "")+ if update_fields is None or "icon_domain" in update_fields:+ self.icon_domain = normalize_mcp_icon_domain(self.icon_domain or "")super().save(*args, **kwargs)class Meta:diff --git a/products/mcp_store/backend/presentation/views.py b/products/mcp_store/backend/presentation/views.pyindex 9c88031010ce..d7b6322a8658 100644--- a/products/mcp_store/backend/presentation/views.py+++ b/products/mcp_store/backend/presentation/views.py@@ -7,6 +7,8 @@ from typing import Any, castfrom urllib.parse import urlencode, urlparsefrom django.conf import settings+from django.core.exceptions import ValidationError as DjangoValidationError+from django.core.validators import DomainNameValidatorfrom django.db import IntegrityError, transactionfrom django.db.models import Count, Q, QuerySetfrom django.http import HttpResponse@@ -25,6 +27,7 @@ from rest_framework.response import Responsefrom posthog.api.mixins import validated_requestfrom posthog.api.routing import TeamAndOrgViewSetMixin+from posthog.cdp.services.icons import CDPIconsServicefrom posthog.cloud_utils import is_dev_modefrom posthog.event_usage import report_user_actionfrom posthog.models import User@@ -159,10 +162,29 @@ def _template_uses_dcr(template: MCPServerTemplate) -> bool:return not credentials.get("client_id")+# The domain becomes a path segment of img.logo.dev/{domain} and part of the icon cache key.+# Django's validator enforces real hostname grammar (label lengths, total length cap, no+# schemes/paths/query junk), so the endpoint can't be steered off the logo host and callers+# can't mint oversized cache keys.+_ICON_DOMAIN_VALIDATOR = DomainNameValidator(accept_idna=False)++class MCPServerTemplateSerializer(serializers.ModelSerializer):+ icon_domain = serializers.CharField(+ read_only=True,+ help_text="The vendor's brand domain (e.g. 'linear.app'), resolved to an icon at render time "+ "via the logo.dev proxy endpoint. Empty when no brand icon is known.",+ )+ # Kept until PostHog Code stops reading it; drop together with the model column.+ icon_key = serializers.CharField(+ read_only=True,+ help_text="Deprecated: use icon_domain instead. Lowercase key for clients that still "+ "render bundled icon assets.",+ )+class Meta:model = MCPServerTemplate- fields = ["id", "name", "url", "docs_url", "description", "auth_type", "icon_key", "category"]+ fields = ["id", "name", "url", "docs_url", "description", "auth_type", "icon_key", "icon_domain", "category"]class MCPServerViewSet(TeamAndOrgViewSetMixin, mixins.ListModelMixin, viewsets.GenericViewSet):@@ -184,17 +206,48 @@ class MCPServerViewSet(TeamAndOrgViewSetMixin, mixins.ListModelMixin, viewsets.Gserializer = MCPServerTemplateSerializer(queryset, many=True)return Response({"results": serializer.data})+ # Image bytes for <img src>; deliberately outside the typed client surface.+ @extend_schema(exclude=True)+ @action(methods=["GET"], detail=False)+ def icon(self, request: Request, *args: Any, **kwargs: Any) -> HttpResponse:+ # Canonicalized (lowercase, no FQDN trailing dot) before validation so case variants+ # share one cache entry downstream.+ domain = request.GET.get("domain", "").strip().lower().rstrip(".")+ try:+ _ICON_DOMAIN_VALIDATOR(domain)+ except DjangoValidationError:+ raise serializers.ValidationError("domain must be a bare hostname, e.g. linear.app")+ theme = request.GET.get("theme")+ return CDPIconsService().get_icon_http_response(+ domain,+ # The theme becomes part of the icon cache key, so only known values pass through —+ # arbitrary strings would let one client mint unbounded cache entries.+ theme=theme if theme in ("light", "dark") else None,+ # ServerIcon renders its own generic fallback glyph on 404 instead of logo.dev's monogram.+ fallback="404",+ team_id=self.team_id,+ )+class MCPServerInstallationSerializer(serializers.ModelSerializer):template_id = serializers.UUIDField(source="template.id", read_only=True, allow_null=True, default=None)needs_reauth = serializers.SerializerMethodField()pending_oauth = serializers.SerializerMethodField()name = serializers.SerializerMethodField()+ icon_domain = serializers.CharField(+ source="template.icon_domain",+ read_only=True,+ default="",+ help_text="Brand domain from the linked template, rendered via the logo.dev icon proxy. "+ "Empty if custom install (no template).",+ )+ # Kept until PostHog Code stops reading it; drop together with the model column.icon_key = serializers.CharField(source="template.icon_key",read_only=True,default="",- help_text="Lowercase key from the linked template for brand icons. Empty if custom install (no template).",+ help_text="Deprecated: use icon_domain instead. Lowercase key from the linked template for "+ "clients that still render bundled icon assets. Empty if custom install (no template).",)proxy_url = serializers.SerializerMethodField()tool_count = serializers.SerializerMethodField(@@ -211,6 +264,7 @@ class MCPServerInstallationSerializer(serializers.ModelSerializer):"template_id","name","icon_key",+ "icon_domain","display_name","url","description",diff --git a/products/mcp_store/backend/test/test_api.py b/products/mcp_store/backend/test/test_api.pyindex 1a4a6f56ff1f..4836eb113a88 100644--- a/products/mcp_store/backend/test/test_api.py+++ b/products/mcp_store/backend/test/test_api.py@@ -4,6 +4,7 @@ from urllib.parse import parse_qs, urlparsefrom posthog.test.base import APIBaseTest, ClickhouseTestMixin, QueryMatchingTestfrom unittest.mock import patch+from django.http import HttpResponsefrom django.test import TestCasefrom parameterized import parameterized@@ -54,6 +55,30 @@ class TestMCPServerTemplateIconKeyNormalization(TestCase):template.refresh_from_db()assert template.icon_key == expected+ @parameterized.expand(+ [+ ("bare_hostname", "linear.app", "linear.app"),+ ("uppercase_with_scheme", "HTTPS://Linear.APP/", "linear.app"),+ ("whitespace", " notion.com ", "notion.com"),+ ("empty", "", ""),+ ("scheme_with_path", "https://linear.app/brand/assets", "linear.app"),+ ("bare_with_path", "linear.app/brand", "linear.app"),+ ("query_string", "linear.app?token=x", "linear.app"),+ ("port_and_trailing_dot", "linear.app.:8443", "linear.app"),+ ]+ )+ def test_save_normalizes_icon_domain(self, _name, raw, expected):+ # Admin- or sync-set values must land as bare lowercase hostnames, or the+ # logo.dev proxy URL the frontend builds from them 404s.+ template = MCPServerTemplate.objects.create(+ name=f"Test-domain-{_name}",+ url=f"https://mcp.example.com/domain-{_name}",+ auth_type="api_key",+ icon_domain=raw,+ )+ template.refresh_from_db()+ assert template.icon_domain == expected+class TestMCPServerAPI(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):def _create_active_template(self, **overrides) -> MCPServerTemplate:@@ -91,7 +116,17 @@ class TestMCPServerAPI(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):def test_list_servers_entries_match_serializer_schema(self):self._create_active_template()response = self.client.get(f"/api/environments/{self.team.id}/mcp_servers/")- expected_keys = {"id", "name", "url", "docs_url", "description", "auth_type", "icon_key", "category"}+ expected_keys = {+ "id",+ "name",+ "url",+ "docs_url",+ "description",+ "auth_type",+ "icon_key",+ "icon_domain",+ "category",+ }results = response.json()["results"]assert len(results) >= 1for entry in results:@@ -104,6 +139,42 @@ class TestMCPServerAPI(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):)assert response.status_code == status.HTTP_405_METHOD_NOT_ALLOWED+ @parameterized.expand(+ [+ ("path_traversal", "linear.app/../evil"),+ ("full_url", "https://evil.example"),+ ("query_injection", "linear.app?token=steal"),+ ("empty", ""),+ ("single_label", "localhost"),+ ("overlong_hostname", "a." * 127 + "com"),+ ]+ )+ def test_icon_rejects_non_hostname_domains(self, _name, bad_domain):+ # The domain param becomes a path segment of img.logo.dev/{domain} — anything but a bare+ # hostname must be rejected or the endpoint can be steered off the logo host.+ response = self.client.get(f"/api/environments/{self.team.id}/mcp_servers/icon/", data={"domain": bad_domain})+ assert response.status_code == status.HTTP_400_BAD_REQUEST++ @parameterized.expand(+ [+ ("no_theme", {"domain": "linear.app"}, None),+ ("dark_theme", {"domain": "linear.app", "theme": "dark"}, "dark"),+ ("unknown_theme_dropped", {"domain": "linear.app", "theme": "neon"}, None),+ ("case_and_fqdn_dot_canonicalized", {"domain": "LINEAR.APP."}, None),+ ]+ )+ def test_icon_proxies_valid_domain(self, _name, params, expected_theme):+ # Both halves of the icon cache key must stay canonical: unknown themes are dropped+ # rather than forwarded, and the domain is lowercased with any FQDN trailing dot+ # stripped so case variants can't mint separate cache entries.+ with patch("products.mcp_store.backend.presentation.views.CDPIconsService") as service:+ service.return_value.get_icon_http_response.return_value = HttpResponse(b"png", content_type="image/png")+ response = self.client.get(f"/api/environments/{self.team.id}/mcp_servers/icon/", data=params)+ assert response.status_code == status.HTTP_200_OK+ service.return_value.get_icon_http_response.assert_called_once_with(+ "linear.app", theme=expected_theme, fallback="404", team_id=self.team.id+ )+def test_unauthenticated_access(self):client = APIClient()response = client.get(f"/api/environments/{self.team.id}/mcp_servers/")@@ -134,17 +205,20 @@ class TestMCPServerInstallationAPI(ClickhouseTestMixin, APIBaseTest, QueryMatchiassert len(results) == 1assert results[0]["id"] == str(installation.id)assert results[0]["name"] == "Test Server"+ assert results[0]["icon_domain"] == ""assert results[0]["icon_key"] == ""- def test_list_installation_icon_key_from_template(self):- # Pass a non-normalized icon_key to confirm the model's save() normalizes it- # and the value flows through the serializer unchanged.+ def test_list_installation_icon_fields_from_template(self):+ # Pass non-normalized icon values to confirm the model's save() normalizes them and+ # both flow through the serializer — icon_key must stay exposed alongside icon_domain+ # until PostHog Code stops reading it.template = MCPServerTemplate.objects.create(name="PostHog MCP",url="https://mcp.notion.example/mcp",description="d",auth_type="api_key",is_active=True,+ icon_domain="HTTPS://Notion.example/",icon_key="PostHog MCP",)MCPServerInstallation.objects.create(@@ -157,6 +231,7 @@ class TestMCPServerInstallationAPI(ClickhouseTestMixin, APIBaseTest, QueryMatchi)response = self.client.get(f"/api/environments/{self.team.id}/mcp_server_installations/")assert response.status_code == status.HTTP_200_OK+ assert response.json()["results"][0]["icon_domain"] == "notion.example"assert response.json()["results"][0]["icon_key"] == "posthog_mcp"def test_uninstall_server(self):diff --git a/products/mcp_store/frontend/generated/api.schemas.ts b/products/mcp_store/frontend/generated/api.schemas.tsindex 80681192cf1b..96240fdcd880 100644--- a/products/mcp_store/frontend/generated/api.schemas.ts+++ b/products/mcp_store/frontend/generated/api.schemas.ts@@ -35,8 +35,10 @@ export interface MCPServerInstallationApi {/** @nullable */readonly template_id: string | nullreadonly name: string- /** Lowercase key from the linked template for brand icons. Empty if custom install (no template). */+ /** Deprecated: use icon_domain instead. Lowercase key from the linked template for clients that still render bundled icon assets. Empty if custom install (no template). */readonly icon_key: string+ /** Brand domain from the linked template, rendered via the logo.dev icon proxy. Empty if custom install (no template). */+ readonly icon_domain: string/** @maxLength 200 */display_name?: string/** @maxLength 2048 */@@ -227,8 +229,10 @@ export interface MCPServerTemplateApi {docs_url?: stringdescription?: stringauth_type?: MCPAuthTypeEnumApi- /** @maxLength 100 */- icon_key?: string+ /** Deprecated: use icon_domain instead. Lowercase key for clients that still render bundled icon assets. */+ readonly icon_key: string+ /** The vendor's brand domain (e.g. 'linear.app'), resolved to an icon at render time via the logo.dev proxy endpoint. Empty when no brand icon is known. */+ readonly icon_domain: stringcategory?: MCPServerTemplateCategoryEnumApi}diff --git a/products/mcp_store/frontend/scene/InstalledServersList.tsx b/products/mcp_store/frontend/scene/InstalledServersList.tsxindex ea088f1c953e..1fc600541b2f 100644--- a/products/mcp_store/frontend/scene/InstalledServersList.tsx+++ b/products/mcp_store/frontend/scene/InstalledServersList.tsx@@ -50,7 +50,11 @@ export function InstalledServersList(): JSX.Element | null {onClick={() => selectServer(installation.id)}><div className="flex items-center gap-3">- <ServerIcon iconKey={installation.icon_key} size={32} />+ <ServerIcon+ iconDomain={installation.icon_domain}+ serverUrl={installation.url}+ size={32}+ /><div className="flex-1 min-w-0"><h4 className="mb-0 truncate">{installation.name}</h4><div className="text-xs text-secondary truncate">diff --git a/products/mcp_store/frontend/scene/ServerCard.tsx b/products/mcp_store/frontend/scene/ServerCard.tsxindex 0f8a1bd145f0..ab2c93c94e98 100644--- a/products/mcp_store/frontend/scene/ServerCard.tsx+++ b/products/mcp_store/frontend/scene/ServerCard.tsx@@ -46,7 +46,7 @@ export function ServerCard({ server }: Props): JSX.Element {return (<LemonCard hoverEffect className="cursor-pointer" onClick={openDetail}><div className="flex gap-3 flex-row items-center">- <ServerIcon iconKey={server.icon_key} size={40} />+ <ServerIcon iconDomain={server.icon_domain} serverUrl={server.url} size={40} /><div className="flex-1 min-w-0"><h3 className="mb-0 truncate">{server.name}</h3>{server.description && (diff --git a/products/mcp_store/frontend/scene/ServerDetailPanel.tsx b/products/mcp_store/frontend/scene/ServerDetailPanel.tsxindex 6a6e95a87a3d..431bd429d861 100644--- a/products/mcp_store/frontend/scene/ServerDetailPanel.tsx+++ b/products/mcp_store/frontend/scene/ServerDetailPanel.tsx@@ -256,7 +256,8 @@ export function ServerDetailPanel({ installation, template }: Props): JSX.Elemenconst name = installation?.name ?? template?.name ?? ''const description = installation?.description ?? template?.description ?? ''const docsUrl = template?.docs_url ?? ''- const iconKey = installation?.icon_key ?? template?.icon_key ?? null+ const iconDomain = installation?.icon_domain ?? template?.icon_domain ?? null+ const serverUrl = installation?.url ?? template?.url ?? nullconst authType = installation?.auth_type ?? template?.auth_typeconst goBack = (): void => {@@ -271,7 +272,7 @@ export function ServerDetailPanel({ installation, template }: Props): JSX.Elemen</LemonButton><div className="flex gap-4 items-center">- <ServerIcon iconKey={iconKey} size={56} />+ <ServerIcon iconDomain={iconDomain} serverUrl={serverUrl} size={56} /><div className="flex-1 min-w-0"><div className="flex items-center gap-2 flex-wrap"><h1 className="mb-0">{name}</h1>diff --git a/products/mcp_store/frontend/scene/icons.tsx b/products/mcp_store/frontend/scene/icons.tsxindex dea56f800007..05f99af1d2b0 100644--- a/products/mcp_store/frontend/scene/icons.tsx+++ b/products/mcp_store/frontend/scene/icons.tsx@@ -1,103 +1,70 @@+import { useValues } from 'kea'+import { useState } from 'react'+import { IconServer } from '@posthog/icons'-import IconAirOpsService from 'public/services/airops.png'-import IconAtlassianService from 'public/services/atlassian.svg'-import IconAttioService from 'public/services/attio.png'-import IconBoxService from 'public/services/box.svg'-import IconBrowserbaseService from 'public/services/browserbase.svg'-import IconCanvaService from 'public/services/canva.svg'-import IconCircleService from 'public/services/circle.png'-import IconCiscoThousandEyesService from 'public/services/cisco_thousandeyes.png'-import IconClerkService from 'public/services/clerk.svg'-import IconClickHouseService from 'public/services/clickhouse.svg'-import IconCloudflareService from 'public/services/cloudflare.svg'-import IconContext7Service from 'public/services/context7.svg'-import IconDatadogService from 'public/services/datadog.svg'-import IconFigmaService from 'public/services/figma.svg'-import IconFiretigerService from 'public/services/firetiger.svg'-import IconGitHubService from 'public/services/github.svg'-import IconGitLabService from 'public/services/gitlab.svg'-import IconHexService from 'public/services/hex.svg'-import IconHubSpotService from 'public/services/hubspot.png'-import IconLaunchDarklyService from 'public/services/launchdarkly.png'-import IconLinearService from 'public/services/linear.svg'-import IconMondayService from 'public/services/monday.svg'-import IconNeonService from 'public/services/neon.svg'-import IconNotionService from 'public/services/notion.svg'-import IconPagerDutyService from 'public/services/pagerduty.svg'-import IconPlanetScaleService from 'public/services/planetscale.svg'-import IconPostmanService from 'public/services/postman.svg'-import IconPrismaService from 'public/services/prisma.svg'-import IconRenderService from 'public/services/render.svg'-import IconSanityService from 'public/services/sanity.svg'-import IconSentryService from 'public/services/sentry.svg'-import IconSlackService from 'public/services/slack.png'-import IconStripeService from 'public/services/stripe.png'-import IconSupabaseService from 'public/services/supabase.svg'-import IconSvelteService from 'public/services/svelte.png'-import IconWixService from 'public/services/wix.png'+import { themeLogic } from '~/layout/navigation-3000/themeLogic'++// Machine-facing subdomains stripped when deriving a brand domain from a server URL, so a custom+// install at https://mcp.linear.app/mcp still resolves the vendor's brand (linear.app).+const STRIPPED_SUBDOMAINS = ['mcp.', 'api.', 'www.']-// Templates without an asset here use the generic server icon.-const SERVER_ICONS: Record<string, string> = {- airops: IconAirOpsService,- atlassian: IconAtlassianService,- attio: IconAttioService,- box: IconBoxService,- browserbase: IconBrowserbaseService,- canva: IconCanvaService,- cisco_thousandeyes: IconCiscoThousandEyesService,- circle: IconCircleService,- clerk: IconClerkService,- clickhouse: IconClickHouseService,- cloudflare: IconCloudflareService,- context7: IconContext7Service,- datadog: IconDatadogService,- figma: IconFigmaService,- firetiger: IconFiretigerService,- github: IconGitHubService,- gitlab: IconGitLabService,- hex: IconHexService,- hubspot: IconHubSpotService,- launchdarkly: IconLaunchDarklyService,- linear: IconLinearService,- monday: IconMondayService,- neon: IconNeonService,- notion: IconNotionService,- pagerduty: IconPagerDutyService,- planetscale: IconPlanetScaleService,- postman: IconPostmanService,- prisma: IconPrismaService,- render: IconRenderService,- sanity: IconSanityService,- sentry: IconSentryService,- slack: IconSlackService,- stripe: IconStripeService,- supabase: IconSupabaseService,- svelte: IconSvelteService,- wix: IconWixService,+export function iconDomainFromServerUrl(serverUrl: string | null | undefined): string | null {+ if (!serverUrl) {+ return null+ }+ let host: string+ try {+ host = new URL(serverUrl).hostname.toLowerCase()+ } catch {+ return null+ }+ for (const prefix of STRIPPED_SUBDOMAINS) {+ if (host.startsWith(prefix) && host.split('.').length >= 3) {+ return host.slice(prefix.length)+ }+ }+ return host.includes('.') ? host : null}-export function resolveServerIcon(iconKey: string | null | undefined): string | undefined {- return iconKey ? SERVER_ICONS[iconKey] : undefined+export function serverIconUrl(iconDomain: string, theme?: 'light' | 'dark'): string {+ const themeSuffix = theme ? `&theme=${theme}` : ''+ return `/api/projects/@current/mcp_servers/icon/?domain=${encodeURIComponent(iconDomain)}${themeSuffix}`}interface ServerIconProps {- iconKey?: string | null+ /** The template's brand domain (icon_domain). Falls back to deriving one from serverUrl. */+ iconDomain?: string | null+ /** The MCP server URL — lets custom installs without a template still get a brand icon. */+ serverUrl?: string | nullsize?: numberclassName?: string}-export function ServerIcon({ iconKey, size = 32, className }: ServerIconProps): JSX.Element {- const src = resolveServerIcon(iconKey)+export function ServerIcon({ iconDomain, serverUrl, size = 32, className }: ServerIconProps): JSX.Element {+ const { isDarkModeOn } = useValues(themeLogic)+ const domain = iconDomain || iconDomainFromServerUrl(serverUrl)+ // logo.dev picks the logo variant suited to the active background theme.+ const theme = isDarkModeOn ? 'dark' : 'light'+ // Failure latches per (domain, theme) — the unit the request URL varies over — so a failed+ // load in one theme doesn't blank the other, and a theme flip retries after a transient error+ // (cheap: definitive misses are cached server-side for a day).+ const iconKey = `${domain}|${theme}`+ const [failedIconKey, setFailedIconKey] = useState<string | null>(null)const dimension = `${size}px`- if (src) {+ if (domain && failedIconKey !== iconKey) {return (<divclassName={`flex items-center justify-center overflow-hidden rounded-[4px] ${className ?? ''}`}// Fixed dimensions prevent layout shift during icon load.style={{ width: dimension, height: dimension }}>- <img src={src} alt="" style={{ width: dimension, height: dimension }} />+ <img+ src={serverIconUrl(domain, theme)}+ alt=""+ style={{ width: dimension, height: dimension }}+ onError={() => setFailedIconKey(iconKey)}+ /></div>)}diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 9310ed87fa1e..a774582befd7 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -35199,8 +35199,10 @@ export namespace Schemas {/** @nullable */readonly template_id: string | null;readonly name: string;- /** Lowercase key from the linked template for brand icons. Empty if custom install (no template). */+ /** Deprecated: use icon_domain instead. Lowercase key from the linked template for clients that still render bundled icon assets. Empty if custom install (no template). */readonly icon_key: string;+ /** Brand domain from the linked template, rendered via the logo.dev icon proxy. Empty if custom install (no template). */+ readonly icon_domain: string;/** @maxLength 200 */display_name?: string;/** @maxLength 2048 */@@ -35280,8 +35282,10 @@ export namespace Schemas {docs_url?: string;description?: string;auth_type?: MCPAuthTypeEnum;- /** @maxLength 100 */- icon_key?: string;+ /** Deprecated: use icon_domain instead. Lowercase key for clients that still render bundled icon assets. */+ readonly icon_key: string;+ /** The vendor's brand domain (e.g. 'linear.app'), resolved to an icon at render time via the logo.dev proxy endpoint. Empty when no brand icon is known. */+ readonly icon_domain: string;category?: MCPServerTemplateCategoryEnum;}diff --git a/tach.toml b/tach.tomlindex 8712ed35a8ab..8ce61af20a7f 100644--- a/tach.toml+++ b/tach.toml@@ -1040,6 +1040,7 @@ layer = "modules"expose = ["backend\\.logic\\.placeholder.*","backend\\.models.*",+ "backend\\.property_type.*",]from = ["products.event_definitions",