ChatGPT Interactive Components Examples
Provides production-ready examples of MCP servers that demonstrate building rich, interactive UI components for ChatGPT, including authentication flows, product search with carousels, shopping cart checkout, and membership signups with state management.
README
ChatGPT MCP Server Examples
Build interactive, branded components for ChatGPT using the Model Context Protocol (MCP)
This repository contains complete, production-ready examples of MCP servers that demonstrate how to create rich, interactive experiences within ChatGPT. Each example showcases different UI patterns, state management techniques, and integration strategies.
🎯 What You'll Learn
- How to build MCP servers that serve interactive widgets to ChatGPT
- State management across user sessions
- Dark/light mode support
- Multi-step UI flows with transitions
- API integration and data presentation
- Deployment strategies
🚀 Live MCP Server URLs
You can connect to these live servers directly in ChatGPT:
| MCP Server | URL | Description |
|---|---|---|
| Authentication | https://chatgpt-components-0d9232341440.herokuapp.com/mcp |
Session-based authentication with 3-screen flow |
| Product Search | https://chatgpt-components-0d9232341440.herokuapp.com/mcp2 |
Interactive product carousel with Agentforce recommendations |
| Checkout | https://chatgpt-components-0d9232341440.herokuapp.com/mcp3 |
Shopping cart and checkout flow |
| Membership | https://chatgpt-components-0d9232341440.herokuapp.com/mcp4 |
Circle 360 membership signup with tier selection |
How to Connect
- Open ChatGPT → Settings → Connectors
- Click "Add Connector"
- Paste one of the URLs above
- Start chatting! Try: "Log me into my Target account" or "Search for fitness trackers"
📚 What's Included
4 Complete MCP Server Examples
1. Authentication Server (/mcp)
- 3-screen authentication flow (login → verification → success)
- Session management with unique session IDs
- State persistence across tool calls
- Demo credentials for testing
Example prompt: "I need to sign in to Target"
2. Product Search Server (/mcp2)
- Product carousel widget with images, prices, ratings
- Agentforce personalized recommendations
- Integration with Unwrangle API
- Detail view for individual products
- Dark/light mode support
Example prompt: "Search Target for fitness trackers"
3. Checkout Server (/mcp3)
- Add-to-cart confirmation widget
- Complete checkout flow with pre-filled payment/shipping
- Order summary and success animations
- Single-item cart enforcement
Example prompt: "Add the Fitbit to my cart and checkout"
4. Membership Server (/mcp4)
- Circle 360 membership signup
- 3-tier selection UI
- Dynamic order summary
- Processing screen with success confetti
- Demo reset endpoint for testing
Example prompt: "Sign me up for Circle 360"
🏗️ Repository Structure
ChatGPT Components/
├── server.js # Main Node.js MCP server (all 4 servers)
├── widgets/ # Interactive HTML components
│ ├── target-auth.html # Authentication widget
│ ├── product-carousel.html # Product search widget
│ ├── add-to-cart.html # Add to cart widget
│ ├── checkout.html # Checkout widget
│ └── circle-signup.html # Membership signup widget
├── public/ # Static pages
│ ├── auth.html # External auth page (Custom GPT Actions)
│ └── privacy.html # Privacy policy
├── docs/ # Documentation
│ ├── BUILDING_MCP_SERVERS.md # Tutorial: Build your own
│ ├── ARCHITECTURE.md # System design overview
│ └── examples/ # Detailed example docs
│ ├── authentication.md
│ ├── product-search.md
│ ├── checkout.md
│ └── membership.md
├── package.json # Dependencies
├── Procfile # Heroku deployment config
└── README.md # You are here
🎓 Getting Started
Prerequisites
- Node.js 20.x or higher
- npm 10.x or higher
- (Optional) Heroku CLI for deployment
Local Development
- Clone the repository
git clone <your-repo-url>
cd ChatGPT-Components
- Install dependencies
npm install
- Set environment variables
export UNWRANGLE_API_KEY=your_api_key_here # For product search
- Start the server
npm start
- Test in ChatGPT
- Add connector:
http://localhost:8000/mcp(or/mcp2,/mcp3,/mcp4) - Start chatting!
- Add connector:
Deploy to Heroku
heroku create your-app-name
heroku config:set UNWRANGLE_API_KEY=your_api_key_here
git push heroku main
Your MCP servers will be available at:
https://your-app-name.herokuapp.com/mcphttps://your-app-name.herokuapp.com/mcp2https://your-app-name.herokuapp.com/mcp3https://your-app-name.herokuapp.com/mcp4
📖 Learn More
- Building MCP Servers Tutorial - Step-by-step guide to creating your own MCP server
- Architecture Overview - How the system works under the hood
- Example Documentation - Deep dives into each example server
🎨 Key Features Demonstrated
UI/UX Patterns
- ✅ Multi-screen flows with smooth transitions
- ✅ Loading states and progress indicators
- ✅ Success animations (checkmarks, confetti)
- ✅ Dark/light mode support (respects ChatGPT theme)
- ✅ Responsive design
- ✅ Form validation and error handling
Technical Patterns
- ✅ Session management with unique IDs
- ✅ State persistence across tool calls
- ✅ SSE (Server-Sent Events) for real-time communication
- ✅ Multiple MCP servers on one Node.js app
- ✅ External API integration
- ✅ Widget-to-server communication
- ✅
window.openaiAPI usage
Business Logic
- ✅ Authentication flows
- ✅ Product recommendations
- ✅ Shopping cart management
- ✅ Payment/checkout flows
- ✅ Membership signups
🔧 Customization
Each widget is self-contained in widgets/ and can be customized:
- Styling: Modify CSS within each HTML file
- Branding: Change colors, logos, and text
- Flow: Add/remove steps in multi-screen flows
- Behavior: Edit JavaScript event handlers
Server logic is in server.js:
- Tools: Add new tool definitions in each
createMcpXServerfunction - Sessions: Customize state management in
authSessions,cartStorage, etc. - APIs: Integrate your own backend services
🤝 Contributing
This repository is designed to be:
- Educational: Learn by example
- Modular: Copy what you need
- Production-ready: Use as-is or customize
Feel free to fork, modify, and build upon these examples!
📝 License
MIT License - feel free to use this code in your own projects!
🆘 Support
- Issues: Open a GitHub issue
- Questions: Check the documentation
- Examples: See detailed guides in docs/examples/
🌟 What's Next?
After exploring these examples, try:
- Building your own MCP server from scratch
- Combining multiple tools in creative ways
- Integrating with your own APIs and services
- Deploying to production
Check out BUILDING_MCP_SERVERS.md to get started!
Built with ❤️ using the Model Context Protocol
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。