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 集成