Overview
| Type | Best For | Features |
|---|---|---|
| HTML | Simple widgets, server-rendered | Lightweight, no dependencies |
| React | Complex UIs, component reuse | Full React features, TypeScript |
| MDX | Documentation, mixed content | Markdown + JSX, content-focused |
Auto-Detection
The renderer automatically determines your template type:Quick Comparison
Template Context
All templates receive the same context object:Accessing Context
Choosing a Template Type
Use HTML when...
Use HTML when...
- You need maximum performance
- Your widget is simple (no complex state)
- You want zero additional dependencies
- You’re comfortable with string templating
- You need HTMX for server-driven updates
Use React when...
Use React when...
- Your widget has complex interactivity
- You want TypeScript type safety
- You need client-side state management
- You’re reusing existing React components
- You want component composition
Use MDX when...
Use MDX when...
- Your content is primarily text/documentation
- You want Markdown formatting
- You’re mixing prose with interactive components
- You want easy content editing
- Your team prefers Markdown
Rendering Process
- Detection: FrontMCP analyzes your template to determine type
- Rendering: The appropriate renderer processes your template
- Output: All templates produce HTML strings
- Delivery: HTML is sent to the platform (OpenAI, Claude, etc.)
Server-Side vs Client-Side
By default, all templates render server-side (SSR):- HTML: String concatenation on server
- React:
react-dom/serverrenderToString - MDX: Compiled and rendered on server

