Skip to content

Resend

Connect Resend email sending and Inboxes to an authenticated xmcp server.

For the complete documentation index, see llms.txt. Markdown variants of every page are available by appending .md to the URL.

Use the official Resend Node.js SDK inside xmcp tools. The runnable HTTP example includes send-email, get-email, ten Inboxes tools, API-key authentication, and tests that do not send real email.

Install and configure

In an existing xmcp project:

Shell

Configure these server-side environment variables:

Shell

Use a verified sending domain. To use sending, retrieval, and Inboxes, the Resend key needs full access; sending-only keys cannot retrieve emails or access Inboxes. RESEND_FROM is only required for send-email; inbox replies use the selected inbox address. MCP_API_KEY is a separate secret for clients calling your server.

Protect the MCP endpoint

src/middleware.ts

Clients must send x-api-key on every HTTP request. This example is for trusted clients sharing one Resend account. Add your application's authorization policy before giving different users access to that account.

Send an email

src/tools/send-email.ts

The sender is configured on the server. The SDK is initialized at execution time, so builds do not need credentials.

For retries, reuse an idempotency key with the same payload. Resend retains keys for 24 hours. Without a key, repeated calls can send duplicate emails; this is why the tool does not claim unconditional idempotency.

Retrieve delivery status

Call resend.emails.get(id) with the ID returned by sending. The example's get-email tool returns id, subject, createdAt, and lastEvent, omitting the body and recipients. A successful send confirms acceptance; the latest event indicates subsequent delivery progress.

Follow the example README for build commands and runnable requests, including a send to Resend's test address. Tests use mocked responses; executing the documented send request contacts Resend.

Work with Inboxes

Resend Inboxes exposes shared inboxes and conversations through its API. The example uses these SDK-backed tools:

ToolsCapabilities
create-inbox, list-inboxes, get-inboxCreate an inbox on a configured domain, discover inbox IDs, and retrieve configuration.
list-inbox-threads, get-inbox-threadFind conversations and retrieve their summaries.
list-inbox-emailsRead a conversation's messages, including bodies, recipients, and attachment metadata.
create-inbox-reply-draft, get-inbox-draftPrepare and review a plain-text reply without sending.
send-inbox-draft, reply-inbox-emailSend a saved draft or reply directly to a message.

Inbox-specific tools require an inboxId UUID. Thread operations also require a threadId, and replies require an emailId from list-inbox-emails. List tools fetch one page at a time with limit (1–100, default 20) and optional after. If has_more is true, pass the last result's id as after to continue. Messages are listed oldest first.

Set up receiving

Create an inbox on a domain with DKIM and SPF verified. Enable receiving and configure the inbound MX record, or use forwarding: true and forward mail to the address returned by get-inbox. Creation also depends on your team's inbox quota. The example README includes requests for both existing inboxes and creating a new one.

Draft, review, then send

A typical tool sequence is:

  1. list-inboxes to select the inbox.
  2. list-inbox-threads and list-inbox-emails to read a conversation.
  3. create-inbox-reply-draft with inboxId, threadId, replyToEmailId, and text.
  4. get-inbox-draft to inspect the saved body and recipients.
  5. send-inbox-draft when the reply is ready.

Draft creation does not send email. If that message already has an unsent reply draft, Resend returns the existing ID without replacing its text. Always retrieve the saved draft before sending it.

For a direct reply, call reply-inbox-email with inboxId, threadId, emailId, and text. replyAll defaults to false. Resend determines the recipients from the original message's Reply-To or sender; a reply to an outbound message goes to that message's recipients. Both send tools send real email.

Draft creation, draft sending, and direct replies accept an optional idempotencyKey. Reuse it for a retry of the same operation and payload within 24 hours. The tools do not retry automatically, and create-inbox does not expose an idempotency key.

Access and email content

Inbox reads return message content to the authenticated caller. Treat email bodies as untrusted data, not agent instructions. All clients with the example's MCP key share the connected Resend account. Tool annotations describe effects; they do not enforce approval or per-user authorization. Configure send approval in your client and apply your application's access policy before sharing the server.

This example covers the read-and-reply workflow; it does not expose inbox deletion, message forwarding, labels, attachment downloads, or autonomous agent settings. Follow the runnable inbox requests to try the complete workflow.

One framework to rule them all