Skip to content

Commit 67a7060

Browse files
committed
add readme and finished content
1 parent d7a51be commit 67a7060

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed

exercises/FINISHED.mdx

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,50 @@
11
# MCP UI 🪟
22

3-
Hooray! You're all done! 👏👏
3+
Hooray! You made it through the whole workshop! 👏
4+
5+
## What you've learned
6+
7+
### 1. Simple - Raw HTML UI Resources
8+
9+
Learned the core pattern: use `createUIResource` to return a `rawHtml` UI resource instead of plain text. You delivered styled, visual output (e.g. info cards) and saw how a `uri` + content type package UI for compliant clients.
10+
11+
### 2. Consistent - Remote DOM
12+
13+
Moved from hand-authored HTML/CSS to a component-driven, host-consistent layer (Shopify's Remote DOM). You gained: design system consistency, built-in interactivity, less styling drift, and safer structured creation of elements (`ui-text`, `ui-button`, etc.).
14+
15+
### 3. Complex - Iframe / Embedded Apps
16+
17+
Escalated to full application surfaces using the `externalUrl` content type. Added preferred sizing metadata, understood lifecycle messages, and decomposed complexity into an independently deployed (or locally served) app. Sub-steps introduced readiness, fixed sizing, and dynamic resizing strategies.
18+
19+
### 4. Interactive - Communication Protocol
20+
21+
Empowered iframes to participate in workflows: sending `link`, `tool`, and `prompt` messages via `postMessage`. You handled message IDs, async responses, and error feedback—turning passive UI into an active collaborator with the host + MCP toolchain.
22+
23+
### 5. Advanced - Tool Results & Render Data
24+
25+
Closed the loop on data richness and performance:
26+
27+
- **Structured Tool Results:** Defined output schemas so clients can safely parse, validate, and branch on outcomes (e.g. metrics, suggestions).
28+
- **Render Data:** Preloaded initial iframe data through `uiMetadata` (`initial-render-data`) to avoid extra network hops and securely pass contextual, possibly private data at creation time.
29+
30+
### Putting It All Together
31+
32+
Across the progression you learned how to choose the right abstraction:
33+
34+
- Raw HTML → quickest path to visual output
35+
- Remote DOM → consistency & built-in components
36+
- Iframe Apps → full framework power & complex interaction
37+
- Protocol Messaging → rich, bi-directional intent + action
38+
- Structured Results & Render Data → reliability, safety, and performance
39+
40+
### Next Steps
41+
42+
You're well equipped to ship production-grade MCP UI experiences. Consider:
43+
44+
- Converting existing plain-text MCP tools into visual UI resources
45+
- Adding schema validation everywhere a boundary exists (tool inputs/outputs, render data)
46+
- Building a reusable internal component library for Remote DOM use
47+
- Layering authorization & audit logging around iframe messages
48+
- Contributing examples or docs back to the MCP UI ecosystem
49+
50+
You've taken AI interaction from linear text to adaptive, interactive surfaces that feel native and intentional. Nicely done. Keep experimenting—and ship something real next.

exercises/README.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
# MCP UI 🪟
22

3+
👨‍💼 Hello, my name is Peter the Product Manager. I'm here to help you get oriented and to give you your assignments for the workshop!
4+
5+
Welcome to **MCP UI 🪟**! In this workshop, you'll dive into the world of the [Model Context Protocol (MCP)](https://modelcontextprotocol.io)—an open protocol designed to seamlessly connect AI models with external data sources and tools. [MCP UI](https://mcpui.dev) is a powerful extension to the spec that enables servers to send rich, interactive user interfaces along with their responses, transforming AI chat into visually engaging experiences.
6+
7+
Throughout this workshop, you'll learn:
8+
9+
- The core concepts of MCP UI and how it extends the MCP protocol
10+
- How to create raw HTML UI resources
11+
- How to create consistent UI with Remote DOM
12+
- How to build complex interactions with iframe-based UI components
13+
- How to implement interactive communication between iframes and the host using `postMessage`
14+
- Advanced features like structured tool results and passing initial render data
15+
316
## Check out how to set up an MCP UI agent
417

518
<EpicVideo
619
title="Use MCP-UI with nanobot.ai"
720
url="https://www.epicai.pro/use-mcp-ui-with-nanobot-ai-8fc71"
821
/>
22+
23+
Ready to connect your AI to the world... Visually!? Let's get started!

0 commit comments

Comments
 (0)