Repository navigation
feat(native): render inline MCP apps with a Rust host bridge - #104
Merged
Merged
Conversation
This was referenced Nov 3, 2026
Open
rynfar
force-pushed
the
nw/98-mcp-apps
branch
from
November 3, 2026 05:33
b4710ff to
e33cf97
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MCP app tool results currently remain generic tool rows in the native transcript. This ports TR-MCPAPP's inline first slice, retaining the producing environment, thread and item when forwarding app requests.
The protocol host is pure Rust in
crates/core/src/mcp_apps, with tests ported fromhost.test.ts. It handles initialize, ping, tool/resource requests, browser links, initialization and sizing notifications, result normalization, request bounds and JSON-RPC refusals. The client exposes all fourmcpApps.*RPCs on the network runtime. Cached frames retain only their environment identity; each request resolves the current connected handle for that environment and refuses when it is disconnected or another environment is active. Tool calls preflighttoolInfo; tools that need confirmation are refused in this slice. Host styles come from the native theme tokens.The transcript loads the signed app resource into #91's WebKit view, preserving its navigation/IPC isolation, nonpersistent store and disabled script windows. Each response keeps the sandbox and the app's filtered CSP. A capture-phase transport listener sends outgoing page messages only to IPC; host messages reach the SDK with the accepted parent source, without echoing either direction. Inline sizing starts at 320px and clamps notifications to 80–2000px. Links require recent AppKit input in the app. Page/view caches are bounded; closing has a Show app action. TR-MCPAPP stays
partial.Validation:
cargo clippy --workspace --all-targets -- -D warningscargo test --workspace(includes the authenticated connection replacement regression)cargo build -p t3-native --features snapshotnode --test conformance/mcp-app/transport.check.ts(the exact injected bootstrap in a message-event harness with SDK-style parent/source validation and unsupported-request replies)--checkvp run check:changed fork/nativecargo run -p t3-core --example mcp_app_hostproduces the deterministic initialize/input/result/size/ping/tool/resource/refusal transcriptLocal evidence (intentionally not uploaded per the worker brief):
/private/tmp/nw98-evidence/mcp-before.png/private/tmp/nw98-evidence/mcp-after.png/private/tmp/nw98-evidence/mcp-after-light.png/private/tmp/nw98-evidence/host-transcript.txt/private/tmp/nw98-evidence/smoke-probe.txtThe captures use
--mcp-fixture apps/native/conformance/mcp-app/weather.htmlin the existing Replay showcase thread. They show the real transcript row, border and default-height fallback card. The offscreen renderer cannot host WebKit. No live provider-produced MCP app, WebKit page execution, real MCP tool/resource success, or system-browser open was observed; protocol and server request forwarding are verified with the pure-host and in-process WebSocket tests. No server data was changed and no paid provider was used.Remaining gaps: fullscreen/pip,
ui/message,ui/update-model-contextUI (RPC only),ui/download-file, step-aside/confirm dialogs (non-read-only tools refused), theme changes while open, device permission grants, and the host-initiated resource-teardown acknowledgement/timeout handshake.Refs #98.
Built with GPT-6.1 Sol in Codex