Sunpeak (current version 0.20.7) is an AI application framework, testing framework, and inspector specifically designed for building and debugging Multi-Platform (MCP) Apps, such as those for ChatGPT and Claude. It provides a convention-over-configuration approach to simplify wiring MCP servers, handling protocol messages, managing resource HTML bundles, and setting up dev environments with hot module replacement (HMR). Its key differentiators include a robust testing framework that simulates host runtimes and provides simulation fixtures for reproducible testing across various hosts, themes, and data states without relying on external accounts or API credits. It also offers a visual inspector for debugging. Sunpeak releases are frequent, primarily focusing on bug fixes, performance improvements, and feature enhancements within the 0.x.x minor version range, indicating active development.
npm install sunpeakVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize a Sunpeak project and write an end-to-end test for an MCP App using the `sunpeak/test` framework, including mocking AI model interactions.
Update test files to use the new `inspector` fixture for rendering and hosting methods. For example, change `mcp.renderTool(...)` to `inspector.renderTool(...)`.
Review and update all test file imports. Change `import { mcp } from 'sunpeak/test/live'` to `import { mcp } from 'sunpeak/test'`. Update Playwright config imports from `sunpeak/test/live/config` to `sunpeak/test/config`.Ensure your `vitest` or testing configuration is set up for ESM, especially if you encounter `require is not defined` errors. This might involve updating `package.json` to `"type": "module"` or configuring loaders.
Update your `package.json` scripts to use `"test": "sunpeak test"`, `"test:unit": "sunpeak test --unit"`, etc., to leverage the `sunpeak` CLI's managed test environment.
Ensure that `react` and `react-dom` (v18 or v19) are installed alongside `sunpeak`. Additionally, install the specific `@ai-sdk` packages (e.g., `@ai-sdk/openai`) you intend to use with compatible versions.
Convert `require()` statements to ES module `import` syntax. Ensure your project's `package.json` has `"type": "module"` or configure your build tools for ESM.
Replace `mcp.renderTool(...)` with `inspector.renderTool(...)` in your test files. The `inspector` fixture needs to be destructured from the `test` parameters (e.g., `async ({ page, inspector }) => { ... }`).Update import paths: `sunpeak/test/live` is now `sunpeak/test` (for fixtures like `mcp`), and `sunpeak/test/live/config` is now `sunpeak/test/config` (for Playwright's `defineConfig`).
Install `react` and `react-dom` (versions ^18.0.0 || ^19.0.0) in your project: `npm install react react-dom` or `yarn add react react-dom`. Verify versions are compatible.