Skip to main content
Glama
emailmd

emailmd

emailmd

Write markdown. Ship emails. No HTMHELL.

emailmd converts markdown into responsive, email-safe HTML that works across Gmail, Outlook, Apple Mail, Yahoo, and every other client.

emailmd

Install

npm install emailmd

Related MCP server: mail-report-mcp

Quick Start

import { render } from "emailmd";

const { html, text } = await render(`
# Welcome!

Thanks for signing up.

[Get Started](https://example.com){button}
`);

// html → complete email-safe HTML
// text → plain text version for text/plain MIME part

v0.3.0 migration: render() is now async. Update calls from render(md) to await render(md). Requires Node 20+ (MJML 5).

Charts & Data

Bar charts, progress meters, sparklines, KPI tiles, step trackers, and star ratings, each written as a plain markdown list:

::: chart
- Spotify: 16,900
- Apple Podcasts: 12,400
- Web player: 6,200
- RSS: 2,900
:::

KPI tiles, a bar chart and a sparkline, rendered by emailmd from plain markdown lists

They are drawn from table cells and text glyphs rather than images or SVG, so they still render when the client blocks remote images, and they redraw themselves in the plain-text part instead of collapsing to a list of numbers. See the directives reference.

CLI

emailmd also ships with a command-line interface.

# Render to HTML
emailmd input.md

# Write to file
emailmd input.md -o output.html

# Plain text output
emailmd input.md --text

# Pipe from another command
echo "# Hello" | emailmd

Run emailmd --help for all options.

React

@emailmd/react provides a live-preview hook (useEmailmd), an <EmailPreview /> iframe component, and <EmailmdBuilder /> — the full builder as a drop-in component for your own app.

npm install @emailmd/react emailmd

Learn More

  • Docs — full syntax reference, theming, frontmatter, directives, and API

  • Templates — ready-made email templates you can copy and customize

  • Builder — live editor to write and preview emails in your browser

MCP

emailmd ships a Model Context Protocol server, so an AI assistant can render, lint, and preview emails for you. It exposes three tools — render (markdown to email-safe HTML), lint (flag deliverability problems without rendering), and read_docs (look up emailmd syntax) — over either transport:

# Hosted (Streamable HTTP)
https://www.emailmd.dev/api/mcp

# Or run it locally over stdio
npx emailmd mcp

Published to the official MCP registry as dev.emailmd/emailmd. See the MCP docs for per-client setup.

AI

Prefer plain context over tools? emailmd is just markdown, so AI is great at writing templates. Feed the full docs to your AI tool:

https://www.emailmd.dev/llms-full.txt

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

emailmd is under active development. The API may change between minor versions until we hit 1.0 — breaking changes are always called out in the changelog. See Stability & Versioning for what the semver contract covers.

Acknowledgements

License

MIT

Available Tools

3 tools
lintLint an emailA
Read-onlyIdempotent
Inspect

Check emailmd markdown for deliverability, accessibility, and readability problems without rendering it: missing alt text, http:// links, Gmail's 102KB clip limit, generic link text, spam-trigger phrases, and more. Fix warnings before sending; suggestions are sometimes intentional (e.g. transactional emails without an unsubscribe link).

Inputs: markdown (required), partials.

read_docsRead emailmd docsA
Read-onlyIdempotent
Inspect

Fetch emailmd documentation from emailmd.dev. Call with no arguments for the index of all pages; pass page to read one (e.g. 'buttons', 'frontmatter', 'theme', 'directives/hero'). Read the relevant page before using syntax you are not sure about.

Inputs: page.

renderRender an emailA
Read-onlyIdempotent
Inspect

Render emailmd markdown into email-safe HTML. Returns html (the complete email document), text (the plain-text MIME part), meta (frontmatter), warnings (non-fatal repairs made while rendering; aim for none), htmlBytes, and previewUrl (a live browser preview of this exact document to share with the user).

Inputs: markdown (required), minify, partials.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 3 tools

    Disambiguation5/5

    render (produce HTML/text output), lint (static analysis of deliverability/accessibility), and read_docs (fetch documentation) each target a completely distinct action with no overlap. An agent can trivially decide which to call based on intent.

    Naming Consistency4/5

    All names are lowercase and verb-based, but 'render' and 'lint' are bare verbs while 'read_docs' uses verb_noun. The deviation is minor and still readable/unpredictable in a harmless way.

    Tool Count4/5

    Three tools is at the low end of the ideal range but each earns its place: rendering, linting, and documentation lookup are the essential operations for this domain. No filler or redundant tools.

    Completeness4/5

    The render-lint-docs trio covers the full compile-and-validate lifecycle for email markdown, with meta/warnings/previewUrl as useful outputs. Minor gaps exist (no explicit theme/schema listing or auto-fix tool) but these are workable via read_docs.

    Maintenance

    ActivityMaintained
    ResponsivenessUsually handled

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to send emails, perform IP lookups, and convert files to Markdown.
      6
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables generating email-safe HTML reports from Markdown with inline styles, embedded screenshots, and severity pills, then sending them over SMTP with delivery tracking and retries.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to check email HTML for delivery-breaking problems before sending, returning structured diagnostics with rule id, severity, line and column, along with a tool that lists every available rule. It runs with no filesystem, network or environment access, so agents can validate markup without gaining new permissions.
      34 npm
      5
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to read, search, send, schedule, and organize email across multiple IMAP/SMTP accounts, including drafts, provider-aware labels, real-time inbox watching, verification-code capture, and analytics. Supports OAuth2, calendar extraction, and both local stdio and networked Streamable HTTP access.
      31 npm
      ISC