Apps SDK Resources
Apps SDK Resources enable you to build widgets that are fully compatible with OpenAI’s Apps SDK, allowing your MCP server to provide rich interactive experiences in ChatGPT and other OpenAI-powered applications.Overview
The Apps SDK is OpenAI’s framework for creating interactive widgets that:- Render in ChatGPT conversations
- Support structured data injection
- Include security policies
- Provide tool invocation feedback
- Load external resources securely
Apps SDK Format
Apps SDK widgets use thetext/html+skybridge MIME type and include specific metadata:
Metadata Configuration
Widget Description
Describes what the widget does for accessibility and discovery:Content Security Policy
Define allowed external resources:Tool Invocation Status
Provide feedback during tool execution:Accessibility Options
Data Injection
Apps SDK widgets receive data throughwindow.openai API:
Tool Input (toolInput)
Parameters passed to the tool that triggered the widget:
Tool Output (toolOutput)
The structuredContent returned by the tool execution:
Widget State (widgetState)
Persistent state for the widget instance:
useWidget hook instead of accessing window.openai directly. See UI Widgets for React integration.
Tool Integration
Apps SDK widgets are registered as both tools and resources:Pizzaz Reference Widgets
The Apps SDK template includes 5 reference widgets from OpenAI’s Pizzaz examples:1. Pizza Map Widget
Interactive map visualization:2. Pizza Carousel Widget
Image carousel component:3. Pizza Albums Widget
Gallery grid layout:4. Pizza List Widget
Structured list display:5. Pizza Video Widget
Video player component:External Resources
Apps SDK widgets can load external libraries and resources:Loading from CDNs
CDN Whitelist
Remember to add CDN domains to your CSP:Creating Custom Apps SDK Widgets
Step 1: Define the Widget Structure
Step 2: Register as UI Resource
Step 3: Create Corresponding Tool
Best Practices
1. Progressive Enhancement
2. Error Handling
3. Responsive Design
4. Accessibility
Security Considerations
1. Content Security Policy
Always define appropriate CSP:2. Input Validation
3. Sanitize User Content
Testing Apps SDK Widgets
Local Testing
- Start your MCP server:
- Test widget rendering:
- View in Inspector:
- Navigate to
http://localhost:3000/inspector - Execute tools to see widget output
ChatGPT Testing
- Configure your MCP server URL in ChatGPT
- Invoke tools that return Apps SDK widgets
- Verify widget rendering in conversation
Troubleshooting
Widget Not Rendering
- Check MIME type is
text/html+skybridge - Verify metadata structure
- Check for JavaScript errors in widget
- Validate CSP configuration
Data Not Available
- Check
window.openai.toolOutputexists - Verify tool returns
structuredContent - Check data structure matches expectations
External Resources Blocked
- Add domains to CSP whitelist
- Use HTTPS for all resources
- Check CORS headers if applicable
Testing Apps SDK Widgets
Using the Inspector
The MCP Inspector fully emulates thewindow.openai API, allowing you to test widgets locally:
- Start your server:
npm run dev - Open Inspector:
http://localhost:3000/inspector - Execute tools: Test widgets with different parameters
- Debug interactions: Use console logs and inspector features
- Test API methods: Verify
callTool,setWidgetState, etc.
window.openai API emulation including:
toolInputandtoolOutputinjectionsetWidgetStatewith localStorage persistencecallToolfor calling other MCP toolssendFollowUpMessagefor conversation continuationrequestDisplayModefor layout changes- Theme and display mode synchronization
Testing in ChatGPT
- Configure your MCP server URL in ChatGPT settings
- Invoke tools that return Apps SDK widgets
- Verify widget rendering and all interactions
- Test in production environment
Next Steps
- UI Widgets - Automatic widget registration with React
- Creating Apps SDK Server - Complete guide
- Debugging ChatGPT Apps - Test widgets with Inspector
- Templates - Project templates