ChatGPT Interactive Components Examples

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.

Category
Visit Server

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

  1. Open ChatGPT → Settings → Connectors
  2. Click "Add Connector"
  3. Paste one of the URLs above
  4. 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

  1. Clone the repository
git clone <your-repo-url>
cd ChatGPT-Components
  1. Install dependencies
npm install
  1. Set environment variables
export UNWRANGLE_API_KEY=your_api_key_here  # For product search
  1. Start the server
npm start
  1. Test in ChatGPT
    • Add connector: http://localhost:8000/mcp (or /mcp2, /mcp3, /mcp4)
    • Start chatting!

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/mcp
  • https://your-app-name.herokuapp.com/mcp2
  • https://your-app-name.herokuapp.com/mcp3
  • https://your-app-name.herokuapp.com/mcp4

šŸ“– Learn More

šŸŽØ 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.openai API 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 createMcpXServer function
  • 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

🌟 What's Next?

After exploring these examples, try:

  1. Building your own MCP server from scratch
  2. Combining multiple tools in creative ways
  3. Integrating with your own APIs and services
  4. Deploying to production

Check out BUILDING_MCP_SERVERS.md to get started!


Built with ā¤ļø using the Model Context Protocol

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured