Overview
Thesunpeak start command starts a production MCP server that serves your built resources and executes real tool handlers. Run sunpeak build first to compile your resources and tools.
What It Does
The production server loads everything fromdist/:
- Resources — Pre-built HTML bundles from
dist/{name}/{name}.htmlwith metadata fromdist/{name}/{name}.json - Tools — Compiled tool modules from
dist/tools/*.js, registered with real handlers and Zod schemas for input validation - Server entry — Optional
dist/server.jsfor authentication and server metadata
registerAppTool from the MCP Apps SDK. When a host calls a tool, the real handler executes — not simulation fixture data.
Options
| Option | Short | Description |
|---|---|---|
--port <number> | -p | Server port (default: 8000, also respects PORT env var) |
--host <address> | Bind address (default: 0.0.0.0, also respects HOST env var) | |
--json-logs | Output structured JSON lines to stdout/stderr | |
--sse | Use SSE streaming instead of JSON responses (default: JSON) | |
--stateless | Stateless mode — no session tracking, fresh server per request. For serverless and horizontally-scaled deployments. See Deployment Guide. |
Usage
Server Endpoints
| Endpoint | Method | Description |
|---|---|---|
/health | GET | Health check — returns {"status":"ok","uptime":N} |
/ | GET | Server info page |
/mcp | POST | Initialize a session or send messages |
/mcp | GET | Open an SSE stream for server-initiated notifications |
/mcp | DELETE | Terminate a session |
/health endpoint is for load balancer probes, Kubernetes liveness/readiness checks, and uptime monitoring. It is always unauthenticated.
The production server uses the MCP Streamable HTTP transport. In the default stateful mode, session IDs are managed via the mcp-session-id header. In --stateless mode, only POST /mcp is available (no SSE streaming or session deletion).
Authentication
If your project includes asrc/server.ts with an auth() export, the production server calls it on every MCP request. See Server Entry for details.
Testing Locally
To test production behavior locally, run the build and start commands together:ngrok http 8000) and connect from ChatGPT.
Related Commands
sunpeak build
Build resources and compile tools.
Production Server API
createMcpHandler, createHandler, and config types.
Deployment Guide
Full deployment walkthrough with custom server examples.
sunpeak dev
Development server with inspector.