Skip to content

Support host-specific _meta.ui.domain with auto-computed defaults#22

Merged
abewheel merged 2 commits intomainfrom
abewheel/meta-ui-domain
Mar 25, 2026
Merged

Support host-specific _meta.ui.domain with auto-computed defaults#22
abewheel merged 2 commits intomainfrom
abewheel/meta-ui-domain

Conversation

@abewheel
Copy link
Copy Markdown
Contributor

@abewheel abewheel commented Mar 25, 2026

Summary

  • Add resolve-domain.ts with domain resolution: maps clientInfo.name to host-specific sandbox domains (string or Record<host, domain> with default fallback)
  • Auto-compute default domains from the server URL for known hosts (openai-mcp, chatgpt-*, claude) so the ChatGPT "Widget domain is not set" warning doesn't appear out of the box
  • Update both dev and production servers to resolve domain maps after MCP initialization and patch listing-level _meta via RegisteredResource.update() so resources/list includes the domain
  • Add serverUrl option to ProductionServerConfig and WebHandlerConfig for production auto-computation
  • Extend ResourceConfig type to accept DomainConfig (string or map) for the domain field
  • 29 new unit tests covering resolution, computation, and injection

Test plan

  • pnpm --filter sunpeak validate passes (typecheck, lint, 233 tests, build)
  • sunpeak dev → connect from ChatGPT → verify domain appears in resource metadata and warning is gone
  • Verify domain map resolution with explicit per-host values in a resource config

Add domain resolution that maps clientInfo.name to host-specific sandbox
domains. Resources can declare a domain map (keyed by host name with a
default fallback) or a plain string. Both dev and production servers
resolve the map after MCP initialization and update listing-level _meta
so hosts like ChatGPT see the domain in resources/list.

When resources don't set a domain, the server auto-computes one from the
server URL for known hosts (openai-mcp, chatgpt-*, claude), eliminating
the "Widget domain is not set" warning in ChatGPT out of the box.
@abewheel abewheel merged commit 5e87049 into main Mar 25, 2026
3 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.

1 participant