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

# useHost

> Identify which host is rendering the view

The same [view](https://docs.skybridge.tech/build/view.md) runs inside every host: Claude, Cursor, Goose, and others. `useHost` reports which one, taken from the MCP Apps `ui/initialize` handshake, so the view can adapt copy, shortcuts, or layout to the host it's rendering in. It runs only on MCP Apps hosts; the name is normalized to a [`Host`](#host) slug when recognized, otherwise passed through as a raw string.

## Example

An empty state suggests the next action using the wording that fits the host.

```tsx highlight={4} theme={null}
import { useHost } from "skybridge/web";

function EmptyState() {
  const { name } = useHost();
  const hint =
    name === "claude"
      ? "Ask Claude to add your first item."
      : "Send a message to add your first item.";

  return <p className="empty">{hint}</p>;
}
```

## Returns

### `name`

```tsx theme={null}
name: Host | (string & {}) | undefined;
```

The host's reported name. It resolves to a [`Host`](#host) slug for recognized hosts, a raw string for hosts not yet mapped, and `undefined` until the handshake completes — the view renders first and re-renders once the host responds. The `(string & {})` keeps the known slugs in autocomplete while still accepting any string.

### `version`

```tsx theme={null}
version: string | undefined;
```

The host's version string, or `undefined` until the handshake completes.

### `capabilities`

```tsx theme={null}
capabilities: McpUiHostCapabilities | undefined;
```

The host's MCP Apps capabilities from the handshake, such as `downloadFile`, `openLinks`, `message` or `experimental`. `undefined` until the handshake completes.

### `openaiCapabilities`

```tsx theme={null}
openaiCapabilities: {
  resource: boolean;
  modelContext: boolean;
  message: boolean;
  files: boolean;
};
```

> [!NOTE]
>
> This is an [OpenAI MCP extension](https://github.com/openai/mcp-extensions/blob/main/docs/spec.md), not part of MCP or MCP Apps. Only **ChatGPT** supports it, and other hosts ignore it.

Which [OpenAI MCP extensions](https://github.com/openai/mcp-extensions/blob/main/docs/spec.md) the host supports. A flag is `true` only when the host advertises `experimental["openai/<name>"]`, so every flag is `false` before the handshake and on hosts other than **ChatGPT**.

| Flag | Extension |
| - | - |
| `resource` | Read, subscribe to and write the file opened through a file entrypoint. See [`useFileResource`](https://docs.skybridge.tech/api-reference/use-file-resource). |
| `modelContext` | Titles, thumbnails and background content in model context. |
| `message` | Messages sent to a new conversation, and titled items in a message. See [`useSendFollowUpMessage`](https://docs.skybridge.tech/api-reference/use-send-follow-up-message#titled-items). |
| `files` | Open a local file in ChatGPT. See [`useOpenFile`](https://docs.skybridge.tech/api-reference/use-open-file). |

```tsx theme={null}
const { openaiCapabilities } = useHost();

return openaiCapabilities.files ? <OpenInChatGPTButton /> : null;
```

## Host

The recognized hosts, as normalized slugs. An unrecognized host surfaces its raw reported name instead.

```tsx theme={null}
type Host =
  | "chatgpt"
  | "claude"
  | "cursor"
  | "goose"
  | "mistral-vibe"
  | "alpic";
```

| Slug | Reported `hostInfo.name` |
| - | - |
| `chatgpt` | `chatgpt` |
| `claude` | `Claude` |
| `cursor` | `Cursor` |
| `goose` | `MCP-UI Host` |
| `mistral-vibe` | `Le Chat` |
| `alpic` | `alpic-playground` |

> [card] [useUser](https://docs.skybridge.tech/api-reference/use-user.md)
>
> Read the host's locale and device capabilities

> [card] [useMcpAppContext](https://docs.skybridge.tech/api-reference/use-mcp-app-context.md)
>
> Read a raw MCP Apps context value by key

> [card] [Design for the Host](https://docs.skybridge.tech/guides/ux.md)
>
> Adapt the view to the host it runs in


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.