Skip to main content
MCP Apps SDK

Overview

getHostVersion() returns the host application’s name and version, as reported during the initialization handshake. Use this to identify the host platform, log diagnostics, or adapt behavior for specific hosts. Returns undefined before connect() completes.

Signature

Returns

return
{ name: string; version: string } | undefined
The host’s self-reported identity, or undefined if the app has not connected yet.
name
string
The host application name (e.g., "ChatGPT", "Claude").
version
string
The host application version string.

Usage

Log the host identity

Adapt behavior per host

Include in error reports

The sunpeak framework provides useHostInfo for reactive access to the host’s name and version in React components.