HTML Email Playbook

io.github.OsamaHassouna由 GitHub 帳號 OsamaHassouna 發布v0.8.0更新於 Nov 7, 2026

Teaches AI to write HTML email that renders in Outlook, Gmail, and Apple Mail. 21 rules, 6 comps.

發布方自己的服務:Playbook

已驗證Streamable HTTP可網頁執行開發者工具媒體與設計

概覽

AI 產生的概覽

唯讀知識型伺服器,為助理提供能在 Outlook、Gmail 與 Apple Mail 正常顯示的 HTML 電子郵件規則與程式碼樣式。

可以做什麼
  • 瀏覽規則分類與其頁面,含頁面數量與 slug
  • 以精簡清單或含 HTML/CSS 程式碼的完整形式取得規則頁
  • 依完整 slug、短名稱或頁面連結查詢單一規則頁
  • 列出按鈕、間距、圖片、圖示等可重複使用元件
  • 取得單一元件的 HTML 樣式、插槽與 VML/響應式標記
適用情境
適合助理撰寫或修改 HTML 電子郵件時使用,讓它依循經過驗證的樣式而非憑訓練資料猜測,例如製作歡迎信或把設計圖轉成郵件 HTML。它只提供規則與程式碼,不寄送、不預覽也不驗證郵件。
執行需求
可作為本機 npm 套件透過 npx 或全域安裝執行,也可使用託管端點。不需帳號、API 金鑰或身分驗證。選用環境變數 EMAIL_PLAYBOOK_NO_STALE_NOTICE 與 EMAIL_PLAYBOOK_STALE_DAYS 可控制內容過期提示。
安裝前請注意
為唯讀服務,文件稱其不存取收件匣、不需郵件憑證,也不會自行發出網路請求。本機安裝的副本可能落後於託管內容,README 建議安裝最新版本而不要固定版本。產生的 HTML 不會由此伺服器驗證或預覽。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 HTML Email Playbook,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.OsamaHassouna%2Femail-playbook-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "html-email-playbook": {
      "type": "http",
      "url": "https://docs.osamahassouna.com/api/mcp"
    }
  }
}

README

email-playbook-mcp

[npm] [license] [MCP]

[wellknown status]

Stop AI models from generating broken HTML email. This MCP server + CLI feeds them the patterns that actually render in Outlook 2007+, Gmail, and Apple Mail — drawn from the HTML Email Playbook.

Without it, your model invents flex and grid (no email client supports those), hardcodes table widths that overflow on mobile, forgets the VML fallback for Outlook buttons, and makes up footer disclaimers that weren't in your design.

With it, the model calls structured tools to pull the exact patterns from the playbook and composes emails using those, instead of guessing from training data.

🔒 No email permissions, no inbox access. This is a knowledge MCP — it returns playbook rules and HTML patterns. It never reads your mail, sends mail, or asks for Gmail/Outlook/SMTP credentials. Confusable with inbox-integration MCPs but it's a different category entirely.

Install

bash
# Global install (standard)npm install -g email-playbook-mcp
# Or run on demand without installingnpx -y email-playbook-mcp@latest

Safe to install

  • One dependency — the official MCP SDK (@modelcontextprotocol/sdk), nothing else.
  • No postinstall scripts — installing runs no arbitrary code.
  • Read-only, no inbox — the tools only return playbook content. It never reads, sends, or touches email, never opens your inbox, and makes no network calls of its own.

Keeping it current

The playbook grows with new pages and fixes, so install email-playbook-mcp@latest and never pin a version in your client config. The hosted endpoint is always current.

A local copy can still fall behind (a pinned version, a cached global install). When the bundled rules are more than 90 days old, the local server says so, without any network call:

  • MCP server: one short update note in the server instructions and on the first tool result of a session, addressed to the AI client, so it can tell you how to update.
  • CLI: one line on stderr; stdout stays clean JSON.
VariableEffect
EMAIL_PLAYBOOK_NO_STALE_NOTICE=1Turns the note off.
EMAIL_PLAYBOOK_STALE_DAYS=180Changes the age that triggers it (default 90).

Use it in Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

json
{  "mcpServers": {    "email-playbook": {      "command": "email-playbook-mcp"    }  }}

Restart Claude Desktop. The playbook tools appear in the model's tool list. Ask it to build an email and it'll call them automatically.

What happens under the hood

For an image-to-email or "build me a welcome email" prompt, the model typically calls:

1. list_categories                                    ← orient, page slugs2. get_playbook_rules({ format: "checklist" })        ← every page's rules, ~16 KB3. get_rule({ slug: "compatibility/responsive" })     ← just the pages it needs4. list_components → get_component({ name: "buttons" }) ← components it needs5. compose final HTML using those exact patterns

You don't write that prompt by hand — the model orients itself via the tool descriptions.

Use it in Cursor

Edit ~/.cursor/mcp.json:

json
{  "mcpServers": {    "email-playbook": {      "command": "email-playbook-mcp"    }  }}

Cline / Continue / Windsurf and other MCP-aware clients use the same shape — point a command entry at email-playbook-mcp.

Use it as a CLI

The same package ships a second binary for direct query + scripting:

bash
$ email-playbook get-component buttons | jq '{name, slots, requires_vml}'{  "name": "buttons",  "slots": ["text", "url", "background_color", "text_color", "width_px", "height_px"],  "requires_vml": true}

Other commands: list-categories, list-components, get-rules [category] [--checklist], get-rule <slug> [--examples]; add --md to get-rules / get-rule for readable markdown instead of JSON. The MCP tool names work as command names too (get_playbook_rules, get_rule, ...). Help text is generated from the bundled spec at runtime, never stale. Run email-playbook --help.

Run without installing globally:

bash
npx -y -p email-playbook-mcp email-playbook list-categories

Tools

ToolReturns
list_categoriesThe 4 rule categories with page counts and page slugs
get_playbook_rules({ category?, format? })Rule pages: full (text + code, default, one category) or checklist (the rules to follow; leave out category for every page, about 16 KB)
get_rule({ slug, include_examples? })One rule page with its code (compatibility/responsive or responsive); include_examples: true adds the code as a separate array
list_componentsAll 6 components with metadata
get_component({ name })One component: HTML pattern, slots, VML/responsive flags

Components live in a separate dimension — use list_components / get_component, not get_playbook_rules.

What's in the playbook

SurfaceCountCovers
structure (rules)5Doctype, head, body container, header, body, footer
compatibility (rules)3Outlook MSO, RTL languages, responsive
production (rules)6Gmail 102KB clip, dark mode, force light, email signatures, preheader, bulletproof buttons
ai-generation (rules)7Absolute rules, asset policy, content fidelity, image placeholders, link tokens, output format, handoff checklist
Components6Buttons, spacing, images, inline icons, background images, text

The ai-generation category is the one to fetch first for image-to-email tasks. It encodes rules that override training-data instincts — use {{cta_url}} not https://example.com, reproduce only what's in the source, use placehold.co PNG blocks for every image you weren't given a real URL for, return HTML only.

What it doesn't do

  • Doesn't send email — generate the HTML here, send it through your existing platform.
  • Doesn't render previews — the Playground does (with a "From Image" tab if you have a screenshot).
  • Doesn't validate existing HTML — manual pass via the Handoff Checklist.

Hosted alternative

No install? Point any JSON-RPC 2.0 client at https://docs.osamahassouna.com/api/mcp. Same tools, same content, no auth.

bash
curl -X POST https://docs.osamahassouna.com/api/mcp \  -H "Content-Type: application/json" \  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

License

MIT © Osama Hassouna

來源:mcp/README.md,提交 69f27ac

工具

5

list_categories

List all rule categories in the Email Playbook with a one-line description, page count, and the slug and title of each page in it. Categories are: structure (head/body container/header/body/footer), compatibility (Outlook MSO, RTL, responsive), production (Gmail clipping, dark mode, preheader, bulletproof buttons), ai-generation (constraints for AI emitters). Pass a page slug to get_rule to fetch just that page. For reusable components, use list_components instead — they live in a separate dimension and are not returned by get_playbook_rules.

無需輸入參數。

get_playbook_rules

Return rule pages. format "checklist": each page as its slug, title, description and a short list of the rules to follow, without the body or code; leave out category to get every page in one call (about 16 KB). format "full" (default, needs a category): each page with title, description, checklist, markdown body and all HTML/CSS code examples. Start with the checklists, then fetch the pages you need with get_rule. Components are not included: use list_components / get_component.

輸入參數formatcategory

get_rule

Return one rule page: slug, category, title, description, checklist, and the markdown body, which includes the page's HTML/CSS code. Accepts the full slug (e.g. "compatibility/responsive"), just the page name ("responsive"), or a page link from a body ("/email-playbook/compatibility/responsive/"). Get the slugs from list_categories. Much smaller than fetching the whole category with get_playbook_rules.

輸入參數slug必填include_examples

list_components

List all reusable email components in the playbook with their metadata: name, subcategory (layout/media/interactive/text), description, whether they require Outlook VML, and whether they are responsive. Use this first to discover what components exist before calling get_component.

無需輸入參數。

get_component

Return the full record for a single component: title, description, narrative body, the primary HTML pattern, list of slots (placeholders the model should fill), VML/responsive flags, and all code examples. Use after list_components to fetch the actual HTML pattern to paste into an email.

輸入參數name必填

版本歷史

3
  1. v0.8.0最新Oct 31, 2026
  2. v0.7.0Oct 17, 2026
  3. v0.6.3Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Playbook 整合