feat: implement host-driven container dimension management via Resize…#2057
Conversation
…Observer and host-context-changed notification
There was a problem hiding this comment.
Code Review
This pull request implements host-driven container dimensions aligning with the Model Context Protocol Apps Specification. It updates pong_app.html to dynamically adjust its dimensions based on host context notifications, implements a ResizeObserver in mcp-app.ts to monitor and propagate iframe dimension changes, and documents the new ui/notifications/host-context-changed notification. The review feedback suggests: 1) adding a fallback to default dimensions in pong_app.html for backward compatibility, 2) setting the initial host context synchronously before connecting the bridge to ensure dimensions are available during the handshake, and 3) using strict type checks for dimensions to safely handle zero values.
…pp configurations
…zation and numeric validation
…Observer and host-context-changed notification
Description
Update MCP Apps spec to allow host-controlled resizing. I.e., the Host can inform the app what window size it has room for it to display so that the app can adjust it size based on the host context to fit snuggly.
The protocol leverages the MCP's official protocol https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/2026-01-26/apps.mdx
Pre-launch Checklist
One time:
For this PR:
If you need help, consider asking for advice on the discussion board.