docs(csp-cors): note that a rejected ui.domain stops the app rendering - #735
Open
Booyaka101 wants to merge 1 commit into
Open
docs(csp-cors): note that a rejected ui.domain stops the app rendering#735Booyaka101 wants to merge 1 commit into
Booyaka101 wants to merge 1 commit into
Conversation
The docs introduce _meta.ui.domain as a way to get a stable origin for CORS allowlisting, and modelcontextprotocol#309 clarified that its format is host-dependent. Neither says what happens when the value isn't one the host accepts: the app doesn't fall back to the default sandbox origin, it doesn't render at all. Because the field is documented as an optional CORS convenience, it reads as safe to set speculatively. Adding it while hashing an endpoint URL spelled slightly differently from the one the client connected with turns a working app into one that silently doesn't render. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Summary
docs/csp-cors.mdintroduces_meta.ui.domainas the way to give an app a stable origin for an API server to allowlist, and #309 clarified that its format is host-dependent. Neither says what happens when the value isn't one the host accepts, and the answer isn't the intuitive one: the app doesn't fall back to the default sandbox origin, it doesn't render at all.Why this is worth documenting
Measured against claude.ai web — one probe server, one endpoint,
_meta.ui.domainas the only variable between arms, 36 renders each in a fresh conversation:_meta.ui.domainsha256(endpoint)[:32] + ".claudemcpcontent.com"Because the field is documented as a CORS convenience and marked optional, it reads as safe to set speculatively. It isn't: a server that adds it while hashing an endpoint URL spelled slightly differently from the one the client connected with — a trailing slash, a missing path segment, a different scheme — converts a working app into one that doesn't render, and the surfaced error is generic enough to send you looking somewhere else entirely.
This is being hit in the wild. #671 has a widely-upvoted comment recommending that servers add this field to fix non-rendering apps; following it with a slightly wrong endpoint string produces exactly this failure. Full measurements and method are in anthropics/claude-ai-mcp#165.
Change
One
[!IMPORTANT]callout indocs/csp-cors.md, next to the existing note and matching the callout style already used in the docs. No code or behaviour change.npx prettier --check docs/csp-cors.mdpasses.Happy to mirror the same note on
McpUiResourceMeta.domaininsrc/spec.types.ts(and the spec.mdx) if you'd rather it live with the type — I kept this to the docs page to stay atomic, since #309 already covers the type-level wording.