惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
A
About on SuperTechFans
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Blog — PlanetScale
Blog — PlanetScale
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
G
Google Developers Blog
J
Java Code Geeks
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
Cloudbric
Cloudbric
L
LINUX DO - 最新话题
MyScale Blog
MyScale Blog
H
Heimdal Security Blog
PCI Perspectives
PCI Perspectives
Attack and Defense Labs
Attack and Defense Labs
S
Security @ Cisco Blogs
Latest news
Latest news
I
Intezer
L
Lohrmann on Cybersecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
月光博客
月光博客
T
Threatpost
博客园 - 【当耐特】
S
Schneier on Security
P
Privacy International News Feed
G
GRAHAM CLULEY
T
Tenable Blog
AWS News Blog
AWS News Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
博客园 - Franky
Engineering at Meta
Engineering at Meta
美团技术团队
S
Secure Thoughts
T
Troy Hunt's Blog
Microsoft Security Blog
Microsoft Security Blog
SecWiki News
SecWiki News
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Cisco Talos Blog
Cisco Talos Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Martin Fowler
Martin Fowler
Webroot Blog
Webroot Blog
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More

OpenAI Developers

API deployment checklist | OpenAI API Sora 2 Prompting Guide Codex Prompting Guide Docs MCP | OpenAI Developers Gpt-image-1.5 Prompting Guide GPT-5.2 Prompting Guide Transcribing User Audio with a Separate Realtime Request Modernizing your Codebase with Codex GitHub - openai/openai-sora-sample-app: Sample app to get started using the Video API with Sora GitHub - openai/openai-chatkit-advanced-samples: Starter app to build with OpenAI ChatKit SDK GitHub - openai/openai-chatkit-starter-app: Starter app to build with OpenAI ChatKit + Agent Builder Rate limits | OpenAI API Web search | OpenAI API Getting started with datasets | OpenAI API Prompt optimizer | OpenAI API Verifying gpt-oss implementations How to run gpt-oss locally with LM Studio Fine-tuning with gpt-oss and Hugging Face Transformers How to run gpt-oss locally with Ollama Function calling | OpenAI API Models | OpenAI API Reasoning best practices | OpenAI API Reasoning models | OpenAI API Background mode | OpenAI API Batch API | OpenAI API Conversation state | OpenAI API File search | OpenAI API Flex processing | OpenAI API MCP and Connectors | OpenAI API Code Interpreter | OpenAI API Quickstart - OpenAI Agents SDK Build Hour: Agentic Tool Calling Build Hour: Built-In Tools Reasoning best practices | OpenAI API Graders | OpenAI API Evaluation best practices | OpenAI API Working with evals | OpenAI API Guardrails - OpenAI Agents SDK Latency optimization | OpenAI API Optimizing LLM Accuracy | OpenAI API Agent orchestration - OpenAI Agents SDK Production best practices | OpenAI API Realtime transcription | OpenAI API Optimizing LLM Accuracy | OpenAI API Realtime and audio | OpenAI API Realtime conversations | OpenAI API Responses guide Migrate to the Responses API | OpenAI API Speech to text | OpenAI API Supervised fine-tuning | OpenAI API Tracing - OpenAI Agents SDK Vision fine-tuning | OpenAI API Audio and speech | OpenAI API GitHub - openai/openai-cs-agents-demo: Demo of a customer service use case implemented with the OpenAI Agents SDK Voice agents | OpenAI API Fine-tuning best practices | OpenAI API GitHub - openai/openai-agents-python: A lightweight, powerful framework for multi-agent workflows GitHub - openai/openai-agents-js: A lightweight, powerful framework for multi-agent workflows and voice agents Agents SDK | OpenAI API Using tools | OpenAI API Computer use | OpenAI API GitHub - openai/openai-cua-sample-app: Learn how to use CUA (our Computer Using Agent) via the API on multiple computer environments. GitHub - openai/openai-testing-agent-demo: Demo of a UI testing agent using the OpenAI CUA model and the Responses API. Model optimization | OpenAI API GitHub - openai/openai-fm: Code for openai.fm, a demo for the OpenAI Speech API Predicted Outputs | OpenAI API GitHub - openai/openai-realtime-console: React app for inspecting, building and debugging with the Realtime API Building Voice Agents GitHub - openai/openai-realtime-solar-system: Demo showing how to use the OpenAI Realtime API to navigate a 3D scene via tool calling GitHub - openai/openai-realtime-twilio-demo Reinforcement fine-tuning | OpenAI API GitHub - openai/openai-responses-starter-app: Starter app to build with the OpenAI Responses API Structured model outputs | OpenAI API GitHub - openai/openai-structured-outputs-samples: Sample apps to help developers get started with Structured Outputs Voice agents | OpenAI API Model optimization | OpenAI API GitHub - openai/openai-realtime-agents: This is a simple demonstration of more advanced, agentic patterns built on top of the Realtime API. GitHub - openai/openai-support-agent-demo: Demo of a customer support agent interface using NextJS and the OpenAI Responses API with File Search Building Voice Agents Generate images with high input fidelity AI app development: Concept to production Model optimization Building agents Eval Driven System Design - From Prototype to Production Multi-Agent Portfolio Collaboration with OpenAI Agents SDK o3/o4-mini Function Calling Guide Exploring Model Graders for Reinforcement Fine-Tuning Guide to Using the Responses API Reinforcement Fine-Tuning for Conversational Reasoning with the OpenAI API Evals API Use-case - Responses Evaluation Comparing Speech-to-Text Methods with the OpenAI API Generate images with GPT Image Multi-Tool Orchestration with RAG approach using OpenAI Multi-Language One-Way Translation with the Realtime API Doing RAG on PDFs using File Search in the Responses API How to use the Usage API and Cost API to monitor your OpenAI usage Leveraging model distillation to fine-tune a model Orchestrating Agents: Routines and Handoffs Prompt Caching 101 Developing Hallucination Guardrails
GitHub - openai/openai-apps-sdk-examples: Example apps for the Apps SDK
2025-10-06 · via OpenAI Developers

Apps SDK Examples Gallery

MIT License

This repository showcases example UI components to be used with the Apps SDK, as well as example MCP servers that expose a collection of components as tools. It is meant to be used as a starting point and source of inspiration to build your own apps for ChatGPT.

Note: If you are on Chrome and have recently updated to version 142, you will need to disable the local-network-access flag to see the widget UI.

How to disable it:

  1. Go to chrome://flags/
  2. Find #local-network-access-check
  3. Set it to Disabled

⚠️ Note 🚨 Make sure to restart Chrome after changing this flag for the update to take effect.

MCP + Apps SDK overview

The Model Context Protocol (MCP) is an open specification for connecting large language model clients to external tools, data, and user interfaces. An MCP server exposes tools that a model can call during a conversation and returns results according to the tool contracts. Those results can include extra metadata—such as inline HTML—that the Apps SDK uses to render rich UI components (widgets) alongside assistant messages.

Within the Apps SDK, MCP keeps the server, model, and UI in sync. By standardizing the wire format, authentication, and metadata, it lets ChatGPT reason about your connector the same way it reasons about built-in tools. A minimal MCP integration for Apps SDK implements three capabilities:

  1. List tools – Your server advertises the tools it supports, including their JSON Schema input/output contracts and optional annotations (for example, readOnlyHint).
  2. Call tools – When a model selects a tool, it issues a call_tool request with arguments that match the user intent. Your server executes the action and returns structured content the model can parse.
  3. Return widgets – Alongside structured content, return embedded resources in the response metadata so the Apps SDK can render the interface inline in the Apps SDK client (ChatGPT).

Because the protocol is transport agnostic, you can host the server over Server-Sent Events or streaming HTTP—Apps SDK supports both.

The MCP servers in this demo highlight how each tool can light up widgets by combining structured payloads with _meta.ui.resourceUri metadata returned from the MCP servers.

Repository structure

  • src/ – Source for each widget example.
  • assets/ – Generated HTML, JS, and CSS bundles after running the build step.
  • shopping_cart_python/ – Python MCP server that demonstrates how _meta["widgetSessionId"] keeps widgetState in sync across turns for a shopping-cart widget.
  • pizzaz_server_node/ – MCP server implemented with the official TypeScript SDK.
  • pizzaz_server_python/ – Python MCP server that returns the Pizzaz widgets.
  • solar-system_server_python/ – Python MCP server for the 3D solar system widget.
  • kitchen_sink_server_node/ – Node MCP server for the kitchen-sink-lite widget.
  • kitchen_sink_server_python/ – Python MCP server for the kitchen-sink-lite widget.
  • authenticated_server_python/ – Python MCP server that demonstrates authenticated tool calls.
  • build-all.mts – Vite build orchestrator that produces hashed bundles for every widget entrypoint.

Pizzaz overview

This example contains multiple components showing multiple types of views and interactions: a list view, a carousel view, a map view. It also contains a "pizzaz shop" showing interactive flows and a checkout page.

This example uses the Apps SDK UI library for simple components such as images, buttons, and badges.

Kitchen sink lite overview

The kitchen sink lite sample shows the full window.openai surface working together:

  • Reads host state (toolInput, toolOutput, displayMode, theme, widgetState).
  • Writes host state with setWidgetState.
  • Calls another MCP tool from the widget with callTool.
  • Uses host helpers like requestDisplayMode, openExternal, and sendFollowUpMessage.

Use it as a reference for how to wire UI to MCP tool responses and host APIs with the Apps SDK UI components.

Prerequisites

  • Node.js 18+
  • pnpm (recommended) or npm/yarn
  • Python 3.10+ (for the Python MCP server)
  • pre-commit for formatting

Install dependencies

Clone the repository and install the workspace dependencies:

pnpm install
pre-commit install

Using npm or yarn? Install the root dependencies with your preferred client and adjust the commands below accordingly.

Build the components gallery

The components are bundled into standalone assets that the MCP servers serve as reusable UI resources.

This command runs build-all.mts, producing versioned .html, .js, and .css files inside assets/. Each widget is wrapped with the CSS it needs so you can host the bundles directly or ship them with your own server.

To iterate on your components locally, you can also launch the Vite dev server:

Serve the static assets

All of the MCP servers expect the bundled HTML, JS, and CSS to be served from the local static file server. After every build, start the server before launching any MCP processes:

The assets are exposed at http://localhost:4444 with CORS enabled so that local tooling (including MCP inspectors) can fetch them.

Note: The Python Pizzaz server caches widget HTML with functools.lru_cache. If you rebuild or manually edit files in assets/, restart the MCP server so it picks up the updated markup.

Run the MCP servers

The repository ships several demo MCP servers that highlight different widget bundles:

  • Pizzaz (Node & Python) – pizza-inspired collection of tools and components
  • Solar system (Python) – 3D solar system viewer
  • Authenticated (Python) – set of tools that require different levels of OAuth
  • Kitchen sink lite (Node & Python) – minimal widget + server pairing that demonstrates tool output, widget state, callTool, and host helpers
  • Shopping cart (Python) – simple shopping cart widget that demonstrates how to use widgetSessionId to keep state between tool calls

Pizzaz Node server

cd pizzaz_server_node
pnpm start

Pizzaz Python server

python -m venv .venv
source .venv/bin/activate
pip install -r pizzaz_server_python/requirements.txt
uvicorn pizzaz_server_python.main:app --port 8000

Authenticated Python server

python -m venv .venv
source .venv/bin/activate
pip install -r authenticated_server_python/requirements.txt
uvicorn authenticated_python_server.main:app --port 8000

Solar system Python server

python -m venv .venv
source .venv/bin/activate
pip install -r solar-system_server_python/requirements.txt
uvicorn solar-system_server_python.main:app --port 8000

Kitchen sink lite Node server

pnpm --filter kitchen-sink-mcp-node start

Kitchen sink lite Python server

python -m venv .venv
source .venv/bin/activate
pip install -r kitchen_sink_server_python/requirements.txt
uvicorn kitchen_sink_server_python.main:app --port 8000

Shopping cart Python server

Use this example to learn how _meta["widgetSessionId"] can carry widgetState between tool calls so the model and widget share the same shopping cart. The widget merges tool responses with prior widgetState, and UI actions (like incrementing quantities) feed back into that shared state so the assistant always sees the latest cart.

python -m venv .venv
source .venv/bin/activate
pip install -r shopping_cart_python/requirements.txt
uvicorn shopping_cart_python.main:app --port 8000

Note

In production you should persist the cart server-side (see shopping_cart_python/README.md), but this demo shows the mechanics of keeping state through widgetSessionId.


You can reuse the same virtual environment for all Python servers—install the dependencies once and run whichever entry point you need.

Testing in ChatGPT

To add these apps to ChatGPT, enable developer mode, and add your apps in Settings > Connectors.

To add your local server without deploying it, you can use a tool like ngrok to expose your local server to the internet.

For example, once your mcp servers are running, you can run:

You will get a public URL that you can use to add your local server to ChatGPT in Settings > Connectors.

For example: https://<custom_endpoint>.ngrok-free.app/mcp

Important

The Python MCP SDK enforces DNS rebinding protection. When tunneling (for example via ngrok), allow your tunnel host before starting any Python server:

export MCP_ALLOWED_HOSTS="<custom_endpoint>.ngrok-free.app"
export MCP_ALLOWED_ORIGINS="https://<custom_endpoint>.ngrok-free.app"

Once you add a connector, you can use it in ChatGPT conversations.

You can add your app to the conversation context by selecting it in the "More" options.

more-chatgpt

You can then invoke tools by asking something related. For example, for the Pizzaz app, you can ask "What are the best pizzas in town?".

Next steps

  • Customize the widget data: edit the handlers in pizzaz_server_node/src, pizzaz_server_python/main.py, or the solar system server to fetch data from your systems.
  • Create your own components and add them to the gallery: drop new entries into src/ and they will be picked up automatically by the build script.

Deploy your MCP server

You can use the cloud environment of your choice to deploy your MCP server.

Include this in the environment variables:

BASE_URL=https://your-server.com
API_BASE_URL=https://your-api.example.com

This will be used to generate the HTML for the widgets so that they can serve static assets from this hosted url. API_BASE_URL is used by client widgets to build fully-qualified API URLs (for example, the Cards Against AI game event stream).

Contributing

You are welcome to open issues or submit PRs to improve this app, however, please note that we may not review all suggestions.

License

This project is licensed under the MIT License. See LICENSE for details.