Skip to content

feat(native): reach MCP app frame parity (TR-MCPAPP) - #366

Merged
rynfar merged 2 commits into
nativefrom
nw/98-tr-mcpapp
Nov 14, 2026
Merged

rynfar merged 2 commits into
nativefrom
nw/98-tr-mcpapp

Conversation

@rynfar

@rynfar rynfar commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Brings the native GPUI MCP app frame (TR-MCPAPP) to parity with web (apps/web/src/components/chat/McpAppFrame.tsx, packages/client-runtime/src/mcpApps, packages/shared/src/mcpApp.ts).

Closes #98
Ref #244

Summary

  • Core protocol & host (crates/core/src/mcp_apps/, examples/mcp_app_host.rs): Added sandbox permissions (camera, microphone, geolocation, clipboardWrite) advertised in ui/initialize alongside message, updateModelContext, and downloadFile; added availableDisplayModes, Operation::{SendMessage, UpdateModelContext, RequestDisplayMode, DownloadFile}, Action::ExitFullscreen, 25 MiB / 200-char download guards (DownloadItem::{Embedded, Link}), size-changed suppression in fullscreen, and request-teardown exiting fullscreen before closing.
  • Client bridge (crates/client/src/mcp_apps.rs): Added ToolInfo.title, call_tool_unchecked, ResolvedDownload / DownloadError, and resolve_downloads with 25 MiB and empty-file validation.
  • WebView, Dialog, Workspace, ThreadView & Transcript UI (crates/app/src/):
    • Added WebView::set_layer, WebView::is_shown, and set_dark (webview/mod.rs), plus cancellable confirmation support in dialog.rs.
    • Preserved the running WebView across inline/fullscreen reparenting (McpFrame + McpFullscreen Layer::Modal portal in workspace.rs), added is_follow_paused hook in thread_view.rs, kept allow_popups: false, synced live theme/context revisions, stepped aside cleanly for awaiting_user approvals or confirmation dialogs, and marked TR-MCPAPP done in apps/native/parity/LEDGER.md.

Verification

  • cargo test -p t3-core -p t3-client: t3-client 109/109 passed; t3-core 1346/1346 unit + 8/8 conformance passed
  • cargo run -p t3-core --example mcp_app_host: exited 0
  • cargo clippy --workspace --all-targets -- -D warnings: passed cleanly
  • cargo test -p t3-native --features snapshot -- --test-threads=1 (copied binary outside Cargo lock, clean temp T3_NATIVE_HOME): mcp_app:: 2/2, webview:: 5/5, thread_view:: 15/15, dialog:: 4/4 passed
  • node --test apps/native/parity/sync.test.ts: 42/42 passed
  • vp fmt --check apps/native/parity/LEDGER.md: passed

Snapshots (1440x900 via --mcp-fixture)

Note: GPUI's offscreen snapshot renderer (webview::is_offscreen()) uses the GPUI surface without an AppKit NSWindow, so --snapshot captures the inline McpFrame card (prefersBorder: true) and closed state (T3_NATIVE_MCP_TEARDOWN_AUDIT=1).

Dark

TR-MCPAPP Dark

Light

TR-MCPAPP Light

Closed / Teardown Audit

TR-MCPAPP Closed

Brings the native GPUI MCP app frame (`TR-MCPAPP`) to full feature parity with web (`apps/web/src/components/chat/McpAppFrame.tsx`, `packages/client-runtime/src/mcpApps`, `packages/shared/src/mcpApp.ts`): sandbox permissions, fullscreen portal preserving running WebKit state across reparenting, `ui/message`, `ui/update-model-context`, `ui/download-file`, live theme/context sync, confirmation dialogs, and teardown handling.

Closes #98
Ref #244
…and treat download read failures as tool errors
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