Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

chatgpt-mcp-apps-kit

БесплатноБез исполняемых скриптовНе проверен

Guide for implementing ChatGPT Apps using OpenAI Apps SDK. Use when building MCP servers with interactive UI components that integrate with ChatGPT, including…

AndurilCodeот AndurilCode★ 16 звёзд на GitHub20 установок в других каталогах

Об этом скилле

ChatGPT Apps Builder

Overview

This skill provides comprehensive guidance for implementing ChatGPT Apps using the OpenAI Apps SDK - a framework that enables MCP servers to deliver rich, interactive UI experiences directly within ChatGPT conversations.

Use this skill when:

  • Building MCP servers that integrate with ChatGPT's widget runtime
  • Creating interactive UI components that render inside ChatGPT conversations
  • Implementing OAuth 2.1 authentication for user-specific data access
  • Managing widget state and bidirectional communication with MCP servers
  • Deploying and submitting apps to the ChatGPT platform
  • Migrating from other approaches to the OpenAI Apps SDK framework

Core Concepts

What are ChatGPT Apps?

ChatGPT Apps are MCP-based applications with three key components:

  1. MCP Server: Defines tools, enforces auth, returns data, and links tools to UI templates
  2. Widget/UI Bundle: Renders inside ChatGPT's iframe using the window.openai runtime
  3. ChatGPT Model: Decides when to call tools and narrates the experience using structured data

Key Pattern: Tool → Data → Widget

User prompt
   ↓
ChatGPT model ──► MCP tool call ──► Your server ──► Tool response
   │                                     │
   │                                     ├─ structuredContent (model reads)
   │                                     ├─ content (narration)
   │                                     └─ _meta (widget-only data)
   │                                        │
   └───── renders narration ◄──── widget iframe ◄──────┘
                              (HTML template + window.openai)

Architecture Components

MCP Server:

  • Registers UI templates as resources with MIME type text/html+skybridge
  • Defines tools with _meta["openai/outputTemplate"] pointing to UI resources
  • Returns three data payloads: structuredContent, content, and _meta
  • Handles authentication and authorization

Widget Runtime (window.openai):

  • Provides toolInput, toolOutput, toolResponseMetadata, widgetState
  • Enables bidirectional communication: callTool, sendFollowUpMessage
  • File handling: uploadFile, getFileDownloadUrl
  • Layout controls: requestDisplayMode, requestModal, notifyIntrinsicHeight
  • Context signals: theme, displayMode, locale, userAgent

Security Model:

  • Mandatory iframe sandboxing with Content Security Policy
  • openai/widgetCSP configuration for allowed domains
  • OAuth 2.1 with PKCE for user authentication
  • Token verification on every MCP request

Implementation Workflow

Step 1: Set Up Your Project

Project structure:

your-chatgpt-app/
├─ server/
│  └─ src/index.ts          # MCP server + tool handlers
├─ web/
│  ├─ src/component.tsx     # React widget
│  └─ dist/app.{js,css}     # Bundled assets
└─ package.json

Install dependencies:

# MCP SDK
npm install @modelcontextprotocol/sdk zod

# React widget
cd web
npm install react@^18 react-dom@^18
npm install -D vite esbuild typescript

Step 2: Register UI Templates

UI templates are MCP resources with text/html+skybridge MIME type:

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { readFileSync } from "node:fs";

const server = new McpServer({ name: "my-app", version: "1.0.0" });

// Read bundled widget assets
const JS = readFileSync("web/dist/app.js", "utf8");
const CSS = readFileSync("web/dist/app.css", "utf8");

// Register widget template
server.registerResource(
  "app-widget",
  "ui://widget/app.html",
  {},
  async () => ({
    contents: [
      {
        uri: "ui://widget/app.html",
        mimeType: "text/html+skybridge",
        text: `
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>My App</title>
    <style>${CSS}</style>
  </head>
  <body>
    <div id="root"></div>
    <script type="module">${JS}</script>
  </body>
</html>
        `.trim(),
        _meta: {
          "openai/widgetPrefersBorder": true,
          "openai/widgetDomain": "https://chatgpt.com",
          "openai/widgetCSP": {
            connect_domains: ["https://api.yourservice.com"],
            resource_domains: ["https://*.oaistatic.com"],
            // Optional: redirect_domains, frame_domains
          },
        },
      },
    ],
  })
);

Template metadata:

  • openai/widgetPrefersBorder: Show visual border around widget
  • openai/widgetDomain: Dedicated origin for widget (enables fullscreen button)
  • openai/widgetCSP: Content Security Policy configuration
    • connect_domains: APIs the widget can fetch from
    • resource_domains: CDNs for static assets (images, fonts, scripts)
    • redirect_domains: Hosts for openExternal without safe-link modal
    • frame_domains: Allowed iframe origins (discouraged, requires review)

Cache busting: When changing widget HTML/JS/CSS in breaking ways, use new URI or filename so ChatGPT loads fresh bundle.

Step 3:

Полный SKILL.md на GitHub

Установить chatgpt-mcp-apps-kit в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

README.mdreferences/best-practices.mdreferences/oauth-authentication.mdreferences/window-openai-api.md

FAQ

Что делает скилл chatgpt-mcp-apps-kit?

Guide for implementing ChatGPT Apps using OpenAI Apps SDK. Use when building MCP servers with interactive UI components that integrate with ChatGPT, including widget runtime, authentication, state management, and deployment to the ChatGPT platform.

Как установить скилл chatgpt-mcp-apps-kit?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл chatgpt-mcp-apps-kit запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить chatgpt-mcp-apps-kit с