Overview
The sunpeak mcp command starts a local MCP (Model Context Protocol) server that allows you to test your MCP Resources directly in ChatGPT during development.
Features
Automatic Rebuilding
The MCP server watches your src/ directory and automatically rebuilds when you make changes:
- Detects file changes in real-time
- Rebuilds affected Resources automatically
- No manual restart required
Simulation Discovery
Automatically discovers and serves all simulations exported from src/simulations/index.ts:
- MCP tools based on your simulation configuration
- MCP Resources pointing to your built widgets
- Tool metadata and descriptions
Development-Only Server
The MCP server is designed for local development only. Do not use it in production.
For production, create a proper MCP server that references your deployed widget URLs.
Port Configuration
Default port: 6766
To use a different port, you can configure it in your MCP server setup or pass it as an option:
{
"scripts": {
"mcp": "sunpeak mcp --port 8080"
}
}
Usage
MCP Endpoints
The server automatically creates these endpoints:
- GET
/mcp - MCP metadata and capabilities
- POST
/mcp/messages - Message endpoint for client requests
File Watching
The server watches for changes in the src/ directory.
When changes are detected:
- Affected Resources are rebuilt
- The server continues running
- Next ChatGPT request uses updated code
Keep the MCP server running while you develop. Changes are picked up automatically!