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.
Overview
Thesunpeak dev command starts a local development server with a built-in inspector and MCP server, allowing you to develop and test your MCP Resources both locally and with hosts like ChatGPT.
Features
Hot Module Reload (HMR)
The dev server uses Vite’s hot reload technology for instant feedback:- Component changes reflect immediately without full page refresh
- State is preserved across updates when possible
- CSS updates apply instantly
- MCP server also supports HMR - no more cache issues or manual refreshes in ChatGPT
Inspector
Access the inspector athttp://localhost:3000 to:
- Test your MCP Resources in a ChatGPT-like environment
- Simulate tool calls and responses
- Preview your UI components with realistic styling
- Iterate quickly without needing a tunnel or ChatGPT connection
MCP Server
The dev server also runs an MCP server on port8000 for testing with hosts like ChatGPT:
- Serves your apps to ChatGPT via MCP
- Automatically rebuilds when you make changes
- Uses unique URIs to cache-bust ChatGPT’s aggressive caching
Automatic Discovery
The dev server automatically discovers and loads:- All resource folders from
src/resources/{name}/ - All tool files from
src/tools/*.ts - All simulations from
tests/simulations/*.json
Options
| Option | Short | Description |
|---|---|---|
--port <number> | -p | Port for the inspector (default: 3000, also respects PORT env var) |
--prod-tools | Call real tool handlers instead of simulation mock data | |
--prod-resources | Serve production-built HTML from dist/ instead of Vite HMR | |
--no-begging | Suppress the GitHub star message on startup |
Tool and Simulation selection
The inspector sidebar has two primary selectors:- Tool dropdown — selects which tool to inspect, including backend-only tools without UI resources. Selecting a backend-only tool shows
Tool does not render a UI, but you can still edit Tool Input, click Run, and inspect Tool Result. - Simulation dropdown — selects a simulation fixture with mock data. Shown when fixtures exist for the selected tool. Includes a “None (call server)” option to bypass mock data and call the real handler via the Run button.
Dev Overlay
During development, a small overlay appears in the bottom-right corner of each resource showing:- Resource: the timestamp when the resource HTML was served (helps detect stale cached resources in ChatGPT)
- Tool: the duration of the most recent tool call in milliseconds
- Inspector URL param:
devOverlay=false(used by e2e tests via thetests/e2e/helpers.tswrapper) - Environment variable:
SUNPEAK_DEV_OVERLAY=falsedisables it server-wide (used by the live test config’sdevOverlayoption) - Live test config:
defineLiveConfig({ devOverlay: false })passes the env var to the dev server
--prod-tools flag
When --prod-tools is used, tool calls execute your real handlers in src/tools/ instead of returning simulation mock data. The sidebar’s “Prod Tools” checkbox starts enabled (and can be toggled at runtime).
--prod-resources flag
When --prod-resources is used, sunpeak build runs automatically before the dev server starts. The built HTML is served from dist/ instead of Vite HMR. Useful for catching build regressions in CI/E2E testing.
Combining flags
The two flags are orthogonal and can be combined:| Flags | UI | Tools | Use case |
|---|---|---|---|
| (none) | HMR | Mocked | Day-to-day development |
--prod-tools | HMR | Real handlers | Integration testing |
--prod-resources | Built | Mocked | CI/E2E, catch build regressions |
--prod-tools --prod-resources | Built | Real handlers | Final smoke test before shipping |
Configuration
Ports
The dev server runs multiple services on different ports:| Port | Service | Purpose | Configurable |
|---|---|---|---|
3000 | Inspector UI | Main dev server with HMR | --port flag or PORT env |
8000 | MCP server | Tool execution endpoint (tunnel this for ChatGPT/Claude) | SUNPEAK_MCP_PORT env |
24679 | HMR WebSocket | Vite HMR for MCP resource bundles | SUNPEAK_HMR_PORT env |
24680 | Sandbox proxy | Cross-origin iframe isolation (local only, not tunneled) | SUNPEAK_SANDBOX_PORT env |
SUNPEAK_DEV_OVERLAY=false to disable the dev overlay across all resources served by this server.
Only port 8000 needs to be tunneled (e.g., via ngrok) for ChatGPT/Claude connections. The sandbox proxy server provides real cross-origin isolation for the inspector’s iframe architecture, matching how production hosts run apps on a separate sandbox origin.
Usage
When to Use
Usesunpeak dev for:
- Local component development with the inspector
- Testing with real ChatGPT via the integrated MCP server
- Rapid iteration with hot reload in either context
Connecting to ChatGPT
To test with the real ChatGPT, expose the MCP server with a tunnel:/mcp path (e.g., https://your-subdomain.ngrok.io/mcp) from ChatGPT in developer mode: User > Settings > Apps & Connectors > Create.
Related Commands
sunpeak build
Build resources and compile tools.
sunpeak start
Start the production MCP server.