RE

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:

git clone https://github.com/Klavis-AI/klavis.git
cd klavis/mcp_servers/resend
npm install
# or
yarn install

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

VariableDescriptionDefault / Notes
RESEND_API_KEYYour Resend API key (required)
MCP_PORTHTTP port the MCP server listens on8080
LOG_LEVELLogging level (debug, info, warn, error)info
MAX_CONCURRENCYMaximum parallel outbound sends10
RETRY_ATTEMPTSNumber of retry attempts on transient failures3
RETRY_BACKOFF_MSBase backoff in milliseconds for retries500
WEBHOOK_SECRETSigning secret for webhook verificationoptional but recommended

Run locally:

npm run start
# or
node dist/index.js

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)

{
  "tool": "send_email",
  "args": {
    "to": ["[email protected]"],
    "from": "[email protected]",
    "subject": "Reset your password",
    "html": "<p>Hi {{name}}, click <a href='{{reset_link}}'>here</a> to reset.</p>",
    "template_id": null,
    "template_data": { "name": "Alice", "reset_link": "https://..." },
    "metadata": { "account_id": "acct_123" }
  }
}

Example response:

{
  "message_id": "msg_abc123",
  "status": "queued",
  "provider": "resend",
  "sent_at": "2026-04-10T12:34:56Z"
}

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