ChatGPT App framework

Build ChatGPT Apps
without the guesswork.

ChatGPT Apps are MCP Apps. moonpeak writes the ChatGPT Apps SDK metadata for you, replicates window.openai on localhost and tests your app in a ChatGPT-style host before you ever open ChatGPT.

Documentation Source

One app, ChatGPT included.

Every moonpeak resource carries the MCP Apps metadata and the older ChatGPT keys side by side, so the same build renders in ChatGPT, Claude and every other host.

  • resource becomes openai/outputTemplate.
  • invoking / invoked become ChatGPT's status texts.
  • App-only tools get openai/visibility: private and openai/widgetAccessible.
  • Resource csp becomes openai/widgetCSP.
  • useAppState saves to ChatGPT widget state automatically.
ChatGPT Apps docs →
src/tools/show-moon.ts
export const tool = {
  title: "Show moon phase",
  description: "Show the moon phase for a date.",
  resource: "moon",
  invoking: "Looking up",        // ChatGPT status while running
  invoked: "Here's the moon",    // ...and after
};
ChatGPT extras
import { useIsChatGPT, useWidgetState, useUploadFile } from "moonpeak/chatgpt";

export default function Gallery() {
  const chatgpt = useIsChatGPT();
  const upload = useUploadFile();      // null outside ChatGPT
  // ...
}

ChatGPT extras when you need them.

moonpeak/chatgpt exposes widget state, file upload, modals, user agent and any window.openai global. Each hook is safe to call in other hosts, where it returns an empty value.

Try it in ChatGPT.

Deploy over HTTPS, then in ChatGPT open Settings → Apps, turn on Developer mode and create an app with your /mcp URL. Or add the live demo, https://moonpeak-ai.com/mcp, to see it first.

Deployment guide →
ship
npm run build && npm start      # http://localhost:8000/mcp
npx moonpeak test --server https://your-domain/mcp

Open source, MIT licensed.

Documentation → GitHub
Copied