AI Integration (MCP + CLI)
This playbook is published as an MCP server + terminal CLI so AI clients and dev workflows can pull rules and components into whatever they’re building. The model (or you) calls structured tools, you stay out of copy-paste hell, and the same rules ship to every surface.
Install in your client
Section titled “Install in your client”Pick your client and paste. The config uses npx so there’s no global install step — email-playbook-mcp@latest is pulled on first launch and cached.
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{ "mcpServers": { "email-playbook": { "command": "npx", "args": ["-y", "email-playbook-mcp@latest"] } }}Restart Claude Desktop. The four tools appear in the model’s tool list automatically.
Edit ~/.cursor/mcp.json:
{ "mcpServers": { "email-playbook": { "command": "npx", "args": ["-y", "email-playbook-mcp@latest"] } }}Restart Cursor. Tools show up under the MCP panel.
Same shape, different file. Wherever the client stores MCP server config, add:
{ "mcpServers": { "email-playbook": { "command": "npx", "args": ["-y", "email-playbook-mcp@latest"] } }}codex mcp add email-playbook -- npx -y email-playbook-mcp@latestPoint any HTTP client at https://docs.osamahassouna.com/api/mcp for JSON-RPC 2.0. Useful for scripts, remote agents, or browser-based clients.
curl -X POST https://docs.osamahassouna.com/api/mcp \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'What it gives the model
Section titled “What it gives the model”Four tools. All read-only, all deterministic, all serving the same content you read on this site.
| Tool | What it returns |
|---|---|
list_categories | The four rule categories (structure, compatibility, production, ai-generation) with page counts. |
get_playbook_rules | Full rule pages for a category — title, description, body, all code examples. |
list_components | All six components (buttons, spacing, images, inline-icon, background-images, text) with metadata: subcategory, VML flag, responsive flag. |
get_component | Full record for one component — title, description, narrative, HTML pattern, slots, examples. |
The model uses these to discover and quote the exact playbook patterns instead of hallucinating its own table layout from training data. Components live in their own dimension — use list_components / get_component, not get_playbook_rules.
The same package ships a terminal command for direct use:
email-playbook --help
email-playbook list-categoriesemail-playbook get-rules structureemail-playbook list-componentsemail-playbook get-component buttonsOutput is pretty-printed JSON to stdout, so it pipes cleanly:
email-playbook get-component buttons | jq '.slots'email-playbook list-components | jq -r '.[] | select(.requires_vml) | .name'Exit codes are scripting-friendly: 0 success, 1 runtime error, 2 usage error.
Hosted endpoint
Section titled “Hosted endpoint”Skip the install. Send JSON-RPC 2.0 requests to https://docs.osamahassouna.com/api/mcp.
Discover
Section titled “Discover”curl https://docs.osamahassouna.com/api/mcpReturns server info and supported methods.
List tools
Section titled “List tools”curl -X POST https://docs.osamahassouna.com/api/mcp \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Call a tool
Section titled “Call a tool”curl -X POST https://docs.osamahassouna.com/api/mcp \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "get_component", "arguments": { "name": "buttons" } } }'Returns the bulletproof button pattern, its slots, and metadata.
Example flow inside an AI client
Section titled “Example flow inside an AI client”Once installed, ask the model something like:
“Build me a transactional welcome email with a CTA button. Use the email playbook tools to follow the patterns exactly.”
The model will typically:
- Call
list_categoriesto orient itself. - Call
get_playbook_rulesforstructureandcompatibilityto get the boilerplate + responsive pattern. - Call
list_componentsandget_componentfor the components it needs (button, spacer). - Assemble the email using the exact HTML patterns from the playbook.
The output renders correctly in Outlook + Gmail + Apple Mail because it never deviated from the playbook’s table layout, VML, and inline-style conventions.
Source
Section titled “Source”- npm package:
email-playbook-mcp - GitHub:
OsamaHassouna/docs-hub—mcp/directory - License: MIT