Repository navigation
feat(ui): complete Control UI MCP App bridge - #109807
Conversation
|
Codex review: found issues before merge. Reviewed July 18, 2026, 1:18 AM ET / 05:18 UTC. Summary PR surface: Source +60, Tests +257. Total +317 across 9 files. Reproducibility: yes. from source: submit a focused, visible MCP App Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Treat MCP App Do we have a high-confidence way to reproduce the issue? Yes, from source: submit a focused, visible MCP App Is this the best way to solve the issue? No. The PR correctly reuses the existing prompt-send seam, but plain-text-only enforcement is incomplete until it rejects bang-command syntax as well as slash commands. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 330f36fb32ea. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +60, Tests +257. Total +317 across 9 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (9 earlier review cycles; latest 8 shown)
|
# Conflicts: # src/gateway/server-methods/mcp-app.test.ts # src/gateway/server-methods/mcp-app.ts
|
Merged via squash.
|
* feat(ui): complete MCP App message bridge * fix(ui): gate reconstructed MCP App messaging * fix(ui): register MCP message handler without suppression * fix(ui): use public MCP Apps message schema export * chore: realign PR branch with canonical main * fix(ui): register MCP messages through public bridge API
* feat(ui): complete MCP App message bridge * fix(ui): gate reconstructed MCP App messaging * fix(ui): register MCP message handler without suppression * fix(ui): use public MCP Apps message schema export * chore: realign PR branch with canonical main * fix(ui): register MCP messages through public bridge API
AI-assisted: yes (Codex). I understand the implementation and completed fresh autoreview passes with no accepted/actionable findings. No agent transcript is included because separate approval was not provided.
Summary
ui/messagesupport routed through the normal visible chat-send path.What Problem This Solves
The Control UI could render MCP App resources and service app tool/resource requests, but an app could not safely ask the user to send plain text through the host chat, and mounted apps did not receive live theme or size changes.
Why This Change Was Made
This extends the already-present iframe/resource reconstruction architecture. It reuses the existing widget-prompt validation and
WIDGET_PROMPT_EVENTsend seam, adds host-owned exact-text confirmation for MCP App requests, and uses the officialAppBridge.setHostContextlifecycle. It does not add a second send route, config/env surface, protocol version, or privileged approval path.The implementation adds a small explicit
readOnlylease marker because a fresh app may legitimately have zero app-callable tools, while a transcript-reconstructed preview must remain resource-only. Tool-count inference could not represent both states safely.User Impact
When MCP Apps are already enabled, a visible and focused fresh app can request that the user send one plain-text message. The host shows the exact text for confirmation, then sends through the existing chat composer path. Hidden/background frames, empty or oversized text, slash commands, and rate-limit excesses are rejected. Apps also receive current theme and dimensions as they change.
Independent landing and backward safety
readOnlyviews fail closed.Exact dormant/additive boundary: all behavior remains behind the existing
mcp.apps.enabledgate. Within that gate,message.textis advertised only when a fresh view has explicit current-run authority and the host handler is installed. Reconstructed views can still render/read resources but cannot message or call tools. Rich or multi-blockui/messagecontent is intentionally unsupported.Evidence
Appfrom@modelcontextprotocol/ext-appsran through the real Control UI Vite app, dedicated sandbox HTTP server, and nested iframe bridge. The official initialize handshake advertisedmessage.text; exact host consent was required; accepted text produced the normalchat.sendrequest (deliver: false); the app received its response; live light-theme and container-dimension changes propagated without remounting.mcp-app-view-registration, 63.26 kB) and Control UI performance limits.onmessagesetter. The handler now registers through that documented public setter via a typed wrapper, without a suppression or private schema import; the component and suppression-ratchet tests pass, followed by two clean fresh autoreviews.Verification
pnpm test src/agents/mcp-ui-resource.test.ts src/gateway/mcp-app-reconstruction.test.ts src/gateway/server-methods/mcp-app.test.ts ui/src/components/mcp-app-security.test.ts ui/src/components/mcp-app-view.test.ts ui/src/pages/chat/components/chat-tool-cards.node.test.ts ui/src/pages/chat/components/chat-tool-cards.test.ts ui/src/pages/chat/components/chat-tool-cards.widget-prompts.test.tspnpm tsgo:prodandpnpm lintpnpm build$autoreviewpasses before and after simplification/final safety editsSimplification and scope
The PR changes five production files and four focused test files. Net production growth is +60 LOC: the message handler/host-context lifecycle and explicit read-only authority marker are offset by deleting the duplicated widget-prompt policy/send implementation. No additional abstraction module, route, config, or compatibility shim was added.
Known gaps