Skip to content

refactor: handle missing publisher-provided in _meta server#427

Merged
peppescg merged 1 commit intomainfrom
handle-missing-mcp-meta
Mar 16, 2026
Merged

refactor: handle missing publisher-provided in _meta server#427
peppescg merged 1 commit intomainfrom
handle-missing-mcp-meta

Conversation

@peppescg
Copy link
Collaborator

Handle missing meta info server._meta?.["io.modelcontextprotocol.registry/publisher-provided"]?.[ "io.github.stacklok" ]; in the server detail

This lead to zod mismatch error type, non a visibile error in the page.

Detail here https://discord.com/channels/1184987096302239844/1450739318376103998/1483027552393101403

@peppescg peppescg self-assigned this Mar 16, 2026
Copilot AI review requested due to automatic review settings March 16, 2026 10:54
@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Mar 16, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Stacklok metadata parsing so server detail rendering can gracefully handle servers that don’t include the io.modelcontextprotocol.registry/publisher-provided metadata block, avoiding downstream schema/metadata handling issues.

Changes:

  • Update parseStacklokMeta to return null when Stacklok publisher metadata is absent.
  • Adjust utility helpers to handle null parse results safely.
  • Add Vitest coverage for missing vs valid Stacklok metadata parsing.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/lib/utils.ts Treat parseStacklokMeta returning null as “no tools / not virtual” instead of dereferencing.
src/lib/schemas/server-meta.ts Return null when Stacklok publisher-provided metadata is missing before running Zod validation.
src/lib/schemas/server-meta.test.ts Add tests covering missing Stacklok metadata and successful parsing with valid metadata.

@peppescg peppescg changed the title refactor: handle missing io.modelcontextprotocol.registry/publisher-provided _meta from serve refactor: handle missing publisher-provided in _meta server Mar 16, 2026
Copy link

@samuv samuv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@peppescg peppescg merged commit 973fbad into main Mar 16, 2026
13 of 15 checks passed
@peppescg peppescg deleted the handle-missing-mcp-meta branch March 16, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants