MCP and ChatGPT Apps Fundamentals
To build effectively with Skybridge, you first need to understand the underlying technologies it builds upon:- Model Context Protocol and MCP Servers
- the OpenAI Apps SDK to build ChatGPT Apps
Read our in-depth blog article to understand how ChatGPT Apps work
MCP (Model Context Protocol)
MCP is an open standard that allows AI models to connect with external tools, resources, and services. Think of it as an API layer specifically designed for LLMs. An MCP server exposes:- Tools: Functions the model can call (e.g.,
search_flights,get_weather) - Resources: Data the model can access (e.g., files, UI components)
ChatGPT Apps
ChatGPT Apps, announced by OpenAI in October 2025, extend MCP with a powerful new capability: interactive UI widgets that render directly inside the conversation.How ChatGPT Apps Work
A ChatGPT App consists of two components:- MCP Server: Handles your business logic and exposes tools
- UI Widgets: UI components that render in ChatGPT’s interface
- Text content: What the model sees and responds with
- Widget content: A visual UI that renders for the user
The Widget Rendering Flow
Here’s what happens when ChatGPT renders a widget:- User asks ChatGPT to perform an action (e.g., “Show me flight options to Paris”)
- ChatGPT calls your MCP tool (e.g.,
search_flights) - Your tool returns a result with data, and if the tool contains a reference to a UI resource, ChatGPT fetches the resource (your compiled React component) and renders it in an iframe, hydrated with your tool’s
structuredContentand_metaproperties.
The window.openai API
Widgets run inside an iframe and have access to a special window.openai API that enables:
toolOutput: Access the initial data passed from your toolwidgetState: Persist UI state across interactionscallTool(): Trigger additional tool calls from the UIsendFollowUpMessage(): Send messages back into the chatsetWidgetState(): Update persistent state
Skybridge Hook Mapping
Skybridge wraps the rawwindow.openai API with React hooks:
| Raw API | Skybridge Hook | Purpose |
|---|---|---|
window.openai.toolOutput | useToolInfo() | Access initial tool input/output |
window.openai.widgetState | useWidgetState() | Persistent widget state |
window.openai.callTool() | useCallTool() | Make additional tool calls |
window.openai.sendFollowUpMessage() | useSendFollowUpMessage() | Send follow-up messages |
window.openai.openExternal() | useOpenExternal() | Open external URLs |
window.openai.requestModal() | useRequestModal() | Request modal display |
window.openai.theme | useLayout() | Access ChatGPT theme |
window.openai.locale | useUser() | Access user locale |
window.openai.displayMode | useDisplayMode() | Access/change display mode |
What Skybridge Adds
Skybridge is a modular ChatGPT Apps framework that bridges the gap between standard MCP servers and OpenAI APIs. It includes:skybridge/server: A drop-in replacement for the official MCP SDK that adds widget registration and type inference capabilities.skybridge/web: A React library providing hooks, components, and the runtime glue to render your widgets inside ChatGPT’s iframe environment.- Local Dev Environment: A Vite plugin adds Hot Module Reload to your ChatGPT Apps, with optimized assets building for both local and production environments.
