Skip to main content
Glama
anypost

emailmd

by anypost

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: Maket

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 emailAInspect

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
markdownYesThe emailmd markdown document, optionally starting with YAML frontmatter.
partialsNoNamed markdown partials spliced in wherever the document says "::: include <name>".

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses that the tool does not render, lists specific checks, and adds a useful caveat about false positives. It does not describe the return format (e.g., structure of warnings), but overall behavior is well conveyed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two dense sentences with no filler. Front-loaded with clear purpose, then concrete examples, then a practical caveat. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 2 parameters, 100% schema coverage, and no output schema, the description is largely complete. It explains what the tool checks, the non-rendering behavior, and the intentional-suggestion caveat. The only notable gap is the absence of explicit return value structure, but 'warnings' and 'suggestions' imply the nature of the output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for both parameters, so the baseline is 3. The description adds some context about 'emailmd markdown' and YAML frontmatter, but it does not explain the 'partials' parameter, which is covered only by the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb+resource: 'Check emailmd markdown for deliverability, accessibility, and readability problems'. It explicitly differentiates from sibling 'render' by noting it does this 'without rendering it'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context: use before sending to fix warnings, and notes that some suggestions are intentional (transactional emails). However, it does not explicitly mention alternatives like 'render' for previewing, missing an explicit when-not-to-use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_docsRead emailmd docsAInspect

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
pageNoDocs page path, e.g. 'buttons' or 'directives/hero'. Omit for the index.

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden. It discloses the optional argument behavior and gives examples, but does not mention error handling or return format. For a simple read tool, this is adequate, though not fully exhaustive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise: two sentences that front-load the core purpose and then provide usage examples and guidance. Every sentence contributes value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with one optional parameter and no output schema, the description fully covers purpose, usage, parameter semantics, and when to use it. It is complete enough for an agent to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already provides a description for the 'page' parameter (pattern, examples, and 'Omit for the index'), so the description adds little beyond that. With 100% schema coverage, the baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Fetch emailmd documentation from emailmd.dev.' It uses a specific verb ('Fetch') and resource ('emailmd documentation'), and the distinction from siblings (lint, render) is evident, as those tools likely operate on the content rather than retrieve documentation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context: 'Call with no arguments for the index of all pages; pass page to read one' and 'Read the relevant page before using syntax you are not sure about.' While it lacks explicit alternatives or when-not-to-use instructions, the guidance is sufficient for a simple documentation fetcher.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

renderRender an emailAInspect

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
minifyNoMinify the HTML. Recommended for sending; helps stay under Gmail's 102KB clip limit.
markdownYesThe emailmd markdown document, optionally starting with YAML frontmatter.
partialsNoNamed markdown partials spliced in wherever the document says "::: include <name>".

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the transparency burden. It thoroughly discloses return values, including warnings for non-fatal repairs and previewUrl for live preview, giving a strong behavioral contract. It does not explicitly state side-effect freedom, but the nature of rendering makes this less critical.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences: the first delivers the core purpose, the second compactly enumerates return values. Every word earns its place, and it is front-loaded with the most important information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Since there is no output schema, the description must explain return values, and it does so thoroughly, listing all six output fields and their meanings. Minor gaps like error handling are less critical given the schema covers parameter constraints.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all parameters. The description adds context about the markdown format (emailmd, frontmatter) but does not elaborate on parameter details beyond the schema, matching the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's specific verb and resource: 'Render emailmd markdown into email-safe HTML.' It also lists detailed outputs, distinguishing it from sibling tools lint and read_docs, which serve different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies this is the rendering step but does not explicitly state when to use it versus alternatives like lint or read_docs, nor does it mention prerequisites or exclusions. Context is clear but guidance on selection is absent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 3 tool updatesv0.9.1
    • First observedlint
    • First observedread_docs
    • First observedrender

TDQS

A4.3/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a unique and well-defined purpose: lint checks for issues, render converts to HTML, read_docs fetches documentation. There is no overlap or ambiguity between them.

Naming Consistency5/5

All tool names are single lowercase verbs (lint, render, read_docs), following a consistent and predictable pattern.

Tool Count5/5

Three tools is an ideal count for a focused utility like emailmd, providing essential functionality without unnecessary complexity.

Completeness5/5

The tools cover the complete workflow: checking (lint), converting (render), and learning (read_docs). No obvious gaps for the server's purpose.

Maintenance

ActivityMaintained
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    F
    maintenance
    Enables AI models to manage CloudMailin email data, including listing addresses, messages, and sending emails with markdown support.
    -
  • A
    license
    A
    quality
    A
    maintenance
    Local-first visual design workspace for AI assistants. Compose wireframes and branded multi-page HTML/CSS documents with live preview, annotations, brand and asset libraries, typed data collections, layout validation, PDF export, and draft-only Gmail handoff.
    14
    127 npm
    19
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Provides email validation and domain configuration auditing tools for AI assistants, enabling single address checks, bulk list cleaning, SPF verification, and full mail setup grading (A-F) with actionable fixes.
    4
    74 npm
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables Claude Desktop to interact with MailInApp projects, campaigns, and contacts. Allows designing and reading interactive email results with explicit confirmation for sending real campaigns.
    -