Move from Resend without changing your code

You can migrate from Resend to sendmcp by changing 2 values per project: the base URL and the API key. The Node SDK reads RESEND_BASE_URL from the environment, so if your code already reads RESEND_API_KEY, no line of code changes. What does not move: broadcasts, audiences and the history in the Resend dashboard.

By · Published · Updated

Do I have to change my code?

Not if you use the Resend SDK the usual way. In the Node SDK, the constructor takes the API key, or reads RESEND_API_KEY when you pass none. The base URL comes from the baseUrl option, or else from RESEND_BASE_URL, or else it is https://api.resend.com. That is why two environment variables are the whole change.

One catch: the SDK only reads those variables when process.env exists. On a runtime without it, pass baseUrl in the constructor options. The same variable works in the Go, PHP and Ruby SDKs, and Python reads RESEND_API_URL. See the compatible API page.

How do I deploy sendmcp?

sendmcp is one Worker on your own Cloudflare account. You need Workers Paid ($5 a month, 3,000 emails included, then $0.35 per 1,000). The steps are on the self-host page. When it is up, you have a Worker URL such as https://mail.acme.com and an MCP server your agent can connect to.

How do I add my domains?

Each domain needs a zone on your Cloudflare account. Then ask your agent to add it. It creates the domain, writes the SPF, DKIM and DMARC records on Cloudflare, verifies them and sends you a test email. There is no per-domain fee.

Leave Resend running while you do this. One thing to watch: a name may have only one SPF record, because a second one makes the SPF check fail with a permanent error (RFC 7208, section 4.5). If the agent finds an existing SPF record, merge the two instead of adding another. SPF, DKIM and DMARC on Cloudflare shows how.

How do I switch each project?

Create one sendmcp key per project, scoped to its domain, and put it where the Resend key was. Then set the base URL:

# .env
RESEND_BASE_URL=https://mail.acme.com
RESEND_API_KEY=your_sendmcp_key_for_acme_com

The application code stays as it is:

import { Resend } from "resend";

// Reads RESEND_API_KEY and RESEND_BASE_URL from the environment
const resend = new Resend();

await resend.emails.send({
  from: "Acme <hi@acme.com>",
  to: ["user@example.com"],
  subject: "Welcome to Acme",
  html: "<p>Your account is ready.</p>",
});

If you would rather name the variable SENDMCP_KEY, pass it as new Resend(process.env.SENDMCP_KEY). Keep the old Resend key until the project has sent a test, then delete it. sendmcp serves /emails, not /v1/emails, which matches Resend's own paths.

How do I test the first send?

  1. Send one email from the project to your own address and check it arrives and passes SPF and DKIM.
  2. Change any resend.dev test addresses in your tests to @test.sendmcp.dev. Test keys never send.
  3. Look at the email in the sendmcp logs. If something bounced, ask your agent: bounce_explain reads the event and tells you what to fix.
  4. Switch one project at a time and watch it for a few days before the next.

What happens to my webhooks?

Handlers keep working. sendmcp sends the same event names and the same Svix-style headers (svix-id, svix-timestamp, svix-signature), so the code that verifies a Resend webhook verifies a sendmcp one. Two changes: register your endpoint in sendmcp (your agent can do it with webhooks_upsert), and use the signing secret sendmcp gives you, not the one from Resend.

Resend eventIn sendmcp
email.sent, email.delivered, email.delivery_delayed, email.bounced, email.complained, email.failedSame names
domain.created, domain.updated, domain.deletedSame names
contact.created, contact.updated, contact.deletedNot sent: there are no contacts
email.opened, email.clickedCloudflare Email Sending has no tracking itself; check your domain's tracking setting before you rely on these

What works the same and what differs?

AreaSame as ResendDifferent or missing
SendingSend, batch of up to 100, retrieve, list, update, cancel; html, text, cc, bcc, reply_to, attachments, headers, tags, scheduled_atNo share link; no topic_id
RequestsRequest and response bodies, error body, cursor pagination, Idempotency-Key, ratelimit-* headerssendmcp's own rate limit, plus Cloudflare's daily account quota (Resend's default is 10 requests a second)
DomainsCreate, retrieve, list, update, delete, verifyDNS records are written for you, not only shown
API keysSame scopes: full access or sending access, one domain or allCreated in your own deployment; a Resend key does not work there
Templates, suppressions, logsSame endpointsYour existing Resend templates are not imported
WebhooksEvent names and signature headers for email and domain eventsNo contact.* events
Test modeTest addresses@test.sendmcp.dev replaces resend.dev; test keys never send
MarketingNot applicableNo contacts, segments, broadcasts or automations

What does not carry over?

How do I cancel Resend?

After every project has sent a real email through sendmcp and its webhooks fire, delete the Resend keys. Then follow Resend's own steps: open the Billing page, click the three dots next to your plan and choose Cancel Subscription. Cloudflare then bills you for sending at $0.35 per 1,000 emails after the first 3,000 a month, in place of Resend's $20 a month Pro plan.

Two honest caveats before you commit. Cloudflare Email Sending is a public beta, and sendmcp has no hosted version, so you run the Worker. See Resend vs sendmcp for when staying on Resend is the better call.

Sources

  1. resend-node: src/resend.ts (base URL and key handling) checked
  2. Resend: Webhook event types checked
  3. Resend: Pricing (data retention, plans) checked
  4. Resend: Managing Billing (cancel a subscription) checked
  5. Resend: API reference and rate limits checked
  6. Cloudflare: Email Service pricing checked
  7. RFC 7208: Sender Policy Framework, section 4.5 checked

Questions about this

Can I switch from Resend without downtime?

Yes, one project at a time. Add the domain to sendmcp, send a test, change the two variables, and keep the Resend key until the project works. Nothing else in your code has to change.

Will my Resend webhook handlers still work?

Yes for email and domain events. sendmcp uses the same event names and the same signature headers. Register the endpoint in sendmcp and use its signing secret. Handlers for contact.* events will not receive anything.

Can I move my Resend audiences and broadcasts?

No. Cloudflare allows transactional email only, so sendmcp has no contacts, segments or broadcasts. Keep marketing email on Resend or use a newsletter tool.

Send from every project for $0.

Open source. One click puts it on your Cloudflare account.