Expand description
Web surfaces and their bridge (13.5+, cap CAP_WEB_BRIDGE).
A web surface is HTML byob runs sandboxed (the Servo helper on the desktop, an iframe in
the browser) that talks to byob over a typed bridge: JSON-RPC 2.0 messages, the
MCP Apps dialect (ui/initialize,
tools/call, ui/message, ui/update-model-context, ui/open-link, …). Who answers a
surface’s calls is its WebOwner: an MCP server (an MCP App: a tool that declares
_meta.ui.resourceUri), or a plugin (a view declared with html, or an artifact
renderer web:<file>).
The client is the host the page talks to. It answers what is about the client itself
(ui/initialize with the theme as CSS variables, ui/open-link, size changes) and sends
the rest to the engine as a crate::ClientMsg::WebCall, answered by one
crate::ServerMsg::WebReply with the same call number. The engine routes a call to
the owner (tools/call to the same MCP server through the permission gate, or to the
plugin’s backend tools; byob/send to the plugin’s backend), or handles it itself
(byob/document: the surface’s HTML; ui/message: a user message in the chat;
ui/update-model-context: text for the model’s next request). Owners push messages to
their surfaces with crate::ServerMsg::WebPush.
Structs§
- McpApp
- An MCP App on a tool’s step (a
crate::Viewof kind [McpApp::KIND]): the tool declared_meta.ui.resourceUri, so clients render that resource with the call’s input and result. - WebApproval
- What the engine says when a call needs the user’s go-ahead first (a
tools/callthe permission gate would ask about): the client asks and sends the call again withapproved. - WebCard
- A plugin’s web view on a step (a
crate::Viewof kind [WebCard::KIND]): a backend tool returnedcard_viewnaming a view withhtml. - WebDocument
- The answer to
byob/document: the surface’s HTML and what it asks of the sandbox. - WebError
- Why a call failed (a JSON-RPC error for the page).
Enums§
- WebOwner
- Who answers a web surface’s calls.
Constants§
- CAP_
WEB_ BRIDGE - Cap: the peer handles
crate::ClientMsg::WebCall,crate::ServerMsg::WebReply,crate::ServerMsg::WebPushand thebyob.mcp_app/byob.webstep views. - MAX_
CALL_ BYTES - Largest call or push (the JSON of
params/msg). - MAX_
DOCUMENT_ BYTES - Largest HTML document the engine sends for a surface.
- MAX_
METHOD_ CHARS - Longest method name.
- MAX_
URI_ CHARS - Longest resource URI.
- MCP_
APPS_ VERSION - The MCP Apps protocol version byob speaks with views.
- MCP_
APP_ MIME - The MIME type of an MCP App’s HTML resource.
- MCP_
UI_ EXTENSION - The MCP Apps extension id (in
initializecapabilities).