---
title: "Migrate from Resend without code changes | sendmcp"
url: https://sendmcp.dev/blog/migrate-from-resend/
description: "Move from Resend to your own Cloudflare by changing 2 env vars per project: deploy, add domains, test, map webhooks, cancel. What carries over, what does not."
---

[Blog](https://sendmcp.dev/blog/)

# 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 [itsnex1s](https://x.com/itsnex1s) · Published Nov 23, 2026 · Updated Nov 23, 2026

## 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](https://sendmcp.dev/resend-compatible-api/).

## 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](https://sendmcp.dev/self-host/). 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](https://www.rfc-editor.org/rfc/rfc7208#section-4.5)). If the agent finds an existing SPF record, merge the two instead of adding another. [SPF, DKIM and DMARC on Cloudflare](https://sendmcp.dev/spf-dkim-dmarc-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 event | In sendmcp |
| --- | --- |
| `email.sent`, `email.delivered`, `email.delivery_delayed`, `email.bounced`, `email.complained`, `email.failed` | Same names |
| `domain.created`, `domain.updated`, `domain.deleted` | Same names |
| `contact.created`, `contact.updated`, `contact.deleted` | Not sent: there are no contacts |
| `email.opened`, `email.clicked` | Cloudflare Email Sending has no tracking itself; check your domain's tracking setting before you rely on these |

## What works the same and what differs?

| Area | Same as Resend | Different or missing |
| --- | --- | --- |
| Sending | Send, batch of up to 100, retrieve, list, update, cancel; `html`, `text`, `cc`, `bcc`, `reply_to`, attachments, headers, tags, `scheduled_at` | No share link; no `topic_id` |
| Requests | Request and response bodies, error body, cursor pagination, `Idempotency-Key`, `ratelimit-*` headers | sendmcp's own rate limit, plus Cloudflare's daily account quota (Resend's default is 10 requests a second) |
| Domains | Create, retrieve, list, update, delete, verify | DNS records are written for you, not only shown |
| API keys | Same scopes: full access or sending access, one domain or all | Created in your own deployment; a Resend key does not work there |
| Templates, suppressions, logs | Same endpoints | Your existing Resend templates are not imported |
| Webhooks | Event names and signature headers for email and domain events | No `contact.*` events |
| Test mode | Test addresses | `@test.sendmcp.dev` replaces `resend.dev`; test keys never send |
| Marketing | Not applicable | No contacts, segments, broadcasts or automations |

## What does not carry over?

- **Broadcasts, audiences and contacts.** Cloudflare allows transactional email only, so sendmcp has none of these. If you send newsletters, keep them on Resend or move them to a newsletter tool such as listmonk. The [open source alternatives](https://sendmcp.dev/blog/open-source-resend-alternatives/) post compares them.
- **Dashboard history.** Resend's pricing page lists 30 days of data retention on Free and Pro. Your sent emails and logs stay in Resend and do not appear in sendmcp. If you need them, pull them through Resend's [List Sent Emails API](https://resend.com/docs/api-reference/emails/list-emails) before you cancel. sendmcp starts a new history in your D1.
- **Templates.** Recreate the ones you use in sendmcp. Inline HTML sent from your code needs nothing.
- **Resend API keys.** They only work against Resend's API.
- **Support and the Resend dashboard.** Help is GitHub issues, and you read logs in your own deployment or ask your agent.

## 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](https://sendmcp.dev/vs/resend/) for when staying on Resend is the better call.

## Sources

1. [resend-node: src/resend.ts (base URL and key handling)](https://github.com/resend/resend-node/blob/main/src/resend.ts) checked Nov 23, 2026
2. [Resend: Webhook event types](https://resend.com/docs/webhooks/event-types) checked Nov 23, 2026
3. [Resend: Pricing (data retention, plans)](https://resend.com/pricing) checked Nov 23, 2026
4. [Resend: Managing Billing (cancel a subscription)](https://resend.com/docs/dashboard/settings/billing) checked Nov 23, 2026
5. [Resend: API reference and rate limits](https://resend.com/docs/api-reference/introduction) checked Nov 23, 2026
6. [Cloudflare: Email Service pricing](https://developers.cloudflare.com/email-service/platform/pricing/) checked Nov 23, 2026
7. [RFC 7208: Sender Policy Framework, section 4.5](https://www.rfc-editor.org/rfc/rfc7208#section-4.5) checked Nov 23, 2026

## 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.

## Related questions

### Can I keep the Resend SDK and switch the provider?

Which SDKs read the base URL variable, and what works the same.

[Can I keep the Resend SDK and switch the provider?](https://sendmcp.dev/resend-compatible-api/)

### How do I send email from many domains with one account?

One Worker, a key per project, no per-domain fee.

[How do I send email from many domains with one account?](https://sendmcp.dev/email-for-multiple-domains/)

### Resend vs sendmcp: what do you pay for more domains?

Unlimited domains on your Cloudflare, Resend SDK unchanged.

[Resend vs sendmcp: what do you pay for more domains?](https://sendmcp.dev/vs/resend/)

## Send from every project for $0.

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

[Deploy to Cloudflare](https://deploy.workers.cloudflare.com/?url=https://github.com/agentfirsthq/sendmcp)
