Definitions: The UI of a ChatGPT App is an MCP Resource.
We will use these terms interchangeably. More on MCP here.
Overview
sunpeak is an npm package that helps you build ChatGPT Apps (MCP Resources) while keeping your MCP server client-agnostic. sunpeak consists of:The sunpeak Library
- Runtime APIs: Strongly typed APIs for interacting with the ChatGPT runtime, architected to support future platforms (Gemini, Claude, etc.).
- ChatGPT Simulator: React component replicating ChatGPT’s runtime to test Apps locally and automatically.
- MCP Server: Serve Resources with mock data to the real ChatGPT with HMR (no more cache issues or 5-click manual refreshes).
The sunpeak Framework
Next.js for ChatGPT Apps. Using a Review page as an example, sunpeak projects look like:- Project Scaffold: Complete development setup with the sunpeak library.
- UI Components: Production-ready components following ChatGPT design guidelines and using OpenAI apps-sdk-ui React components.
- Convention over configuration:
The sunpeak CLI
Commands for managing ChatGPT Apps. Includes a client for the sunpeak Resource Repository. The repository helps you & your CI/CD decouple your App from your client-agnostic MCP server while also providing a hosted runtime to collaborate, demo, and share your ChatGPT Apps. Think Docker Hub for ChatGPT Apps:- Tag your app builds with version numbers and environment names (like
v1.0.0andprod) pushbuilt Apps to a central locationpullbuilt Apps to be run in different environments, like your production MCP server.- Share your fully-functional demo Apps with teammates, prospects, and strangers!
Examples
Example sunpeak resource & simulation files for an MCP Resource called “Review”.Resource Component
React component defining a UI (MCP Resource) in your ChatGPT App.Resource MCP Metadata
MCP metadata for your UI. Version your resource metadata alongside the resource itself. This is an official MCP Resource object.Simulation
Testing a ChatGPT App requires setting a lot of state: state in your backend (accessed via MCP tool), the stored widget runtime, and ChatGPT itself. Simulation files let you define key App states for development, automated testing, and demo purposes. Simulation files contain an official MCP Tool object and an official MCP CallToolResult object. ChatGPT state (like light/dark mode) is not set on the simulation, but rather on the sunpeakChatGPTSimulator itself via UI, props, or URL params.