Overview
Hosts provide CSS custom properties for colors, typography, borders, and more viaMcpUiHostContext.styles.variables. Use applyHostStyleVariables to set these on the document, then reference them in your CSS with var().
applyHostStyleVariables
Sets each CSS variable from the host as a custom property on the specified element.Signature
Style variables object from
McpUiHostContext.styles.variables.Element to apply styles to.
Usage
Available Variables
All variables are optional — hosts may provide any subset.Background Colors
Text Colors
Border Colors
Ring Colors
Typography
Border Radius
Other
See also: Theme for light/dark mode detection, and Fonts for host typography.