Files
Andrew Harvard 6478d46f12 feat(mcp-apps): improve communication protocol compliance (Section 4)
This commit improves MCP Apps compliance with the SEP-1865 specification
(2026-01-26 Stable), specifically Section 4: Communication Protocol.

## Changes Overview

### 1. Sandbox Proxy Notification Rename (Section 4.4)
- Renamed 'ui/notifications/sandbox-ready' to 'ui/notifications/sandbox-proxy-ready'
- Files: mcp_app_proxy.html, useSandboxBridge.ts

### 2. Protocol Version & Host Capabilities (Section 5)
- Updated protocolVersion from '2025-06-18' to '2026-01-26'
- Restructured hostCapabilities to match spec:
  - Before: { links: true, messages: true }
  - After: { openLinks: {}, messages: {}, serverTools: {}, serverResources: {}, logging: {} }
- File: useSandboxBridge.ts

### 3. Container Dimensions (Section 6)
- Replaced 'viewport' with 'containerDimensions' per spec
- Added ContainerDimensions type supporting fixed (width/height) and
  flexible (maxWidth/maxHeight) dimension modes
- Updated ui/initialize response and host-context-changed notifications
- Files: types.ts, useSandboxBridge.ts

### 4. Display Mode Types (Section 7)
- Fixed DisplayMode type from 'inline' | 'fullscreen' | 'standalone'
  to spec-compliant 'inline' | 'fullscreen' | 'pip'
- File: types.ts

### 5. ui/request-display-mode Handler (Section 4.2)
- Added handler for View-initiated display mode change requests
- Validates requested mode against:
  - Host's supported modes (currently only 'inline')
  - App's declared availableDisplayModes (from appCapabilities)
- Returns actual mode set (may differ from requested)
- Sends host-context-changed notification if mode changes
- File: useSandboxBridge.ts

### 6. App Capabilities Parsing (Section 10)
- Added AppCapabilities interface for View-declared capabilities
- Parse and store appCapabilities from View's ui/initialize request
- Used for validating display mode requests
- Files: types.ts, useSandboxBridge.ts

## What's NOT included (future work)

- ui/update-model-context: Requires backend integration
- Actual fullscreen/pip implementation: Only 'inline' supported
- toolInfo in hostContext: Requires tool metadata plumbing
- styles.variables (theming): Requires CSS variable mapping

## Testing

- npm run lint: passes
- npx tsc --noEmit: passes

Spec reference: https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/2026-01-26/apps.mdx
2026-02-05 09:39:29 -05:00
..