MD2UI - Markdown to Images & Code & Emails avatar
MD2UI - Markdown to Images & Code & Emails

Pricing

Pay per event + usage

Go to Apify Store
MD2UI - Markdown to Images & Code & Emails

MD2UI - Markdown to Images & Code & Emails

Turn Markdown into shareable images and email-ready HTML — directly from Claude. Render tables, code blocks, and Mermaid diagrams as PNG, or Gmail-compatible HTML. 9 themes included. No design tools needed.

Pricing

Pay per event + usage

Rating

0.0

(0)

Developer

Treplit

Treplit

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

14 days ago

Last modified

Share

MD2UI - Markdown to Visual Output MCP Server

Give your AI agents the power to create beautiful visuals, not just text.

Transform Markdown into shareable images, styled HTML, and email-ready output. Perfect for AI agents that need to generate charts, diagrams, code snippets, and visual reports.

Try the Web Editor | Browse Themes | View on Apify

MD2UI Editor - Transform Markdown to Visual Output


The Problem

AI agents are incredible at generating text. But when it comes to creating visual output, they hit a wall:

  • Claude can write a perfect Mermaid flowchart... but can't render it as an image
  • Your LangGraph agent generates a beautiful report... as raw Markdown nobody wants to read
  • You need to share analysis results on Slack/WhatsApp... but plain text looks unprofessional
  • Sending base64 images back to the LLM eats thousands of tokens

MD2UI solves this. It's an MCP server that takes any Markdown and returns a beautiful, shareable image URL in milliseconds.

Mermaid Diagram Support

Full Mermaid 11.x support with server-side rendering:

```mermaid
flowchart LR
A[User Query] --> B{AI Agent}
B --> C[Generate Markdown]
C --> D[MD2UI]
D --> E[Beautiful Image]
E --> F[Share Anywhere]
```

Supported diagrams: flowchart, sequence, pie, sankey, timeline, quadrant, class, state, ER, gantt, mindmap, and more.

Chart Gallery - Line charts, pie charts, sankey diagrams, and more


Features

  • Multiple Output Formats - HTML, PNG, JPEG, WebP, Email HTML
  • Email Rendering - Generate email-client compatible HTML (Gmail, Outlook, Apple Mail)
  • 9 Professional Themes - Match your brand or use familiar styles
  • Mermaid Diagrams - All diagram types rendered server-side
  • Syntax Highlighting - Beautiful code blocks in any language
  • URL Response - Get shareable links instead of base64 blobs
  • Smart Caching - Mermaid diagrams and SVG conversions cached for performance
  • Fast Cold Start - Standby mode keeps the server warm (~150-700ms)
  • MCP Native - Works with any MCP-compatible client

Themes

Choose from 9 built-in themes or create custom ones:

ThemeStyleBest For
defaultClean blue, professionalGeneral purpose
darkDark modeDeveloper content, night mode
notionNotion-inspiredDocumentation, notes
anthropicClaude-style warm tonesAI assistant outputs
googleMaterial Design colorsReports, presentations
perplexityModern turquoiseSearch results, summaries
whatsappChat-bubble greenMessaging, notifications
minimalContent-focused, serifLong-form reading
corporateBusiness blueEnterprise documents

Theme Gallery - 9 professional built-in themes


Quick Start

MCP Endpoint

https://treplit--md2ui-mcp.apify.actor/mcp?token=YOUR_APIFY_TOKEN

Get your token at console.apify.com/settings/integrations.

Claude Code

Add to ~/.claude/settings.json:

{
"mcpServers": {
"md2ui": {
"url": "https://treplit--md2ui-mcp.apify.actor/mcp?token=YOUR_APIFY_TOKEN"
}
}
}

MCP Tools

ToolDescription
renderTransform Markdown to HTML, PNG, JPEG, WebP images
render_emailGenerate email-compatible HTML for Gmail, Outlook, Apple Mail
theme_listList all 9 available themes
theme_getGet full configuration of a theme
theme_createCreate a custom theme
generate_componentAI-powered: describe what you want, get Markdown/Mermaid code
healthCheck server status

render Parameters

ParameterTypeRequiredDescription
markdownstringYesMarkdown content to render (max 100KB)
output_formatenumYeshtml, png, jpeg, webp
theme_idstringNoTheme ID (default: default)
options.widthnumberNoWidth in pixels (default: 800)
options.scalenumberNoDPI multiplier 1-3 (default: 2)
options.qualitynumberNo0-100 for JPEG/WebP (default: 90)
options.transparentBackgroundbooleanNoTransparent PNG background

Response Format

{
"success": true,
"image": "data:image/png;base64,..."
}

render_email Parameters

ParameterTypeRequiredDescription
markdownstringYesMarkdown content to render for email
theme_idstringNoTheme ID (default: default)
image_hostingenumNohosted (URL) or base64 (embedded)

Email Features:

  • React Email components for universal email client support
  • Automatic font fallbacks (Inter → Helvetica, Fira Code → Courier)
  • Mermaid diagrams rendered as hosted PNG images
  • Cached diagram rendering for improved performance

Response Format (Email)

{
"success": true,
"html": "<!DOCTYPE html>...",
"uploadedImages": [
{ "id": "mermaid-0.png", "url": "https://..." }
]
}

Integration Examples

n8n Workflow

Use MD2UI in n8n workflows with LangChain or LangGraph agents:

// Initialize MCP Session
const response = await $http.request({
method: 'POST',
url: 'https://treplit--md2ui-mcp.apify.actor/mcp?token=' + $env.APIFY_TOKEN,
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json, text/event-stream'
},
body: {
jsonrpc: '2.0',
id: 1,
method: 'initialize',
params: {
protocolVersion: '2024-11-05',
capabilities: {},
clientInfo: { name: 'n8n-workflow', version: '1.0' }
}
}
});
const sessionId = response.headers['mcp-session-id'];
// Render Markdown to Image
const renderResponse = await $http.request({
method: 'POST',
url: 'https://treplit--md2ui-mcp.apify.actor/mcp?token=' + $env.APIFY_TOKEN,
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json, text/event-stream',
'mcp-session-id': sessionId
},
body: {
jsonrpc: '2.0',
id: 2,
method: 'tools/call',
params: {
name: 'render',
arguments: {
markdown: $input.first().json.content,
output_format: 'png',
theme_id: 'anthropic'
}
}
}
});

LangGraph Agent

from langchain_mcp_adapters.client import MultiServerMCPClient
async with MultiServerMCPClient({
"md2ui": {
"url": "https://treplit--md2ui-mcp.apify.actor/mcp?token=YOUR_TOKEN",
"transport": "streamable_http"
}
}) as client:
tools = client.get_tools()
# Use tools in your LangGraph agent

Why MD2UI?

Without MD2UIWith MD2UI
AI generates Markdown nobody readsAI creates shareable visuals
Mermaid code sits unrenderedBeautiful diagrams in seconds
Base64 images waste tokensURL response saves 99% tokens
Plain text notificationsProfessional formatted alerts
Manual diagram renderingAutomated visual pipeline

Performance

ScenarioLatency
Cold start (Standby wake)~150-700ms
Warm HTML render~50-100ms
Warm image render~200-400ms
Warm email render~250-450ms

The server uses a persistent Puppeteer browser instance in Standby mode. After the first render, subsequent requests reuse the warm browser—no cold start penalty per request.

Batch rendering: Use render_batch to render up to 10 documents in a single request, sharing the same browser session for optimal throughput.


URL Persistence

Image URLs are stored in Apify's key-value store:

Storage TypeRetention
Default (unnamed)7 days
Named storesIndefinitely

For most use cases, 7 days is plenty. URLs work immediately for Slack, email, or any sharing. If you need permanent URLs, download the image and host it yourself.

Tip: The response includes expires_in (seconds) so your agent knows the URL lifetime.


Self-Hosting

MD2UI is optimized for Apify but can run elsewhere:

Docker image available: Built on apify/actor-node-puppeteer-chrome with Chromium pre-installed.

# Clone and build
docker build -t md2ui .
docker run -p 8080:8080 md2ui

Limitations when self-hosting:

  • No Actor.charge() billing (pricing features disabled)
  • No automatic key-value store URLs (returns base64 only)
  • You handle scaling, uptime, and browser management

Recommended: Use Apify for production. The Standby mode, managed scaling, and pay-per-use pricing make it simpler than self-hosting Puppeteer.



Built by Treplit for AI agents that need to show, not just tell.