Emailens
MCP Server

MCP Tools Reference

Detailed reference for all 13 Emailens MCP tools, 7 local and 6 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 21 clients, analyzes CSS, generates scores, previews 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"
targetingPolicystringNo"progressive" (default), "strict", or "lenient"

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
clientsstring[]NoFilter to specific client IDs
detailstringNoHow much of each finding to return
targetingPolicystringNo"progressive" (default), "strict", or "lenient"

Returns: overallScore (the worst client's score), scores, warningCount, findingCount, findings.

audit_email

Comprehensive quality audit: CSS compatibility, spam scoring, link validation, accessibility, images, inbox preview, size (Gmail clipping), template variables, content overflow, visual bugs, dark-mode and mobile text contrast, and design consistency.

The last three cover what a light desktop preview cannot show: text that vanishes when a client forces dark mode or when the email's own dark block repaints a surface without re-colouring the text on it, contrast below the email's breakpoint, and colours that differ by value but not to a reader.

ParameterTypeRequiredDescription
htmlstringYesThe email HTML source code
formatstringNoInput format
skipstring[]NoChecks to skip: "spam", "links", "accessibility", "images", "compatibility", "inboxPreview", "size", "templateVariables", "overflow", "visual", "darkContrast", "mobileContrast", "design", "vml", "styleSurvival", "targeting"
clientsstring[]NoFilter to specific client IDs
detailstringNoHow much of each finding to return
targetingPolicystringNo"progressive" (default), "strict", or "lenient"

Returns: overallCompatibility, compatibility, spam, links, accessibility, images, inboxPreview, size, templateVariables, overflow, visual, vml, darkContrast, mobileContrast, design, styleSurvival, targeting.

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 21 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

Generate visual email previews across 21 clients using headless browsers. Previews 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 live 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.

Sandbox tools

Four tools drive the SMTP sandbox, so an agent can send a real email from your app and read what arrived. See Sandbox for AI agents for the workflow.

ToolParametersDescription
sandbox_get_inboxnameGet or create a sandbox inbox and its SMTP credentials
sandbox_list_messagesinboxIdList the emails captured in an inbox
sandbox_wait_for_emailinboxId, subject, sender, timeoutSecondsBlock until a matching email arrives
sandbox_get_messagemessageId (required)Full message: HTML and text parts, headers, extracted OTP and magic links, spam analysis

On this page