alignbase/sunpeak/create-sunpeak-app
Claude Code and agent skill by alignbase/sunpeak
- community
Checking that the SKILL.md file is still in the repository.
Use when working with sunpeak, or when the user asks to "build an MCP App", "build a ChatGPT App", "add a UI to an MCP tool", "create an interactive resource for Claude Connector or ChatGPT", "build a React UI for an MCP server", or needs guidance on MCP App resources, tool-to-UI data flow, simulation files, host context, platform-specific ChatGPT/Claude features, or production builds. For testing (e2e, visual regression, live tests, evals), see the test-mcp-server skill.
Install
npx vskill@latest install alignbase/sunpeak/create-sunpeak-appSKILL.md
Create Sunpeak App
Sunpeak is a React framework built on @modelcontextprotocol/ext-apps for building MCP Apps with interactive UIs that run inside AI chat hosts (ChatGPT, Claude). It provides React hooks, a dev inspector, a CLI (sunpeak dev / sunpeak build / sunpeak start), and a structured project convention. ChatGPT apps are now submitted and published as plugins, but the app portion remains an MCP-backed app, so sunpeak's server, tools, resources, and runtime stay the same.
Getting Reference Code
Clone the sunpeak repo for working examples:
Template app lives at /tmp/sunpeak/packages/sunpeak/template/. This is the canonical project structure — read it first.
Project Structure
Discovery is convention-based:
- Resources:
src/resources/{name}/{name}.tsx(name derived from directory) - Tools:
src/tools/{name}.ts(name derived from filename) - Simulations:
tests/simulations/*.json(flat directory,"tool"string references tool filename)
Resource Component Pattern
Every resource file exports two things:
- `resource` — A
ResourceConfigobject with MCP resource metadata (name is auto-derived from directory) - A named React component — The UI (
{Name}Resource)
Rules:
- Always wrap in
<SafeArea>to respect host insets - Use MCP standard CSS variables via Tailwind arbitrary values:
text-[var(--color-text-primary)],text-[var(--color-text-secondary)],bg-[var(--color-background-primary)],border-[var(--color-border-tertiary)] useToolData<TInput, TOutput>()— provide types for both input and output- All hooks must be called before any early
return(React rules of hooks) - Do NOT mutate
appdirectly inside hooks — useeslint-disable-next-line react-hooks/immutabilityfor class setters
Tool Files
Each tool .ts file exports metadata, a Zod schema, an optional output schema, and a handler. The resource field links a tool to its UI — omit it for data-only tools:
ToolHandlerExtra follows MCP SDK 2.0: use extra.mcpReq.signal for cancellation, extra.mcpReq.id for the request ID, and extra.http?.authInfo for validated HTTP auth.
With MCP SDK 2.4, keep schema IDs valid as URIs (named_output, not named_output:schema). Named object output schemas return their object directly in structuredContent on legacy connections too. Do not unwrap a result property unless your tool actually returns that field. For modern HTTP x-mcp-header parameters, use strings, z.int(), or booleans, not z.number().
Backend-Only Tools (Confirmation Loop)
A common pattern pairs a UI tool (for review) with a backend-only tool (for execution). The UI tool's structuredContent includes a reviewTool field. The resource component reads it and calls the backend tool via useCallServerTool when the user confirms:
The UI tool returns reviewTool in its response, and the resource calls useCallServerTool on accept/reject. The tool returns both content (human-readable text for the host model) and structuredContent (with status and message for the UI). The resource reads structuredContent.status to determine success/error styling and displays structuredContent.message. One review tool handles all review variants (purchases, diffs, posts) via the action field. The inspector returns mock simulation data for callServerTool calls, matching real host behavior. See the template's review resource for the full implementation.
Simulation Files
Simulations are JSON fixtures that power the dev inspector. Place them in tests/simulations/ as flat JSON files:
Key fields:
tool— String referencing a tool filename insrc/tools/(without.ts)userMessage— Decorative text shown in inspector (no functional purpose)toolInput— Arguments sent to the tool (shown as input touseToolData)toolResult.structuredContent— The data rendered byuseToolData().outputtoolResult.content[]— Text fallback for non-UI hostsserverTools— Mock responses forcallServerToolcalls. Keys are tool names. Values are either a singleCallToolResult(always returned) or an array of{ when, result }entries for conditional matching against call arguments.
Example with serverTools (for resources that call backend-only tools):
Multiple simulations per tool are supported: review-diff.json, review-post.json sharing the same resource via the same tool's resource field.
Core Hooks Reference
All hooks are imported from sunpeak:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/create-sunpeak-app/SKILL.md
Popularity
- Repository stars
- 218
- Repository forks
- 12
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/alignbase/sunpeak/create-sunpeak-app)