Overview
requestDisplayMode asks the host to change how the MCP App View is displayed. The three possible display modes are:
"inline"— The default mode. The View is rendered inline within the chat conversation."fullscreen"— The View expands to fill the host’s available space."pip"— Picture-in-picture mode. The View floats in a small overlay window.
McpUiDisplayMode type. See Core Types for the full type definition.
The host may not support all display modes. The returned mode reflects what was actually set, which may differ from the requested mode if the host does not support it. Always check the host context’s availableDisplayModes before requesting a mode change, and use the returned value to update your UI state.
Signature
Parameters
The desired display mode. One of
"inline", "fullscreen", or "pip".Optional request configuration such as timeout or abort signal.
Returns
The display mode actually set by the host. This may differ from the requested mode if the host does not support it.
Usage
Toggling between inline and fullscreen
Entering picture-in-picture mode
Handling unsupported modes gracefully
Building a mode switcher
Related
useRequestDisplayMode— React hook that wraps this method.- Core Types — Full definition of
McpUiDisplayMode. getHostContext()— returns the current display mode and available modes.- Event Handlers — Listen for host-initiated display mode changes.