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.
A View can also declare the modes it supports by passing availableDisplayModes in its McpUiAppCapabilities (the second argument to the App constructor), which the SDK sends in ui/initialize:
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
Returns
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.