feat(mcp-servers): resolve store icons from icon_domain via the logo.dev proxy#3585
Draft
cvolzer3 wants to merge 1 commit into
Draft
feat(mcp-servers): resolve store icons from icon_domain via the logo.dev proxy#3585cvolzer3 wants to merge 1 commit into
cvolzer3 wants to merge 1 commit into
Conversation
…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
|
Merging to
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 |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_keyasset slugs with anicon_domainfield resolved through a new authenticatedmcp_servers/icon/proxy endpoint, and keepsicon_keyonly until PostHog Code stops reading it. This app still renders MCP store icons from bundled image assets keyed byicon_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_domainso the deprecatedicon_keyfield and column can be dropped.Changes
@posthog/api-client:icon_domainon the MCP template/installation types, plusgetMcpServerIconUrl()— 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 tonulland the UI renders its generic glyph.@posthog/core:iconDomainFromServerUrl()derives a best-effort brand domain from a server URL (stripsmcp./api./www.), so custom installs without a template get real icons;resolveServerDetailsresolvesiconDomain/serverUrlinstead oficonKey.@posthog/ui:ServerIconresolves 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 theBRAND_ICONSmap are gone (claude.svgstays — used byContinueCliSessions).apps/mobile: same migration for the parallel mobile implementation (RNImagewith anAuthorizationheader); bundled assets andSERVER_LOGOSremoved.Nothing in the app reads
icon_keyanymore (the generated types keep the field until the backend drops it). Before the backend deploys, responses lackicon_domainand 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:
iconDomainFromServerUrl(core + mobile mirror),getMcpServerIconUrl(proxy URL shape, theme param, 404 → null, non-404 propagates).resolveServerDetailstests for theiconDomain/serverUrlresolution.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
Created with PostHog Code