Overview
If you already have a React project and want to use sunpeak for runtime APIs or testing, you can integrate the sunpeak library directly without using the framework.Starting from scratch? Use Quickstart for the recommended MCP App creation experience.
Prerequisites
Your existing project needs:React
Version 19
Node.js
Version 20 or higher
Build Tool
Vite recommended
Installation Steps
Install sunpeak
Add sunpeak to your project dependencies:If you only want to use sunpeak simulation and testing functionality (without the runtime APIs),
you can add sunpeak to
- pnpm
- npm
- yarn
devDependencies instead.Install styles (Tailwind)
sunpeak requires Tailwind CSS 4. If you don’t have it installed:Configure Tailwind in your build config, if it isn’t set up already:Import Tailwind and sunpeak styles in your CSS entrypoint:
- pnpm
- npm
- yarn
- Vite
- Webpack
Create resource and simulation files
Create a resource folder with a Create a simulation JSON file in
.tsx file that exports both the metadata and the React component:tests/simulations/:Wire up the simulator
Create an entrypoint file (like Add a script to run your simulation dev server (Run your local development server:
dev/main.tsx) where you want to run your simulator:package.json):- pnpm
- npm
- yarn
Wire up the MCP server
Create an MCP server file (like Add scripts to build and run your MCP server (Build your app and start the MCP server:See runMCPServer API Reference for configuration options and connecting to a host via tunnel.
mcp/server.ts) to serve your built apps to hosts like ChatGPT:package.json):- pnpm
- npm
- yarn