Skip to content

feat(api): add spec.iconUrl to catalog resources - #604

Open
Charlesthebird wants to merge 2 commits into
mainfrom
Charlesthebird/iconUrlSpec
Open

feat(api): add spec.iconUrl to catalog resources#604
Charlesthebird wants to merge 2 commits into
mainfrom
Charlesthebird/iconUrlSpec

Conversation

@Charlesthebird

@Charlesthebird Charlesthebird commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Description

Motivation: a catalog UI needs somewhere to record the image it shows for a
resource. That was being carried as a well-known annotation, which works but
leaves the contract untyped, invisible in the OpenAPI schema, and unvalidated on
write. A spec field is the right home for it.

What changed: an optional spec.iconUrl on Agent, MCPServer, Skill,
Prompt, and Plugin — all five kinds a catalog lists, so a UI does not have
to read the icon from a different place depending on the kind.

validateIconURL accepts an absolute https:// URL or a path on the serving
UI's own origin, and rejects everything else. The value is rendered as an image
source, which is what each rejection is about:

  • plain http:// is blocked as mixed content whenever the UI is served over
    HTTPS, so it would silently never render
  • javascript: / data: would make the field an injection point
  • a scheme-relative //other-host/path would smuggle an external host past a
    naive "starts with a slash" check

Existing resources are unaffected — the field is optional and omitted from the
serialized spec when empty, so re-applying unchanged intent stays a no-op.


🤖 written by Claude (start)

Change Type

/kind feature

Changelog

Agent, MCPServer, Skill, Prompt, and Plugin resources now accept an optional spec.iconUrl, the image a catalog UI displays for the resource. The value must be an absolute https:// URL or a root-relative path on the serving UI's origin.

Additional Notes

openapi.yaml and ui/lib/api/types.gen.ts are regenerated, not hand-edited.

Existing resources are unaffected: the field is optional and omitted from the serialized spec when empty, so re-applying unchanged intent stays a no-op.

A downstream consumer wants this to replace an icon-url annotation it currently reads; that change is waiting on this landing plus a patch release to bump against.


🤖 written by Claude (end)

Agent, MCPServer, Skill, Prompt, and Plugin gain an optional
spec.iconUrl — the image a catalog UI shows for the resource. It is a
first-class spec field rather than a well-known annotation so the
contract is typed, discoverable in the OpenAPI schema, and validated on
write.

validateIconURL accepts an absolute https:// URL or a path on the
serving UI's own origin, and rejects everything else. The value is
rendered as an image source, so plain http:// would be blocked as mixed
content, javascript:/data: would make the field an injection point, and
a scheme-relative //host/path would smuggle an external host past a
naive "starts with a slash" check.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Signed-off-by: Nicholas Bucher <behappy54321@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant