A2UIPhoenix.Components.MCP (A2UIPhoenix v0.1.1)

Copy Markdown View Source

The function component for the MCP catalog's McpApp (v1.0): an MCP App running in a double-iframe sandbox, connected to the surface over the MCP Apps JSON-RPC bridge.

The component renders a container with the A2UIMcpApp hook (priv/static/a2ui_phoenix.js). The hook loads the sandbox proxy page (priv/static/a2ui_mcp_sandbox.html, at the URL given by the surface's :mcp_sandbox assign, "/a2ui_phoenix/a2ui_mcp_sandbox.html" by default), hands it the app's HTML with its CSP domains and permissions, answers the app's handshake, resizes the frame, keeps the app's bound state (data.paths) in step with the data model, and passes the requests that concern the surface to A2UIPhoenix.Session.mcp_app_request/5.

Summary

Functions

The MCP catalog's components by type.

The sandbox proxy URL used when the surface sets none: /a2ui_phoenix/a2ui_mcp_sandbox.html.

McpApp: the app's sandbox frame.

Functions

components()

(since 0.1.0)
@spec components() :: %{
  required(String.t()) => (map() -> Phoenix.LiveView.Rendered.t())
}

The MCP catalog's components by type.

default_sandbox()

(since 0.1.0)
@spec default_sandbox() :: String.t()

The sandbox proxy URL used when the surface sets none: /a2ui_phoenix/a2ui_mcp_sandbox.html.

mcp_app(assigns)

(since 0.1.0)
@spec mcp_app(map()) :: Phoenix.LiveView.Rendered.t()

McpApp: the app's sandbox frame.