A ChatGPT app that fetches and displays XKCD comics using MCP (Model Context Protocol) and the OpenAI Apps SDK.
Authentication: NONE - All endpoints are publicly accessible.
- XKCD Comic Viewer: Beautiful widget displaying comics with title, image, alt text, and date
- Fetch latest or specific comics by number
- URL support: Automatically extracts comic numbers from XKCD URLs
- Clean black and white UI with responsive layout
# Setup
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
# Run
python main.pyServer runs at http://0.0.0.0:8000
- Start the server:
python main.py - In ChatGPT, connect to MCP server at
http://localhost:8000/mcp - Request comics using:
- URLs:
https://xkcd.com/327/orxkcd.com/327 - Numbers:
#327orShow me XKCD comic 327 - Natural language:
Show me the latest XKCD comic
- URLs:
xkcd-chatgpt-app/
├── main.py # MCP server entry point
├── src/
│ └── xkcd_app/ # Application package
│ ├── models.py # Data models and schemas
│ ├── widgets.py # Widget definitions
│ ├── handlers.py # MCP request handlers
│ ├── html_generator.py # HTML generation
│ └── xkcd_client.py # XKCD API client
└── requirements.txt # Dependencies
MIT