mcp-use Advantage: Write your widgets once using
type: "mcpApps" and
they’ll work with both MCP Apps clients AND ChatGPT automatically. This
unique dual-protocol support means maximum compatibility with minimal effort.Why MCP Apps?
MCP Apps is the recommended widget protocol for MCP servers because it:- MCP-native: Built specifically for the Model Context Protocol ecosystem
- Open Standard: Based on SEP-1865, ensuring long-term compatibility
- Secure: Double-iframe sandbox architecture with granular CSP control
- Feature-rich: JSON-RPC 2.0 communication with full MCP integration
- Future-proof: Supported by growing ecosystem of MCP clients
Quick Start
Start with the MCP Apps template:MCP Apps vs ChatGPT Apps SDK
While both protocols enable interactive widgets, they have key differences:| Feature | MCP Apps (Standard) | ChatGPT Apps SDK |
|---|---|---|
| Protocol | JSON-RPC 2.0 over postMessage | window.openai global API |
| MIME Type | text/html;profile=mcp-app | text/html+skybridge |
| Specification | SEP-1865 (open standard) | OpenAI proprietary |
| Architecture | Double-iframe sandbox | Single iframe |
| CSP Format | camelCase (connectDomains) | snake_case (connect_domains) |
| Client Support | MCP Apps clients (Claude, Goose, etc.) | ChatGPT |
| mcp-use Support | ✅ Full support | ✅ Full support |
Best of Both Worlds: With mcp-use, you don’t have to choose! Using
type: "mcpApps" generates metadata for both protocols automatically, so your
widgets work everywhere.Creating an MCP Apps Widget
Using Dual-Protocol Type (Recommended)
ThemcpApps type enables your widgets to work with both MCP Apps clients and ChatGPT:
Widget Code (Protocol-Agnostic)
The beauty of mcp-use is that your widget code is identical regardless of which protocol is used:- ✅ Claude Desktop (MCP Apps protocol)
- ✅ ChatGPT (Apps SDK protocol)
- ✅ Goose (MCP Apps protocol)
- ✅ Any MCP Apps-compatible client
- ✅ Future clients supporting either protocol
MCP Apps Bridge API
For widgets that need direct protocol access, mcp-use provides the MCP Apps bridge:Most widgets won’t need the bridge directly. The
useWidget() hook provides a
simplified API that works across both protocols automatically.Protocol-Specific Metadata
While mcp-use handles protocol differences automatically, you can provide protocol-specific metadata when needed:Migration from Apps SDK
If you have existing widgets usingtype: "appsSdk", you can migrate to dual-protocol support. Note that this requires updating both the type and the metadata format.
Before (ChatGPT only):
After (Universal compatibility):
type: "appsSdk"→type: "mcpApps"appsSdkMetadata→metadata(field name change)"openai/widgetCSP"→csp(remove openai/ prefix)connect_domains→connectDomains(snake_case → camelCase)resource_domains→resourceDomains(snake_case → camelCase)"openai/widgetPrefersBorder"→prefersBorder(remove openai/ prefix)
Migration Options
You have three options when migrating: Option 1: Full Migration (Recommended) Migrate completely to the newmetadata format for maximum clarity:
type: "appsSdk":
Field Mapping Reference
Complete mapping from Apps SDK to MCP Apps metadata:Apps SDK (appsSdkMetadata) | MCP Apps (metadata) | Notes |
|---|---|---|
"openai/widgetCSP" | csp | CSP configuration object |
connect_domains | connectDomains | Array of connection domains |
resource_domains | resourceDomains | Array of resource domains |
frame_domains | frameDomains | Array of frame domains |
redirect_domains | redirectDomains | Array of redirect domains (ChatGPT-specific) |
script_directives | scriptDirectives | Array of script CSP directives |
style_directives | styleDirectives | Array of style CSP directives |
"openai/widgetPrefersBorder" | prefersBorder | Boolean |
"openai/widgetDomain" | domain | String (custom domain) |
"openai/widgetDescription" | widgetDescription | String (widget description) |
"openai/widgetAccessible" | widgetAccessible | Boolean (ChatGPT-specific, can stay in appsSdkMetadata) |
"openai/locale" | locale | String (ChatGPT-specific, can stay in appsSdkMetadata) |
Migration Checklist
Follow these steps to migrate:-
✅ Change the widget type:
-
✅ Rename the metadata field:
-
✅ Transform CSP configuration:
-
✅ Transform other metadata fields:
- Remove
"openai/prefix from all keys - Convert remaining snake_case to camelCase
- Remove
-
✅ Test in both environments:
- Test in ChatGPT (Apps SDK protocol)
- Test in MCP Inspector with protocol toggle
- Test in MCP Apps-compatible client (Claude, Goose, etc.)
-
✅ Verify widget behavior:
- Props received correctly
- Theme syncing works
- Tool calls function properly
- CSP allows required resources
Comparison with MCP UI
MCP Apps is designed for interactive widgets, while MCP UI is better for simpler, static content:| Feature | MCP Apps | MCP UI |
|---|---|---|
| Use Case | Interactive widgets with state | Static/simple content |
| Interactivity | Full React components, tool calls | Limited (mostly display) |
| State Management | Built-in state persistence | No state |
| Tool Calls | ✅ Can call other MCP tools | ❌ No tool access |
| ChatGPT Support | ✅ Via dual-protocol | ❌ Not supported |
| Complexity | Higher (full React app) | Lower (simple HTML) |
- Interactive dashboards
- Forms and data entry
- Multi-step workflows
- Real-time updates
- Complex visualizations
- Simple content display
- Read-only views
- Lightweight embeds
Testing Your Widgets
Using the Inspector
The MCP Inspector fully supports both MCP Apps and ChatGPT Apps SDK protocols:- Start your server:
npm run dev - Open Inspector:
http://localhost:3000/inspector - Protocol Toggle: Switch between MCP Apps and ChatGPT protocols
- Debug Controls: Test different devices, locales, CSP modes
- Display Modes: Test inline, picture-in-picture, and fullscreen
Testing in Production Clients
ChatGPT:- Enable Developer Mode in Settings → Connectors → Advanced
- Add your MCP server URL
- Start a conversation and trigger your tools
- Add your server to Claude’s MCP configuration
- Widgets render automatically when tools return them
- Configure your MCP server in Goose
- Call tools that return widgets
Protocol Adapters (Advanced)
Behind the scenes, mcp-use uses protocol adapters to transform your widget configuration:Next Steps
- ChatGPT Apps SDK - Learn about the ChatGPT-specific protocol
- Widget Components - Explore React components and hooks
- Creating MCP Apps Server - Complete server setup guide
- Debugging Widgets - Test and debug with the Inspector
- MCP UI Resources - Alternative approach for simpler UIs