useHostInfo reports which one, taken from the MCP Apps ui/initialize handshake, so the view can adapt copy, shortcuts, or layout to the host it’s rendering in. It runs only on MCP Apps hosts; the name is normalized to a Host slug when recognized, otherwise passed through as a raw string.
Example
An empty state suggests the next action using the wording that fits the host.Returns
name
Host slug for recognized hosts, a raw string for hosts not yet mapped, and undefined until the handshake completes — the view renders first and re-renders once the host responds. The (string & {}) keeps the known slugs in autocomplete while still accepting any string.
version
undefined until the handshake completes.
Host
The recognized hosts, as normalized slugs. An unrecognized host surfaces its raw reported name instead.useUser
Read the host’s locale and device capabilities
useMcpAppContext
Read a raw MCP Apps context value by key
Design for the Host
Adapt the view to the host it runs in