
Resend Email
STDIOMCP server for sending emails via Resend API
MCP server for sending emails via Resend API
This project provides a Model Context Protocol (MCP) server designed to send emails using the Resend API. It allows AI agents like Cursor or Claude Desktop assistants to compose and send emails directly, streamlining your workflow.
This server is derived from the original resend/mcp-send-email repository and is intended for open-source distribution under the MIT License.
There are two primary ways to run this MCP server: using Docker (recommended) or running it locally with Node.js.
This method encapsulates the server and its dependencies in a container.
Build the Docker Image:
Open your terminal in the mcp_servers/resend
directory and run:
docker build -t resend-mcp-server .
Run the Docker Container:
Replace YOUR_RESEND_API_KEY
with your actual Resend API key.
docker run -d -p 5000:5000 -e RESEND_API_KEY=YOUR_RESEND_API_KEY --name resend-mcp-server resend-mcp
-d
: Runs the container in detached mode (in the background).-p 5000:5000
: Maps port 5000 on your host machine to port 5000 inside the container (the server listens on port 5000).-e RESEND_API_KEY=...
: Passes your Resend API key as an environment variable to the container.--name resend-mcp-server
: Assigns a convenient name to the container.resend-mcp
: The name of the image you built.The server is now running and accessible at http://localhost:5000
.
This method requires Node.js and npm installed on your system.
Install Dependencies:
Navigate to the mcp_servers/resend
directory in your terminal:
cd mcp_servers/resend npm install
Configure Environment Variables: Copy the example environment file:
cp .env.example .env
Edit the newly created .env
file and replace the placeholder with your actual Resend API key:
RESEND_API_KEY=YOUR_RESEND_API_KEY
Build the Server: Compile the TypeScript code to JavaScript:
npm run build
This will create a build
directory containing the compiled code (e.g., build/index.js
).
Run the Server: Start the server:
node build/index.js
The server will start, load the API key from the .env
file, and listen on port 5000. You should see a message like server running on port 5000
.
Once the server is running (either via Docker or locally), you need to configure your AI client (like Cursor) to use it.
Go to your client's MCP server settings (e.g., in Cursor: Settings -> MCP -> Add new MCP server).
Configure the server connection:
http://localhost:5000/sse
RESEND_API_KEY
environment variable (handled by Docker run -e
or the local .env
file), not typically via MCP client headers. However, consult your specific client's documentation if it offers ways to pass environment variables or if you need to modify the server (index.ts
) to accept keys via headers (though the environment variable method is generally preferred for security).Usage: You can now instruct your AI agent to use the "send-email" tool provided by this server. For example, you could provide email details (to, from, subject, body) and ask the agent to "send this email using the Resend Email Sender". The agent will interact with your running MCP server to send the email via your Resend account.
Important Tool Arguments:
from
: The verified sender email address associated with your Resend account.to
: The recipient's email address.subject
: The email subject.text
: The plain text body of the email.html
(optional): The HTML body of the email.cc
, bcc
, replyTo
, scheduledAt
(optional): Ask the user before using these.To modify or contribute to the server:
mcp_servers/resend
.npm install
index.ts
).npm run build