Emailens
MCP Server

MCP Tools Reference

Detailed reference for all 9 Emailens MCP tools — 7 local and 2 hosted.

Local Tools

These tools run locally via the @emailens/engine npm package. No account or API key needed.

preview_email

Full email compatibility preview — transforms HTML for 15 clients, analyzes CSS, generates scores, simulates dark mode, checks inbox preview and email size.

ParameterTypeRequiredDescription
htmlstringYesThe email HTML source code
clientsstring[]NoFilter to specific client IDs (e.g. ["gmail-web", "outlook-windows"])
formatstringNo"html" (default), "jsx", "mjml", or "maizzle"

Returns: overallScore, compatibilityScores, cssWarnings, inboxPreview, sizeReport, darkModeWarnings, plainText, clientCount.

When no API key is set and score is below 90, includes a tip field suggesting screenshots.

analyze_email

Quick CSS compatibility analysis — returns warnings and per-client scores. Faster than audit_email when you only need CSS compatibility.

Breaking change in v0.4.0: analyze_email now returns CSS-only results. Previously it returned the full audit (spam, links, a11y, images). Use audit_email for the full report.

ParameterTypeRequiredDescription
htmlstringYesThe email HTML source code
formatstringNoInput format for framework-specific fix snippets

Returns: overallScore, scores, warningCount, warnings.

audit_email

Comprehensive quality audit — CSS compatibility, spam scoring, link validation, accessibility, images, inbox preview, size (Gmail clipping), and template variables.

ParameterTypeRequiredDescription
htmlstringYesThe email HTML source code
formatstringNoInput format
skipstring[]NoChecks to skip: "spam", "links", "accessibility", "images", "compatibility", "inboxPreview", "size", "templateVariables"

Returns: overallCompatibility, compatibility, spam, links, accessibility, images, inboxPreview, size, templateVariables.

fix_email

Generate a structured fix prompt for email compatibility issues. Returns markdown with fix instructions that the AI can apply directly.

ParameterTypeRequiredDescription
htmlstringYesThe email HTML source code to fix
formatstringNoControls fix syntax
scopestringNo"all" (default) or "current" (requires selectedClientId)
selectedClientIdstringNoClient ID to scope fixes to

Returns: totalWarnings, structuralWarnings, cssWarnings, tokenEstimate, and the fix prompt as a second content block.

diff_emails

Compare two email HTML versions — shows score changes, fixed issues, and newly introduced issues per client.

ParameterTypeRequiredDescription
beforestringYesOriginal email HTML
afterstringYesModified email HTML
formatstringNoInput format

Returns: results (per-client diff with scoreBefore, scoreAfter, scoreDelta, fixed, introduced, unchanged) and summary (clientsImproved, clientsRegressed, clientsUnchanged, avgScoreDelta).

check_deliverability

Check email deliverability for a domain — SPF, DKIM, DMARC, MX, and BIMI records.

ParameterTypeRequiredDescription
domainstringYesDomain to check (e.g. "company.com")

Returns: domain, score (0-100), checks (per-record status), issues.

Uses DNS lookups — no API key needed. Requires @emailens/engine >= 0.9.1.

list_clients

List all 15 supported email clients.

No parameters.

Returns an array of { id, name, category, engine, darkModeSupport, deprecated? }.

Hosted Tools

These tools require the EMAILENS_API_KEY environment variable. Without it, they return a setup guide instead of an error.

capture_screenshots

Capture real email screenshots across 15 clients using headless browsers. Screenshots are hosted on CDN.

ParameterTypeRequiredDescription
htmlstringYesThe email HTML source code
formatstringNoInput format
clientsstring[]NoFilter to specific client IDs
modesstring[]No["light"] (default), ["dark"], or ["light", "dark"]
titlestringNoName for the hosted preview

Returns: previewId, previewUrl, overallScore, screenshots (client-mode to URL map), screenshotStatus, captured, failed.

Free plan: 30 previews/day. Dev plan: 100/day. Pro plan: unlimited.

share_preview

Create a shareable link for an email preview. Recipients see the full analysis without needing an account.

ParameterTypeRequiredDescription
htmlstringYesThe email HTML source code
titlestringNoDisplay title
formatstringNoInput format

Returns: shareUrl, expiresAt.

Requires Dev plan ($9/mo). Dev: 7-day expiry. Pro: permanent links.

On this page