Skip to content

h5p-mcp-app: the card's own origin in each chat's form - #330

Merged
alekswebnet merged 2 commits into
mainfrom
fix/mcp-app-claude-domain
Dec 2, 2026
Merged

alekswebnet merged 2 commits into
mainfrom
fix/mcp-app-claude-domain

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #329. In Claude, a server given --domain showed [mcp-ext-apps-host] ui.domain validation failed and no card: the option, ChatGPT's origin, was written to _meta.ui.domain too, which Claude accepts only in its own form. Claude's docs: a bad value shows an error in place of the app, and a site framed in the card keeps localStorage only with a valid one.

Changes

  • _meta.ui.domain is Claude's: the first 32 hex of the SHA-256 of the connector's address with .claudemcpcontent.com, computed from the address each request was sent to (<origin>/mcp, query and all).
  • domain stays ChatGPT's, written as openai/widgetDomain alone.
  • The card's address hashes the card and its policy, Claude's origin aside, so a chat that keeps the card by its address gets the changed policy; another connector address for the same site keeps the card's address.
  • The JSDoc, --help, the README and the rule in design/mcp.md say so; the domain check keeps its reason.

Verification

  • pnpm --filter @missing-elements/h5p-mcp-app test: 33 passed. Typecheck, pnpm comments, and oxlint with chore: oxlint with type-aware rules, in CI (#325) #326's config: clean.

  • tests/app.test.ts: Claude's origin for https://example.com/mcp is the one Claude's documentation gives, c3d80a4ed901ee05b21755a88273b4a4.claudemcpcontent.com; in the listing and on the card, with and without domain; from the command's own address.

  • By hand, once released and deployed: the card shows in Claude, and plays in it where Claude lets the play page's origin in; ChatGPT plays as before.

  • Tests added or updated where behavior changed

  • Documentation updated where public behavior or deployment changed

  • Relevant type checks, tests, and builds pass

  • No security-sensitive details or credentials are included

Screenshots or reproduction

Add the server as a custom connector in Claude web with --domain https://lessons.example, and ask it to play an activity: the console shows the validation error and no card. With this change the card's ui.domain is Claude's for the connector's address.


Summary by cubic

Makes the card's domain option ChatGPT-only, and gives Claude the origin it expects, so a card configured with a domain no longer shows an error in Claude.

  • domain is written only as openai/widgetDomain, which ChatGPT reads; _meta.ui.domain is now always Claude's hash of the connector's address it was asked at, which also lets a site framed in the card keep localStorage.
  • The card's address now hashes its policy, so a policy change gives the card a new address.
  • Updates the JSDoc, --help output, README, design/mcp.md, and tests.

Written for commit 163513e. Summary will update on new commits.

View guided diff Turn on auto-fix

Claude refuses a card whose _meta.ui.domain is not its own hash of the
connector's address. domain is now written only as openai/widgetDomain,
which ChatGPT reads; other chats pick their own.
Claude's ui.domain is the first 32 hex of the SHA-256 of the connector's
address with .claudemcpcontent.com, computed from the address each
request was sent to; with it, a site framed in the card may keep
localStorage. ChatGPT's stays domain, as openai/widgetDomain. The
card's address now hashes its policy too, Claude's origin aside, so a
chat that keeps the card by its address gets the changed one.
@alekswebnet
alekswebnet force-pushed the fix/mcp-app-claude-domain branch from 19ff71a to 163513e Compare December 2, 2026 10:28
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 14 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e834ada and 163513e.

Files selected for processing: 5

  • design/mcp.md
  • packages/mcp-app/README.md
  • packages/mcp-app/bin/h5p-mcp-app.mjs
  • packages/mcp-app/lib/app.mjs
  • packages/mcp-app/tests/app.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@alekswebnet alekswebnet changed the title h5p-mcp-app: the card's domain is ChatGPT's alone h5p-mcp-app: the card's own origin in each chat's form Dec 2, 2026
@alekswebnet

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@alekswebnet
alekswebnet merged commit a71068c into main Dec 2, 2026
11 checks passed
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.

h5p-mcp-app: Claude rejects the card when --domain is set

1 participant