Show HN: OpenAI Apps Handbook (github.com)

🤖 AI Summary
The OpenAI Apps Handbook is a hands-on guide for building ChatGPT “apps” using the Apps SDK and a Model Context Protocol (MCP) server. It walks developers through a runnable FastAPI + Uvicorn example (FastMCP), showing how to register tools and widget resources, serve widget HTML, validate inputs, test locally, and deploy. The guide includes practical examples — CDN-hosted JS widgets, static file mounting, switching widgets based on input — plus testing with the MCP Inspector and pytest/httpx, making it a ready-to-run starting point for interactive ChatGPT integrations. Technically, the handbook defines three core MCP components: UI widgets (HTML templates + metadata + template URIs), tool handlers (list_tools, list_resources, call_tool_request, read_resource), and an SSE/HTTP surface (GET /mcp, POST /mcp/messages). It uses Pydantic datamodels for strict input validation and returns structured content and embedded widget resources so ChatGPT can render UI inside responses. Metadata keys (e.g., openai/outputTemplate, openai/toolInvocation) signal renderability and invocation states. The pattern supports multiple tools mapping to one widget, dynamic widget selection, and production deployment hints (uvicorn/gunicorn, CORS). For AI/ML engineers, this standardizes how model outputs can include interactive visualizations and controls, enabling richer human-model workflows and safer, validated tool execution inside ChatGPT.
Loading comments...
loading comments...