Skip to main content

Overview

sunpeak provides a multi-platform runtime abstraction layer that helps you build MCP Apps once and deploy them across different AI chat hosts like ChatGPT, Claude, and more.

Why Multi-Platform?

Write Once, Deploy Everywhere

Build your app logic once, run it on multiple platforms without rewriting.

Consistent Developer Experience

Same React hooks and patterns across all platforms.

Future-Proof

Automatically support new platforms as they emerge.

Easy Migration

Switch platforms without major code changes.

React Hooks

sunpeak provides access to the entire MCP Apps runtime API via platform-agnostic React hooks. All hooks read from context automatically — no need to pass an app instance:
import { useTheme, useDisplayMode, useAppState } from 'sunpeak';

function MyResource() {
  const theme = useTheme();                          // 'light' | 'dark'
  const displayMode = useDisplayMode();              // 'inline' | 'pip' | 'fullscreen'
  const [state, setState] = useAppState({ count: 0 });

  return <div className={displayMode === 'fullscreen' ? 'h-screen' : 'max-h-96'}>...</div>;
}

Action Hooks

sunpeak provides individual hooks for interacting with the host runtime, including calling MCP tools, sending messages, and opening links.
import { useCallServerTool, useSendMessage, useOpenLink } from 'sunpeak';

function MyResource() {
  const callTool = useCallServerTool();
  const sendMessage = useSendMessage();
  const openLink = useOpenLink();

  const handleAction = async () => {
    // Call an MCP tool.
    const result = await callTool({ name: 'my-tool', arguments: { arg: 'value' } });

    // Send a follow-up message.
    await sendMessage({ role: 'user', content: [{ type: 'text', text: 'Continue' }] });

    // Open an external URL.
    await openLink({ url: 'https://sunpeak.ai' });
  };

  return <button onClick={handleAction}>Interact with Host</button>;
}

Dive Deeper

Runtime API Reference

All hooks provided by sunpeak.