This repository provides a ChatGPT connector that lets you search and consult books from Project Gutenberg using the public Gutendex API. It uses the OpenAI Apps SDK conventions and the Model Context Protocol (MCP) to expose a search tool that returns a rich widget rendered inline in the chat.
📚 Want to build your own ChatGPT app? Check out our comprehensive ChatGPT Apps Development Guide to
learnhelp your agent know how to create custom ChatGPT applications from scratch!
- The MCP server exposes a single tool:
gutendex.books.search. - Tool responses include structured JSON and
_meta.openai/outputTemplatemetadata so the Apps SDK can hydrate the matching widget. - The widget (
gutendex-search) renders a paginated list of books with quick links to open formats such as HTML or plain text.
src/– Widget source (gutendex-search).assets/– Generated HTML, JS, and CSS bundles after running the build step.gutendex_server_node/– Node MCP server implemented with the official TypeScript SDK.build-all.mts– Vite build orchestrator that produces hashed bundles for the widget.
- Node.js 18+
- pnpm (recommended) or npm/yarn
pnpm installpnpm run buildThis produces versioned .html, .js, and .css files inside assets/. The server reads gutendex-search.html from this directory.
To iterate on the component locally, you can also launch the Vite dev server:
pnpm run devIf you want to preview the generated bundle without the MCP server:
pnpm run serveAssets are exposed at http://localhost:4444 with CORS enabled so local tooling (including MCP inspectors) can fetch them.
cd gutendex_server_node
pnpm startThe server exposes an SSE stream at GET /mcp and a post endpoint at POST /mcp/messages?sessionId=....
Enable developer mode and add the server as a Connector in Settings > Connectors. If you need a public URL for your local server, expose it with a tunneling tool like ngrok and use the public /mcp endpoint.
Host the static assets and the MCP server.
Set BASE_URL at build time to the public origin where assets/ is served:
BASE_URL=https://your-public-assets-origin pnpm run build
- ChatGPT Apps Development Guide - A comprehensive guide to creating your own simple ChatGPT app from scratch
- Full Documentation - Complete technical documentation and API reference available in markdown format in the ChatGPT Apps SDK Markdown Documentation repository
This project is licensed under the MIT License. See LICENSE for details.