Skip to main content
Glama

Why sendmcp

Resend's free plan stops at 3 domains, and the fourth project costs $20 a month even if it sends ten emails. sendmcp runs in your Cloudflare account instead, so every side project gets email from its own domain, and an app that already uses the Resend SDK only needs a new base URL.

  • Unlimited domains and projects from one deploy.

  • Resend-compatible API: same paths, error names and re_ keys. Keep your code.

  • Your agent runs it: Claude Code, Cursor or Codex sends and reads email, creates keys, webhooks and templates and checks delivery over MCP.

  • Your data stays in your account: D1 for metadata, R2 for bodies, Cloudflare Access for the dashboard. No passwords, no third-party service.

Related MCP server: cfmail

Features

Feature

What you get

Sending

single and batch sends (up to 100), scheduled sends, cancel, idempotency keys, test keys

Domains

add in the dashboard or with POST /domains; Cloudflare writes DKIM, SPF and DMARC

Inbound mail

receiving addresses per domain, delivered to your webhooks as email.received

Webhooks

Resend's event names, Svix-style signatures, replay

Templates

drafts, publish, {{{VARIABLES}}}

Deliverability

bounce and complaint suppressions, delivery events, a daily limit per project

Observability

request logs, email history, setup checks with a link to fix each problem

Dashboard

every setting has a page, behind Cloudflare Access

MCP server

31 tools over OAuth, each running the same route as the dashboard

Transactional email only (sign-up, magic links, receipts, alerts). No marketing or bulk mail: Cloudflare Email Sending does not allow it.

How it works

flowchart LR
  app["Your app<br>(Resend SDK)"] -->|REST API| worker
  agent["Your agent<br>(Claude Code, Cursor, Codex)"] -->|MCP over OAuth| worker
  you["You"] -->|Dashboard behind Access| worker
  subgraph cf["Your Cloudflare account"]
    worker["sendmcp Worker"]
    worker --> d1[("D1<br>metadata")]
    worker --> r2[("R2<br>bodies")]
    worker --> send["Email Sending"]
    routing["Email Routing"] -->|inbound| worker
    send -->|delivery events| queue["Queues"] --> worker
  end

Before you deploy

  1. Workers Paid plan on the Cloudflare account. Queues and Email Sending need it.

  2. Zero Trust organization. Open Zero Trust once and pick a team name. The free plan is enough; Cloudflare asks for payment details even on Free.

  3. Email Sending turned on for the account (Email Service in the dashboard).

No secrets and no API token: the one value you paste is the ID of an OAuth client you create yourself.

Deploy

  1. Click Deploy to Cloudflare above. Cloudflare copies the repo into your GitHub account and creates the D1 database, R2 bucket and queue. It asks for nothing else.

  2. Create an OAuth client in your Cloudflare account: Manage Account → OAuth clients → Create (docs).

    • Type: public client, Authorization Code with PKCE (no secret).

    • Redirect URI: https://sendmcp.<your-subdomain>.workers.dev/oauth/cloudflare/callback.

    • Scopes: the ones in CF_OAUTH_SCOPES in wrangler.jsonc, listed below.

  3. In the repo copy from step 1, put the client ID in CF_OAUTH_CLIENT_ID in wrangler.jsonc and commit. Workers Builds redeploys the Worker.

  4. Open the Worker URL (https://sendmcp.<your-subdomain>.workers.dev) and click Sign in with Cloudflare. Pick the account the Worker runs in and approve what sendmcp asks for. sendmcp checks that this account runs the Worker, makes you the owner and creates a Cloudflare Access application that lets in your Cloudflare email only.

  5. Sign in to Access with the one-time code it emails you. The Get started page runs the setup checks and tells you what is missing, with a link to fix each one.

The first sign-in has to use the workers.dev URL: that is how sendmcp proves the account owns it. Revoke sendmcp any time in your Cloudflare profile under OAuth authorizations, then sign in again.

Permission

Used for

User details · Read

your email, the dashboard owner

Account · Read, Workers · Read

proving the account runs this Worker

Email Sending · Edit

sending and quota checks

Access: Apps and Policies · Edit

protecting the dashboard

Access: Organizations · Read

finding your Zero Trust team domain

Zone · Read

listing the domains you can send from

DNS · Edit

writing DKIM, SPF and DMARC records

Email Routing · Edit

receiving mail

Zone Settings · Edit

turning on the receiving subdomain

Queues · Edit

delivery events (delivered, bounced)

Offline access

refreshing the sign-in token

Prefer a hand-made API token? Set it with wrangler secret put CLOUDFLARE_API_TOKEN (same permissions, plus CLOUDFLARE_ACCOUNT_ID if it sees several accounts). It overrides the sign-in token.

Set CF_OAUTH_CLIENT_ID in wrangler.jsonc first (step 2 above).

pnpm install
pnpm build && pnpm run deploy

pnpm run deploy applies the D1 migrations, then runs wrangler deploy. Use pnpm run deploy, not pnpm deploy, which is a different pnpm command.

Use the API

Point the Resend SDK at your Worker and use a key from the dashboard (API keys):

RESEND_BASE_URL=https://sendmcp.<your-subdomain>.workers.dev
RESEND_API_KEY=re_...
import { Resend } from 'resend';

const resend = new Resend(process.env.RESEND_API_KEY);

await resend.emails.send({
  from: 'hello@yourdomain.com',
  to: 'you@example.com',
  subject: 'It works',
  html: '<p>Sent through sendmcp.</p>',
});

The Python SDK reads RESEND_API_URL instead. A test key (re_test_...) accepts sends and never delivers them.

Area

Same as Resend

Different or missing

Emails

send, batch of up to 100, retrieve, list, update, cancel, scheduled_at

attachments are base64 content only, no share link

Requests

bodies, error shape, cursor pagination, Idempotency-Key

no rate-limit headers; a daily limit per project plus Cloudflare's account quota

Domains, API keys

same endpoints; a domain's id is its name

full access keys only; Cloudflare writes the DNS records into your zone

Templates

drafts, publish, {{{VARIABLES}}}

none

Webhooks

Resend's event names, Svix-style signature headers

no contact.* events

Suppressions, logs

dashboard and MCP only

Marketing

/broadcasts, /audiences, /contacts return 501

Errors use Resend's shape: { "statusCode": 403, "name": "invalid_api_key", "message": "..." }.

Use it from your agent

Add https://sendmcp.<your-subdomain>.workers.dev/mcp to Claude, Cursor, ChatGPT or Codex as a remote MCP server and approve access once in the browser (OAuth). In Claude Code:

claude mcp add --transport http sendmcp https://sendmcp.<your-subdomain>.workers.dev/mcp

The server has 31 tools: projects, domains and tracking, API keys, sending and reading emails, inbound mail, webhooks with replay, templates, suppressions, request logs, the daily quota and the setup checks. Each tool runs the same route as the dashboard.

Update

The setup page and GET /version say when a new release is out. The Deploy button created your own copy of the repo, so pull the new release into it (or merge the upstream tag) and Workers Builds redeploys. Migrations run as part of the deploy.

Develop

Requires Node 24+ and pnpm.

pnpm install
cp .dev.vars.example .dev.vars

LOCAL_DEV=1 in .dev.vars lets wrangler dev on localhost skip Cloudflare Access. It has no effect on any other host. Put an API token in CLOUDFLARE_API_TOKEN there, since OAuth sign-in only returns to workers.dev URLs.

pnpm -C apps/worker db:migrate && pnpm -C apps/worker dev
VITE_DATA=live pnpm dev

Without VITE_DATA=live the dev server runs on mock data; production builds always use the Worker API. If the Worker is not on port 8787, set WORKER_URL=http://localhost:<port>.

pnpm check

pnpm check runs Biome, the TypeScript checks and the Worker tests.

Path

What

apps/worker

the Worker: Hono, D1 migrations, Access, public API, MCP server

apps/web

the dashboard SPA (React, Vite), served by the Worker at /app

wrangler.jsonc

Worker config, at the root so the Deploy button builds the whole workspace

Contributing

Bug reports and pull requests are welcome. Open an issue first for anything larger than a fix, and run pnpm check before you push.

Security

Please report vulnerabilities privately through GitHub security advisories, not in a public issue.

License

MIT. Built by agentfirsthq: tools that your agent can set up and run.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Deploys a self-hosted Cloudflare email service providing short-lived mailboxes with a JSON API and MCP endpoint for automated testing and AI agent signup, verification, and magic-link flows.
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to autonomously receive, search, read, reply to, and forward email through a self-hosted Cloudflare service accessible via MCP or CLI, with no web interface.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Gives AI agents a self-hosted Cloudflare mailbox they can use to receive, search, wait for, read, send, reply to and forward email, with attachments and threads, over MCP or REST behind a single bearer token.
      5
      MIT