Summary
Deliver the full hostContext to MCP App views and keep it live:
- Initial
hostContext carries theme, styles (Mantine design tokens), displayMode, availableDisplayModes, and containerDimensions (today: only theme).
- Live changes — theme flip, container resize, maximize — push to the running view via the SDK's
sendHostContextChange(patch) (no hand-maintained snapshot ref).
Why
hostContext is how a widget adapts to its host; carrying only theme means widgets tested against the inspector never see the fields real hosts send. Using the SDK's patch mechanism keeps us aligned with @modelcontextprotocol/ext-apps.
Reference implementation (PR #1510)
Re-implement informed by these changes at 33fac3f:
Depends on
- hostContext utilities (
AppRenderer/hostContext.ts)
- CSP enforcement + resource-error surfacing in the bridge factory (same files; land first)
Wave 2 lane — sequential with the other AppRenderer/AppsScreen issues.
Notes
- Manual check: theme toggle in the inspector should deliver
host-context-changed to a running mcp_app_demo widget.
- Coverage gate ≥90 on all four dimensions.
Part of the PR #1510 decomposition (see tracking issue).
Summary
Deliver the full
hostContextto MCP App views and keep it live:hostContextcarriestheme,styles(Mantine design tokens),displayMode,availableDisplayModes, andcontainerDimensions(today: onlytheme).sendHostContextChange(patch)(no hand-maintained snapshot ref).Why
hostContextis how a widget adapts to its host; carrying onlythememeans widgets tested against the inspector never see the fields real hosts send. Using the SDK's patch mechanism keeps us aligned with@modelcontextprotocol/ext-apps.Reference implementation (PR #1510)
Re-implement informed by these changes at
33fac3f:sendHostContextChangepushesDepends on
AppRenderer/hostContext.ts)Wave 2 lane — sequential with the other AppRenderer/AppsScreen issues.
Notes
host-context-changedto a runningmcp_app_demowidget.Part of the PR #1510 decomposition (see tracking issue).