Skip to main content

Our email CSS engine is open source. Give it a star on GitHub 

Emailens
Open Source

Your AI writes the email.
It has never opened Outlook.

We asked six coding agents for 120 emails. Not one passed in all 21 inboxes. With these tools in the loop, the same agents shipped 94. HTML, React Email, MJML or Maizzle; 7 tools run locally with no account.

$ npx -y @emailens/mcp

01 · The test

Six agents, the same 20 briefs

Each agent got an empty folder, 20 email briefs and one prompt: production-ready HTML for real customers, read in whatever app they use. Then every file went through the engine behind these tools. Without it, none came out clean. Told to run audit_email and fix what it reports, four of the six cleaned 19 or all 20.

Clean emails, out of 20 without · with the MCP
  • Claude Opus 5.5 0 · 20
  • Composer 2.5 0 · 20
  • Kimi 3 0 · 20
  • Gemini 4 Argon 0 · 19
  • GPT 6 Luna 0 · 15
  • Grok 4.7 0 · 0

Clean: no error or warning in any of 21 clients, scored by @emailens/engine 0.16.5, the engine behind our live preview of each client.

02 · The catch

A perfect score can be a worse email

A score rewards not using what a client drops, so deleting rounded corners scores exactly like giving Outlook a fallback. Four of the six agents cleared the corner warning by deleting the radius, in every client, to fix one. Across all six, the linted emails kept 51 to 81% of the design their own first drafts had.

So audit_email remembers the first draft of each email and says what an edit took away. This is its answer when the corners go:

audit_email
{
  "designRemovals": [
    {
      "feature": "rounded",
      "label": "rounded corners",
      "before": 4,
      "after": 0,
      "message": "…"
    }
  ]
}
This revision removed all rounded corners (4 before). Clients that drop them have a fallback; removing them changes the design in every client. Restore them.

03 · The context

The email stays on disk

Whatever passes through the model costs tokens and attention, the point Cloudflare's Code Mode makes for every MCP server. Email is the worst case: each audit carried the whole email into the model's context, and sent back a report several times its size.

Now the agent passes a file path and the server reads the file beside it, and the report lists only what to fix, counting the rest. Claude, GPT and Gemini all passed a path without being told to, and each audit came back less than half the size.

Models that passed a path unprompted
3 of 3
Size of each audit reply
−46 to −60%

Code Mode, for email

Code Mode goes one step further: the agent writes code against a typed API, and only what the code prints reaches the model. The engine behind these tools is that API, on npm as @emailens/engine. An agent with a shell can check a whole folder in one script, then call audit_email only where an email fails.

check.ts
import { readdirSync, readFileSync } from "node:fs";
import { createSession, generateCompatibilityScore } from "@emailens/engine";

for (const file of readdirSync(".").filter((f) => f.endsWith(".html"))) {
  const warnings = createSession(readFileSync(file, "utf8")).analyze();
  const scores = Object.values(generateCompatibilityScore(warnings));
  const worst = Math.min(...scores.map((s) => s.score));
  const fix = new Set(warnings.filter((w) => w.severity !== "info").map((w) => w.property));
  console.log(file, worst, [...fix].join(", ") || "clean");
}
bun check.ts
01-welcome.html 97 text-decoration, padding
02-verify-email.html 97 text-decoration, word-break
03-password-reset.html 97 word-break
04-one-time-code.html 97 padding
05-receipt.html 97 padding

GPT 6 Luna's five emails: 193 characters back to the model. Its nine audit_email calls on the same files returned 176K.

7 tools, no account needed

All analysis runs locally via the open-source engine. No API calls, no signup, no rate limits.

  • preview_email

    Full preview with transforms, scores, dark mode, inbox preview, and size check across 21 clients

  • analyze_email

    Quick CSS compatibility analysis with per-client scores and warnings

  • audit_email

    Comprehensive audit: spam, links, accessibility, images, inbox preview, size, templates

  • fix_email

    Structured fix prompt with CSS and structural changes the AI can apply directly

  • diff_emails

    Compare two HTML versions: see score changes, fixed issues, and regressions per client

  • check_deliverability

    SPF, DKIM, DMARC, MX, and BIMI checks with a deliverability score

  • list_clients

    Reference list of all 21 supported email clients with engines and dark mode support

Add screenshots, sharing, and inbox testing

Set EMAILENS_API_KEY to unlock hosted features.

Inbox testing

sandbox_wait_for_email

Wait for an incoming test email matching sender/subject and extract OTPs, magic links, and auth results with zero regex.

sandbox_get_inbox

Retrieve your dedicated sandbox receiving address or generate a new isolated inbox for autonomous agent test runs.

sandbox_get_message

Inspect captured message details: HTML, plain text, headers, attachments, and spam heuristic score.

sandbox_list_messages

List the emails captured in a sandbox inbox, newest first.

Screenshots and sharing

  • capture_screenshots

    Live preview screenshots of all 21 clients, light and dark. Hosted on CDN. For the real apps, run a real-device check.

  • share_preview

    Shareable links: recipients see full analysis without an account. Dev plan required.

Generate an email

  • build_email

    Generate a cross-client email from a brief with the self-healing loop, returns a runId. Remote server only. On Dev and Pro.

  • get_build_status

    Poll a build_email run: status, iteration, best score, and the generated source once ready. Remote server only.

API keys come with the Dev plan ($9 a month). Get your API key

What you can ask

The reply is the engine's real answer for one sample email, worked out when this page was built.

  • Analyze this email HTML and tell me what breaks in Gmail and Outlook
  • analyze_email Works in 16 of 21, Gmail included (84). Outlook Classic scores 66, the lowest of 21, with 9 problems: overflow, display:flex, gap and 6 more.
  • Fix the flexbox and border-radius issues for all clients
  • Compare the original and fixed versions: did the scores improve?
  • Check if company.com has SPF and DMARC set up correctly
  • Take screenshots of this email across all clients

Add it to your assistant

bash
claude mcp add emailens -- npx -y @emailens/mcp

21 email clients

  • Gmail
  • Gmail Android
  • Gmail iOS
  • Outlook 365
  • Outlook (New)
  • Outlook Classic
  • Outlook iOS
  • Outlook Android
  • Outlook for Mac
  • Apple Mail
  • Apple Mail iOS
  • Yahoo Mail
  • Yahoo Mail Android
  • Yahoo Mail iOS
  • Samsung Mail
  • Thunderbird
  • HEY Mail
  • Proton Mail
  • AOL Mail
  • Fastmail
  • Superhuman

Outlook iOS and Android added in v0.4.0.

Let it check the email before your client opens it.

One command. No signup required.

$ claude mcp add emailens -- npx -y @emailens/mcp

No assistant at hand? Check your email, free