How harikrishna8121999/email-design-mcp works
email-design-mcp is an MCP server that prepares branded email-generation instructions for the host AI, then supports compilation, refinement, validation, export, and preview. Users enter through MCP tools, resources, or guided prompts; generated MJML is compiled to HTML and stored for later use. The graph includes the documented template and guided-workflow capabilities. Some tool implementations and preview-server details were only sampled partially, so unsupported internal calls are omitted.
Main entry points: index.ts MCP Server · generate-email.ts Email Generation · storage.ts JSON Storage · refine-email.ts Email Refinement
Components 24
MCP Interface
- MCP Server
src/index.ts - Guided Prompts
src/prompts/mcp-prompts - MCP Resources
src/resources
Design Workflows
- Brand Setup
src/tools/setup-brand.ts - Brand Extractor
src/lib/brand-extractor.ts - Email Generation
src/tools/generate-email.ts - Screenshot Recreation
src/tools/screenshot-to-email.ts - Email Refinement
src/tools/refine-email.ts - Brand Context
src/prompts/system/brand-injector.ts - Design Prompt Stack
src/prompts/system - Design Rules
src/prompts/design-rules/index.ts - Layout Variants
src/prompts/layouts - Image Library
src/prompts/system/image-library.ts
Email Processing
- MJML Compiler
src/lib/mjml-compiler.ts - Compile Tool
src/tools/compile-mjml.ts - Email Validation
src/lib/email-validator.ts - Validation Tool
src/tools/validate-email.ts - Email Export
src/tools/export-email.ts - Section Labeling
src/lib/section-labeler.ts
Storage and Preview
- JSON Storage
src/lib/storage.ts - History Housekeeping
src/lib/storage-housekeeping.ts - Live Preview
src/preview/server.ts
Other components
- Assistant User
- Host AI Model
Connections 34
- Assistant User → MCP Server: uses tools
README.md - MCP Server → Brand Setup: registers tool
src/index.ts - MCP Server → Email Generation: registers tool
src/index.ts - MCP Server → Screenshot Recreation: registers tool
src/index.ts - MCP Server → Email Refinement: registers tool
src/index.ts - MCP Server → Compile Tool: registers tool
src/index.ts - MCP Server → Validation Tool: registers tool
src/index.ts - MCP Server → Email Export: registers tool
src/index.ts - MCP Server → Guided Prompts: registers prompts
src/index.ts - MCP Server → MCP Resources: registers resources
src/index.ts - Brand Setup → Brand Extractor: extracts branding
src/tools/setup-brand.ts - Brand Setup → JSON Storage: saves profile
src/tools/setup-brand.ts - Email Generation → JSON Storage: loads brand, saves email
src/tools/generate-email.ts - Email Generation → Brand Context: builds context
src/tools/generate-email.ts - Email Generation → Layout Variants: selects variant
src/tools/generate-email.ts - Email Generation → Design Rules: adds rules
src/tools/generate-email.ts - Email Generation → Design Prompt Stack: uses prompt guidance
src/tools/generate-email.ts - Email Generation → Image Library: adds image choices
src/tools/generate-email.ts - Email Generation → Host AI Model: returns instructions
README.md - Host AI Model → Compile Tool: submits MJML
README.md - Compile Tool → MJML Compiler: compiles MJML
src/tools/compile-mjml.ts - Screenshot Recreation → JSON Storage: loads brand, saves email
src/tools/screenshot-to-email.ts - Screenshot Recreation → Image Library: builds image prompt
src/tools/screenshot-to-email.ts - Screenshot Recreation → Host AI Model: returns instructions
README.md - Email Refinement → JSON Storage: loads and saves email
src/tools/refine-email.ts - Email Refinement → Section Labeling: labels sections
src/tools/refine-email.ts - Email Refinement → Brand Context: builds context
src/tools/refine-email.ts - Email Refinement → Host AI Model: returns instructions
README.md - Validation Tool → Email Validation: checks email
src/tools/validate-email.ts - Email Export → JSON Storage: loads email
src/tools/export-email.ts - MCP Resources → JSON Storage: reads stored data
src/resources/brand.ts - MCP Server → Live Preview: starts server
src/index.ts - MCP Server → History Housekeeping: starts cleanup
src/index.ts - Live Preview → JSON Storage: loads email
src/preview/server.ts