Overview
getHostCapabilities() returns the capabilities the host advertised during the initialization handshake. Use this for feature detection — check whether a capability exists before calling the corresponding method.
Returns undefined before connect() completes.
Signature
Returns
The host’s capabilities, or
undefined if the app has not connected yet. See McpUiHostCapabilities for the full type definition.Usage
Check before calling server tools
Check before sending messages
Check before downloading files
Build a capabilities summary
Capability Fields
| Field | Enables |
|---|---|
openLinks | openLink() |
downloadFile | downloadFile() |
serverTools | callServerTool() |
serverResources | readServerResource(), listServerResources() |
logging | sendLog() |
updateModelContext | updateModelContext() |
message | sendMessage() |
sandbox | Host-enforced sandbox permissions and CSP |
Related
McpUiHostCapabilities— Full type definition- Capability Detection — Server-side capability negotiation
- Accessors overview — All App accessor methods