Free Intensive Nov 21–22Free 2-day hands-on Vibecoding Intensive on Nov 21–22 at 16:00 MSK (Sat–Sun) · Live Cohort 3 starts Nov 23Join Free →Cohort 3 (Nov 23)
ReleaseInsight · On RadarHabr AI→ original

How to Embed Your Own App in ChatGPT: MCP Apps Shows a Coloring Book Gallery Right in the Chat

For ChatGPT to assess release risks on Friday, it needs access to GitHub, the task tracker, and the calendar, and an MCP Server builds that bridge. But reading a table of fifty tasks in a chat is awkward, and MCP Apps helps here: it displays an interactive interface right inside the dialogue. The author used this approach to embed a coloring book gallery built on React and Supabase into ChatGPT. A server alone is enough for a short summary, but filters and actions require MCP Apps.

AI-processed from Habr AI; edited by Hamidun News
How to Embed Your Own App in ChatGPT: MCP Apps Shows a Coloring Book Gallery Right in the Chat
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1The server runs as a Supabase Edge Function on the same PostgreSQL database
Key metric #2Deleting a coloring book requires a confirmation dialog and the DELETE parameter
The UI loads thumbnails on its ownthe model receives only identifiers

Imagine a project manager asking an AI: "What are the risks for Friday's release? Check open tasks, PRs without review, and upcoming deadlines." The data lives in GitHub, an internal task tracker, and a corporate calendar, and without connections to them the model cannot answer. The Model Context Protocol (MCP) exists for such connections. When a text reply is not enough and you need to flip through images, filter tasks, or download a file, the MCP Apps extension works on top of MCP. The author of the Habr write-up demonstrated both parts on a live project. It is a useful reference for anyone planning to embed their own application into AI clients.

What the MCP Server Does

MCP does not replace existing APIs. It provides a standard interface through which an AI client discovers and calls tools and resources. Inside, the server itself calls your REST or GraphQL APIs, databases, and other services. Business logic and access control remain on the company's side.

In the release example, you could build one server with a tool such as get_release_readiness. It would gather open tasks, check PRs without review, match deadlines, and return a summary. Another option is several independent servers, one per system. The choice depends on where it is more convenient to keep the logic for merging data and handling errors. The advantage of this approach is that one server works with different clients that support the protocol. However, the capabilities and limitations of those clients vary.

What MCP Apps Adds

Usually the server returns JSON, for example "release 2.4.0, 3 blocking tasks, 5 PRs without review, status at_risk," and the model paraphrases it as text. For a small summary, this is enough. But dozens of tasks, filters by team, and comparisons between releases are inconvenient in text, and endless follow-up questions to the model wear users out. MCP Apps links a tool to a UI resource. The client loads the interface and shows a table, cards, a chart, or a form directly in the conversation.

The roles are separated. The server handles operations, data, authorization, and calls to external systems. The app handles display and, if the host supports it, calls the server's tools itself. The full web application stays where it is, and only the part the user needs alongside the model is moved into the chat.

Example: A Coloring Book Gallery in ChatGPT

The author took their service for personalized fairy tales and coloring books, built with React, TypeScript, and Supabase. They did not move the entire application. Instead, they kept three actions with finished coloring books in the chat: viewing, downloading, and deleting. When asked "Show my latest coloring books," ChatGPT calls the get_coloring_gallery tool, and the gallery opens in the dialogue.

How it is built:

  • The MCP Server runs as a Supabase Edge Function using the @modelcontextprotocol/server package and uses the same PostgreSQL database as the main application.
  • Authorization goes through Supabase Auth via OAuth. Access is limited to a family account, and image ownership is additionally verified on the server.
  • The tool is linked to the interface via _meta.ui.resourceUri. The UI itself is registered as a separate resource with the mimeType text/html;profile=mcp-app.
  • React and CSS are bundled with esbuild and embedded into the HTML, so no external JavaScript file is needed. The UI runs in an isolated environment and gets no arbitrary access to the ChatGPT page.
  • On the client side, the @modelcontextprotocol/ext-apps package is used: an App object connects to the host, receives the tool's result, and responds to switching between light and dark themes.

Data transfer is kept lean. The gallery tool returns only coloring book identifiers, and React loads the thumbnails itself through a service tool, get_coloring_gallery_thumbnail, marked with visibility: ['app']. Heavy images never pass through the model, which needs only the list of identifiers.

Downloading works through the get_coloring_image tool and the app.downloadFile() method. The app receives a PNG from the server and hands the file to the host, with no link to private storage. Deletion is handled more strictly because it changes data. A confirmation dialog appears first, and only after the user agrees is delete_coloring called with the parameter confirmation: 'DELETE'. Read and write operations are separated on the server.

Limitations and Conclusion

Not all MCP clients can display MCP Apps, so tools should be designed to remain useful without an interface. Arguments coming from the client cannot be trusted: the model may get the tool or its parameters wrong, so check permissions and validation on the server. In addition, this is extra infrastructure. The server must be deployed, tested, and maintained, and MCP Apps adds interface development and compatibility testing.

The practical rule is simple. If a user is satisfied with an answer or a short summary, build only an MCP Server. If you need filters, multiple selection, files, or confirmation of risky actions, add MCP Apps. Before that, estimate whether such an interface will pay off relative to the cost of maintaining it.

Story

Key Questions Answered

What the MCP Server Does?

MCP does not replace existing APIs. It provides a standard interface through which an AI client discovers and calls tools and resources. Inside, the server itself calls your REST or GraphQL APIs, databases, and other services. Business logic and access control remain on the company's side. In the release example, you could build one server with a tool such as get_release_readiness. It would gather open tasks, check PRs without review, match deadlines, and return a summary.

What MCP Apps Adds?

Usually the server returns JSON, for example "release 2.4.0, 3 blocking tasks, 5 PRs without review, status at_risk," and the model paraphrases it as text. For a small summary, this is enough. But dozens of tasks, filters by team, and comparisons between releases are inconvenient in text, and endless follow-up questions to the model wear users out. MCP Apps links a tool to a UI resource. The client loads the interface and shows a table, cards, a chart, or a form directly in the conversation.

What are the key details on Example: A Coloring Book Gallery in ChatGPT?

The author took their service for personalized fairy tales and coloring books, built with React, TypeScript, and Supabase. They did not move the entire application. Instead, they kept three actions with finished coloring books in the chat: viewing, downloading, and deleting. When asked "Show my latest coloring books," ChatGPT calls the get_coloring_gallery tool, and the gallery opens in the dialogue.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Hands-On AI Engineering · Hamidun Academy

Build & Ship Production AI Agents Without Boilerplate Code

Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.

Start 72h Free Trial →Vibe-Coding Intensive
What do you think?
Loading comments…