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: dead-letter

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

A3.9/5.0
Behavior4/5

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

Since no annotations are provided, the description carries the full burden. It discloses that the tool checks for problems and does not render, and notes that suggestions can be intentional. However, it does not describe the output format or error behavior.

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

Conciseness4/5

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

The description is concise (two sentences) and front-loads key information. It efficiently lists specific issues, but could be slightly more structured.

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

Completeness2/5

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

Given no output schema, the description fails to explain what the tool returns (e.g., list of warnings, success/failure). It also does not fully explain how the 'partials' parameter works, leaving some gaps for the agent.

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 baseline is 3. The description adds minor value by mentioning 'emailmd markdown' and partials splicing, but does not significantly enhance parameter understanding beyond 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 the tool checks emailmd markdown for deliverability, accessibility, and readability problems, listing specific issues like missing alt text and http:// links. It distinguishes itself from siblings (render, read_docs) by focusing on linting without rendering.

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 implies using the tool before sending to fix warnings, but does not explicitly state when not to use it or provide direct comparisons to alternatives. The context of 'check without rendering' is useful.

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.4/5.0
Behavior4/5

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

No annotations, but description fully conveys it's a read-only fetch operation with no side effects. Transparent about external call. Could mention error behavior but acceptable.

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 sentences: first defines purpose, second adds usage details. No wasted words, front-loaded.

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 one optional parameter and no output schema, description covers key behaviors. Lacks mention of response format, but not critical for a documentation tool.

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

Parameters4/5

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

Schema covers parameter description (100% coverage), and description adds practical examples ('buttons', 'frontmatter', 'theme', 'directives/hero') and context for usage.

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?

Description clearly states 'Fetch emailmd documentation from emailmd.dev', specifying the verb (fetch), resource (documentation), and source. Distinct from sibling tools lint and render.

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?

Gives explicit usage: call with no arguments for index, pass page for specific page. Also advises reading relevant page before using uncertain syntax. Lacks explicit when-not-to-use but sufficient.

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.1/5.0
Behavior4/5

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

No annotations are provided, so the description must carry full behavioral disclosure. It mentions warnings (non-fatal repairs) and previewUrl, which gives insight into side effects. It does not detail auth requirements, rate limits, or error handling, but the key behavioral traits are addressed.

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

Conciseness4/5

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

The description is a single sentence that front-loads the core purpose ('Render emailmd markdown into email-safe HTML') and then enumerates return fields. It is concise but could be more structured (e.g., separate sentences for purpose and outputs).

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?

Despite no output schema or annotations, the description lists all return fields and clarifies the nature of warnings. It lacks explicit error handling or failure modes, but for a render tool with 3 parameters, it provides sufficient context for an agent to use it 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?

Schema coverage is 100%, so the baseline is 3. The description adds no additional meaning to the parameters beyond what is in the schema; it only describes return values. The parameter details (minify, markdown, partials) are already well-documented in 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 the tool renders 'emailmd' markdown into email-safe HTML, and lists the specific return fields (html, text, meta, warnings, htmlBytes, previewUrl). This verb+resource pair is distinct 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 Guidelines4/5

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

The description implies use for converting markdown to email HTML, and sibling tools provide context for when not to use it (e.g., use 'lint' for validation, 'read_docs' for docs). However, it does not explicitly state when to prefer this tool over alternatives or mention any prerequisites.

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

TDQS

A4.3/5.0
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

ActivityActive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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
    MCP server that converts .eml email exports (Gmail, Outlook, and other archives) into clean Markdown with YAML front matter — splitting reply threads, stripping signatures and quoted history, extracting attachments, and parsing calendar invites. Built for feeding archived email into RAG and LLM pipelines.
    4
    7
    PolyForm Noncommercial 1.0.0
  • 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
    131
    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
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/anypost/emailmd'

If you have feedback or need assistance with the MCP directory API, please join our Discord server