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.
| Parameter | Type | Required | Description |
|---|---|---|---|
html | string | Yes | The email HTML source code |
clients | string[] | No | Filter to specific client IDs (e.g. ["gmail-web", "outlook-windows"]) |
format | string | No | "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_emailnow returns CSS-only results. Previously it returned the full audit (spam, links, a11y, images). Useaudit_emailfor the full report.
| Parameter | Type | Required | Description |
|---|---|---|---|
html | string | Yes | The email HTML source code |
format | string | No | Input 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
html | string | Yes | The email HTML source code |
format | string | No | Input format |
skip | string[] | No | Checks 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
html | string | Yes | The email HTML source code to fix |
format | string | No | Controls fix syntax |
scope | string | No | "all" (default) or "current" (requires selectedClientId) |
selectedClientId | string | No | Client 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
before | string | Yes | Original email HTML |
after | string | Yes | Modified email HTML |
format | string | No | Input 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | Domain 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
html | string | Yes | The email HTML source code |
format | string | No | Input format |
clients | string[] | No | Filter to specific client IDs |
modes | string[] | No | ["light"] (default), ["dark"], or ["light", "dark"] |
title | string | No | Name 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
html | string | Yes | The email HTML source code |
title | string | No | Display title |
format | string | No | Input format |
Returns: shareUrl, expiresAt.
Requires Dev plan ($9/mo). Dev: 7-day expiry. Pro: permanent links.