Skip to main content
sunpeak API

Overview

The useTheme hook returns the host’s current theme. It is a convenience wrapper around useHostContext.

Wraps onhostcontextchanged

MCP Apps SDK reference

Import

Signature

The return type is McpUiTheme.

Returns

return
'light' | 'dark'
The current theme. Defaults to 'light' when unavailable.

Usage