Hosting MCP-UI Servers on TanStack Start

Jack HerringtonAbout 4 min readSep 22, 2025Watch original
THE SUMMARYAI-generated

Key Concepts

  • MCP UI Server: A service with an MCP endpoint that returns references to external iframes.
  • MCP UI Client: A component that renders the iframes referenced by the MCP UI Server.
  • UI Resource: A data structure containing a URI pointing to an iframe.
  • isUIResource: A function to check if a message is a UI Resource.
  • UIResourceRenderer: A React component to render UI Resources (iframes).
  • Iframe: An HTML element that embeds another HTML document within the current document.
  • Security: Isolating the client application from the content of external iframes.

1. Main Topics and Key Points

  • Objective: To build an MCP UI client that renders iframes returned by an MCP UI server.
  • MCP UI Server Recap: The video builds upon the previous video, which demonstrated creating an MCP UI server that returns references to external iframes.
  • Internal vs. External Usage: The video demonstrates using the MCP UI client internally for simplicity, but emphasizes its primary use case for rendering responses from external MCP servers.
  • Security Benefit: Using the UIResourceRenderer provides a security layer by isolating the client application from the iframe content.

2. Important Examples and Real-World Applications

  • Acoustic Guitar Recommendation: The example used is a chat application that recommends acoustic guitars. The recommendation is initially rendered as a card, then refactored to use the MCP UI response format.
  • Iframe Rendering: The core application is rendering an iframe containing information about the recommended guitar.
  • External MCP Servers: The primary use case is rendering responses from external MCP servers, where the client application doesn't control the iframe content.

3. Step-by-Step Processes

  • Modifying the Tool (Server-Side):
    1. Use the createUIResource function (from MCP UI server) to format the tool's response.
    2. Return a UI resource object containing a unique URI and a reference to the iframe for the guitar.
    3. The URI points to a route (e.g., /iframe-guitar/:guitarId) that serves the iframe.
  • Implementing the Client (Client-Side):
    1. Install the MCP UI client library.
    2. Import isUIResource and UIResourceRenderer from the library.
    3. Check if the tool's response is a UI resource using isUIResource.
    4. If it is, use the UIResourceRenderer component to render the iframe, passing the resource as the ui property.
    5. Apply styling (e.g., using Tailwind CSS) to the rendered iframe.

4. Key Arguments and Perspectives

  • Security through Isolation: The primary argument is that using the UIResourceRenderer provides a security benefit by isolating the client application from the content of external iframes. This prevents potentially malicious code within the iframe from directly accessing the client application's resources.
  • Internal vs. External Use Case: While the video demonstrates internal usage for simplicity, it emphasizes that the UIResourceRenderer is most valuable when dealing with external MCP servers.

5. Notable Quotes

  • "It's actually super easy. This is going to be a super fast video."
  • "...at the end of the day, you really only want to use this resource renderer for external MCP servers."
  • "...that adds a lot of security because your app client and whatever that iframe is are essentially firewalled from each other."

6. Technical Terms and Concepts

  • MCP (Micro Content Protocol): A protocol for exchanging UI components between services.
  • UI Resource: A data structure containing a URI pointing to an iframe.
  • Iframe: An HTML element that embeds another HTML document within the current document.
  • URI (Uniform Resource Identifier): A string of characters that identifies a resource.
  • React Component: A reusable UI element in the React JavaScript library.
  • Tailwind CSS: A utility-first CSS framework.

7. Logical Connections

  • The video builds directly on the previous video, which covered creating the MCP UI server.
  • The server-side changes (modifying the tool to return a UI resource) are directly connected to the client-side changes (using the UIResourceRenderer to render the iframe).
  • The discussion of internal vs. external use cases provides context for understanding the primary benefit of the UIResourceRenderer (security).

8. Data, Research Findings, or Statistics

  • The video doesn't present any specific data, research findings, or statistics.

9. Section Headings

  • Key Concepts
  • Main Topics and Key Points
  • Important Examples and Real-World Applications
  • Step-by-Step Processes
  • Key Arguments and Perspectives
  • Notable Quotes
  • Technical Terms and Concepts
  • Logical Connections
  • Data, Research Findings, or Statistics
  • Synthesis/Conclusion

10. Synthesis/Conclusion

The video demonstrates how to build an MCP UI client that renders iframes returned by an MCP UI server. The key takeaway is that the UIResourceRenderer component provides a valuable security layer when rendering content from external MCP servers by isolating the client application from the iframe content. While the video uses an internal example for simplicity, the primary use case is for external services where security is a major concern. The process involves modifying the server to return UI resources and using the UIResourceRenderer component on the client-side to render the iframes.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.