> ## Documentation Index
> Fetch the complete documentation index at: https://sunpeak.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# useHostInfo

> Get host application information.

<Badge color="yellow">sunpeak API</Badge>

## Overview

Returns information about the host application, including its name, version, and supported capabilities.

<Card horizontal title="Wraps getHostVersion · getHostCapabilities" icon="cube" href="/mcp-apps/app/accessors">
  MCP Apps SDK reference
</Card>

## Import

```tsx theme={null}
import { useHostInfo } from 'sunpeak';
```

## Signature

```tsx theme={null}
function useHostInfo(): {
  hostVersion: HostVersion | undefined;
  hostCapabilities: HostCapabilities | undefined;
}
```

## Returns

<ResponseField name="hostVersion" type="HostVersion | undefined">
  Host application name and version.
</ResponseField>

<ResponseField name="hostCapabilities" type="HostCapabilities | undefined">
  Host-supported capabilities.
</ResponseField>

### HostVersion

<ResponseField name="name" type="string">
  Host application name.
</ResponseField>

<ResponseField name="version" type="string">
  Host application version.
</ResponseField>

### HostCapabilities

<ResponseField name="serverTools" type="boolean">
  Whether the host supports calling server tools.
</ResponseField>

<ResponseField name="openLinks" type="boolean">
  Whether the host supports opening external links.
</ResponseField>

<ResponseField name="logging" type="boolean">
  Whether the host supports structured logging.
</ResponseField>

<ResponseField name="messages" type="boolean">
  Whether the host supports sending messages.
</ResponseField>

<ResponseField name="displayModes" type="boolean">
  Whether the host supports display mode changes.
</ResponseField>

## Usage

```tsx theme={null}
import { useHostInfo } from 'sunpeak';

function MyResource() {
  const { hostVersion, hostCapabilities } = useHostInfo();

  return (
    <div>
      <p>Host: {hostVersion?.name} {hostVersion?.version}</p>
      <p>Can call tools: {hostCapabilities?.serverTools ? 'Yes' : 'No'}</p>
    </div>
  );
}
```

See [`McpUiHostCapabilities`](/mcp-apps/types/core-types#mcpuihostcapabilities) for the full protocol-level capabilities type.
