Skip to main content

Overview

The sunpeak dev command starts a local development server with a built-in simulator and MCP server, allowing you to develop and test your MCP Resources both locally and with hosts like ChatGPT.
sunpeak dev

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

Simulator

Access the simulator at http://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 port 8000 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 simulations from tests/simulations/{name}/ ({name}-{scenario}-simulation.json)
No manual configuration or entry point files needed!

Options

OptionShortDescription
--port <number>-pPort for the simulator (default: 3000, also respects PORT env var)
--prod-mcpServe production build .html files over MCP instead of Vite HMR (requires sunpeak build first)

Configuration

Ports

Default simulator port: 3000 Default MCP server port: 8000

Usage

sunpeak dev
Or with a custom port:
sunpeak dev --port 3000

When to Use

Use sunpeak dev for:
  • Local component development with the simulator
  • Testing with real ChatGPT via the integrated MCP server
  • Rapid iteration with hot reload in either context
The dev server is for development only. For production, use sunpeak build to create optimized bundles.

Connecting to ChatGPT

To test with the real ChatGPT, expose the MCP server with a tunnel:
# In another terminal, run a tunnel
ngrok http 8000
Then connect the tunnel URL at the /mcp path (e.g., https://your-subdomain.ngrok.io/mcp) from ChatGPT in developer mode: User > Settings > Apps & Connectors > Create.