Mailprompt.ai
AI Email Marketing for Online Stores
AI-assisted email marketing for online stores: describe a flow in chat, a human approves, and Amazon SES sends—billed by emails sent rather than contacts.
stack: TypeScript · pnpm Monorepo · Amazon SES · MCP (36 tools) · OAuth 2.1 + PKCE · RFC 9728 · Dry-Run Guardrails · Shopify App
01 / Problem
The problem
Traditional ecommerce email platforms charge by contact count and lock automation behind rigid builders, while naive AI integrations risk sending unapproved campaigns or leaking static API keys.
Both the in-app chat assistant and external MCP hosts need identical tool behavior, scoped authorization, and mandatory human sign-off before any message leaves Amazon SES.
02 / Architecture
The build
- 24-package TypeScript monorepo separating API, worker, billing, sending, rendering, templates, DNS, webhooks, integrations, OAuth, MCP, and SDK.
- Single 36-tool registry powering both the in-app chat interface and a remote MCP server, with credit-spending tools defaulting to dry-run and requiring explicit confirmation.
- In-house OAuth 2.1 server implementing PKCE, dynamic client registration, 5-minute codes, 1-hour access tokens, 30-day refresh tokens with refresh-family revocation on replay, and RFC 9728 metadata.
- Amazon SES delivery billed by emails sent rather than contacts, a free store grader, and a Shopify app with theme and web-pixel extensions (in development).
03 / Diagram
System schematic
04 / Scope
Status & scale
MCP tool registry
36 tools
Monorepo
24 packages
Core build sprint
4 days (Nov 11–14, 2026)
Shopify app
In development
05 / Stack
Components
- TypeScript
- pnpm Monorepo
- Amazon SES
- MCP (36 tools)
- OAuth 2.1 + PKCE
- RFC 9728
- Dry-Run Guardrails
- Shopify App
06 / Writing
Related writing
- Shipping a rank tracker API, SDK and MCP server alongside a SaaS productBuilding a rank tracker API: contract, REST API, generated SDK, then MCP. One OpenAPI 3.1 spec feeds types, docs, webhooks and the tools an assistant calls.
- MCP OAuth from scratch: building a remote MCP server with OAuth 2.1How a production MCP OAuth setup works: PKCE, dynamic client registration, five-minute codes, refresh-family revocation and audience binding.
- MCP Streamable HTTP without sessions: running it stateless in productionWhy a hosted MCP Streamable HTTP server should treat every POST as a fresh request: no session map, JSON responses, GET 405 and no sticky sessions.
- Small internal MCP servers that pay for themselvesTwo internal MCP servers — image generation and receipt reconciliation — and the design rules that make a small tool worth wrapping for an agent.
- Designing MCP tools that models call correctlyNaming, argument shapes, dry-run defaults, confirmation gates and error text written for a model that reads prose, retries and never saw yesterday's call.
- One tool registry behind chat and MCP: 36 tools, one set of guardrailsHow 36 tools are defined once and served to both an in-app assistant and external MCP clients, with the same scopes, credit holds, dry runs and approvals.