Resend MCP Server for Transactional Email
Send transactional emails reliably with the Resend MCP server, integrate quickly, monitor delivery, and scale your email workflows.
Overview
The Resend MCP Server integrates the Resend transactional email API into the Model Context Protocol (MCP) ecosystem, providing a lightweight, programmable email tool that can be called from agents, workflows, or other MCP-aware services. It wraps common email operations—sending messages, using templates, attaching files, and checking delivery status—behind a consistent MCP tool interface so you can integrate reliable transactional email into automation and agent-driven flows.
This server is useful when you need programmatic, auditable email delivery as part of a larger AI or automation system. It centralizes configuration (API keys, templates, retries), exposes monitoring endpoints, and supports delivery events so you can track and react to bounces or opens without wiring directly to the Resend API from every service.
Features
- Send transactional emails (HTML/text) via Resend
- Use Resend templates with per-recipient template data
- Support for attachments and custom headers
- Delivery and bounce handling via webhooks/events
- Retry/backoff for transient failures
- Structured logging and basic metrics (health, uptime)
- Configurable rate limits and concurrency controls
- Docker-friendly and environment-driven configuration
Installation / Configuration
Requirements: Node.js 18+ (or the runtime specified in the repository), npm or yarn, and a Resend API key.
Clone the repository and install dependencies:
# or
Configure environment variables (example .env):
# .env
RESEND_API_KEY=rev_live_XXXXXXXXXXXXXXXXXXXX
MCP_PORT=8080
LOG_LEVEL=info
MAX_CONCURRENCY=10
RETRY_ATTEMPTS=3
RETRY_BACKOFF_MS=500
WEBHOOK_SECRET=my-webhook-secret
Key configuration variables
| Variable | Description | Default / Notes |
|---|---|---|
| RESEND_API_KEY | Your Resend API key (required) | — |
| MCP_PORT | HTTP port the MCP server listens on | 8080 |
| LOG_LEVEL | Logging level (debug, info, warn, error) | info |
| MAX_CONCURRENCY | Maximum parallel outbound sends | 10 |
| RETRY_ATTEMPTS | Number of retry attempts on transient failures | 3 |
| RETRY_BACKOFF_MS | Base backoff in milliseconds for retries | 500 |
| WEBHOOK_SECRET | Signing secret for webhook verification | optional but recommended |
Run locally:
# or
Docker (example):
# docker-compose.yml
version: '3.8'
services:
resend-mcp:
image: klavis/resend-mcp:latest
ports:
- "8080:8080"
environment:
- RESEND_API_KEY=${RESEND_API_KEY}
- MCP_PORT=8080
- LOG_LEVEL=info
Available Tools / Resources
The Resend MCP Server exposes a small set of MCP tools and HTTP endpoints. Tools are described here in a generic form—refer to the repository for exact field names.
- send_email — Send a single transactional email.
- Fields: to, from, subject, text, html, template_id, template_data, cc, bcc, attachments, headers, metadata, tags
- send_batch — Send multiple personalized messages in a single operation (batching + concurrency control)
- get_status — Query delivery status or fetch message metadata by message_id
- health — Liveness and readiness endpoints for orchestration
- webhook_receiver — Endpoint to accept Resend events (delivered, bounced, opened, clicked)
Example: send_email (MCP tool payload)
Example response:
Webhook verification: the server can validate incoming Resend webhook requests using WEBHOOK_SECRET, and will emit structured events to your MCP runtime or a configured event sink.
Use Cases
- Password reset flows: Trigger a single templated email from your authentication agent when a user requests a password reset. Include secure, expiring links in template_data.
- Receipts and invoices: Automatically attach a PDF invoice to an order confirmation email using attachments and metadata for reconciliation.
- Multi-step agent workflows: An AI agent generates a personalized onboarding sequence, calls send_email for each step, and uses delivery events to advance or retry steps if delivery fails.
- Error & alerting notifications: Dispatch timed alerts from automated monitoring workflows with structured metadata to correlate with incidents.
- Bulk personalization: Send a batch of personalized transactional messages (e.g., billing reminders) while respecting concurrency/rate limits and tracking per-recipient success/failure.
Monitoring & Best Practices
- Enable webhooks to capture bounces and deliveries; treat bounces as signals to update user contact status.
- Configure reasonable concurrency and retry_backoff values to avoid rate limiting from Resend.
- Log message_id and provider responses for audit and troubleshooting.
- Use templates for consistent formatting and smaller payloads; pass per-recipient data rather than building full HTML in the caller.
For complete API details, advanced configuration options, and repository-specific instructions, see the code and README in the GitHub repository: https://github.com/Klavis-AI/klavis/tree/main/mcp_servers/resend