Skip to content

feat(mcp-servers): resolve store icons from icon_domain via the logo.dev proxy#3585

Draft
cvolzer3 wants to merge 1 commit into
mainfrom
posthog-code/mcp-store-icon-domain
Draft

feat(mcp-servers): resolve store icons from icon_domain via the logo.dev proxy#3585
cvolzer3 wants to merge 1 commit into
mainfrom
posthog-code/mcp-store-icon-domain

Conversation

@cvolzer3

Copy link
Copy Markdown
Contributor

Problem

The MCP store catalog is moving to code-defined entries with logo.dev-resolved icons (PostHog/posthog PR stack ending in #70162). PostHog/posthog#70159 replaces the icon_key asset slugs with an icon_domain field resolved through a new authenticated mcp_servers/icon/ proxy endpoint, and keeps icon_key only until PostHog Code stops reading it. This app still renders MCP store icons from bundled image assets keyed by icon_key (three parallel copies: desktop/web UI and mobile), which means every new catalog entry needs committed assets here.

Why: the approved upstream stack is about to merge, and this app must switch to icon_domain so the deprecated icon_key field and column can be dropped.

Changes

  • @posthog/api-client: icon_domain on the MCP template/installation types, plus getMcpServerIconUrl() — the app authenticates with bearer tokens (no cookies), so instead of pointing <img src> at the API like the PostHog web frontend does, icon bytes are fetched through the authenticated fetcher and rendered via an object URL. The endpoint's 404 (no icon known, or self-hosted without a logo.dev token) resolves to null and the UI renders its generic glyph.
  • @posthog/core: iconDomainFromServerUrl() derives a best-effort brand domain from a server URL (strips mcp./api./www.), so custom installs without a template get real icons; resolveServerDetails resolves iconDomain/serverUrl instead of iconKey.
  • @posthog/ui: ServerIcon resolves icons through the proxy with the active theme (light/dark), caching per (domain, theme) and latching load failures per (domain, theme) so a theme flip retries. The 37 bundled service assets and the BRAND_ICONS map are gone (claude.svg stays — used by ContinueCliSessions).
  • apps/mobile: same migration for the parallel mobile implementation (RN Image with an Authorization header); bundled assets and SERVER_LOGOS removed.

Nothing in the app reads icon_key anymore (the generated types keep the field until the backend drops it). Before the backend deploys, responses lack icon_domain and the icon endpoint 404s — every fallback chain tolerates that and degrades to the generic glyph.

How did you test this?

Automated only, no manual testing:

  • New unit tests: iconDomainFromServerUrl (core + mobile mirror), getMcpServerIconUrl (proxy URL shape, theme param, 404 → null, non-404 propagates).
  • Updated resolveServerDetails tests for the iconDomain/serverUrl resolution.
  • Full pnpm typecheck (24/24), biome lint packages/core (zero noRestrictedImports), and unit suites for core (2448), ui (1762), api-client (100), mobile pass.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

…dev proxy

The MCP store backend is replacing bundled icon assets with an icon_domain
field per template, resolved at render time through the authenticated
mcp_servers/icon/ proxy (PostHog/posthog#70159). Stop reading icon_key
everywhere so the backend can drop the field:

- api-client: add icon_domain to the generated MCP types and a
  getMcpServerIconUrl method (authenticated fetch -> object URL; the
  endpoint's 404 means "no icon", surfaced as null).
- core: iconDomainFromServerUrl derives a best-effort brand domain from a
  server URL (strips mcp./api./www.) so custom installs get icons too;
  resolveServerDetails now resolves iconDomain + serverUrl.
- ui: ServerIcon fetches through the proxy with the active theme, latching
  failures per (domain, theme); bundled assets and BRAND_ICONS removed
  (claude.svg stays, used by ContinueCliSessions).
- mobile: same migration on the hand-mirrored types and ServerIcon (RN Image
  with Authorization header); bundled assets and SERVER_LOGOS removed.

Generated-By: PostHog Code
Task-Id: 2f81c64d-a1c4-483e-affd-a9b355756737
@trunk-io

trunk-io Bot commented Jul 20, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 21b754d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant