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.
Quickstart
Create a new MCP App project with one command:http://localhost:3000. An MCP endpoint starts at http://localhost:8000/mcp for testing with real hosts.
See the full quickstart guide for step-by-step setup through production deployment.
What it does
The sunpeak framework is a convention-over-configuration structure for building MCP Apps. It bundles the inspector and testing framework with a structured project layout, auto-discovery, and a CLI. Building an MCP App from scratch means wiring up an MCP server, handling protocol details, managing resource HTML, and setting up a dev environment. sunpeak handles all of that and gives you a structured project with testing from the start.Convention Over Configuration
sunpeak discovers resources, tools, and simulations from your file system:- Resources from
src/resources/{name}/{name}.tsx— each exports a React component and aresourceconfig - Tools from
src/tools/{name}.ts— each exportstool(metadata),schema(Zod), and adefaulthandler. Tools with aresourcefield link to a resource UI. - Simulations from
tests/simulations/{name}.json— JSON fixtures loaded by the inspector and used in E2E tests - Server config from
src/server.ts(optional) — exportsserverfor identity/icons andauth()for request authentication (see Authorization)
Runtime APIs
sunpeak provides multi-platform React hooks that wrap the MCP Apps protocol. Write your app logic once, deploy it across ChatGPT, Claude, and future hosts.Data Hooks
| Hook | Description |
|---|---|
useToolInput() | Arguments passed to the tool by the model |
useToolResult() | Structured content returned by the tool handler |
useAppState() | Persistent state shared with the model via useUpdateModelContext() |
useHostContext() | Full host-provided context object |
Environment Hooks
| Hook | Description |
|---|---|
useTheme() | 'light' or 'dark' from the host |
useDisplayMode() | 'inline', 'pip', or 'fullscreen' |
usePlatform() | 'mobile', 'desktop', or 'web' |
useLocale() | BCP 47 language tag (e.g., 'en-US') |
useTimeZone() | IANA time zone (e.g., 'America/New_York') |
useViewport() | Container dimensions and constraints |
useSafeArea() | Device safe area insets |
useDeviceCapabilities() | Hover and touch support |
Action Hooks
| Hook | Description |
|---|---|
useCallServerTool() | Call another tool on your MCP server |
useOpenLink() | Open a URL in the host browser |
useDownloadFile() | Trigger a file download |
useRequestDisplayMode() | Request inline/PiP/fullscreen switch |
useSetAutoScroll() | Control host auto-scroll behavior |
Host Detection
Detect which host your app is running in — see Host Detection:MCP Server
The MCP server lets you serve your apps to AI hosts like ChatGPT and Claude. During development,sunpeak dev runs an MCP server that serves simulation fixture data. For production, use sunpeak build followed by sunpeak start.
- pnpm
- npm
- yarn
UI Components
The framework includes pre-built components insrc/resources/ and shared components in src/components/. These follow MCP App design guidelines using Tailwind CSS with MCP standard variables:
The sunpeak CLI
| Command | Description |
|---|---|
sunpeak new | Create a new project |
sunpeak dev | Dev server with inspector and MCP endpoint |
sunpeak build | Build resources for production |
sunpeak start | Start the production MCP server |
sunpeak test | Run unit, E2E, visual, live, and eval tests |
sunpeak inspect | Inspect any MCP server (standalone) |
sunpeak upgrade | Upgrade sunpeak to latest version |
Dive Deeper
Inspector
Test MCP Apps in replicated ChatGPT and Claude runtimes.
Testing Framework
E2E tests against the inspector. Live tests against real hosts.
Project Scaffold
Detailed project structure and file conventions.
Deployment Guide
Deploy to production with tunnels and hosting.