McpAppBridge
The host side of one MCP App view (MCP Apps 2026-01-26, §"Communication Protocol"): it answers the view's JSON-RPC over send / receive as an MCP server that proxies client — the connection of the server that owns the view — and drives the lifecycle (ui/initialize, tool input and result, host context, teardown).
The view is untrusted: it only reaches tools of its own server whose visibility includes app (§"Visibility"), through McpAppHost.approveToolCall; links must be http(s); nothing is sent to it before ui/notifications/initialized. Call receive and the host methods from one coroutine context (e.g. the main thread).
Parameters
the MCP Tool JSON of the call that shows the view (hostContext.toolInfo).
delivers one JSON-RPC message to the view.
Constructors
Properties
Functions
Update the host context; the view gets the changed fields (ui/notifications/host-context-changed).
The tool call was cancelled (ui/notifications/tool-cancelled).
The tool's CallToolResult (ui/notifications/tool-result, sent once, after the input).