Give your Replit app real email.
Replit Agent reads and sends test mail through the hosted MCP. The app it builds sends with its own key and hears about new mail through a signed webhook.
Connect Replit in three steps.
Send and receive email from the apps Replit Agent builds.
Add Drin to Replit Agent
In Replit's Integrations settings, open the MCP Servers pane, click + Add MCP server, name it Drin, paste this address and click Test & save. Replit walks you through signing in with Drin.
https://mcp.drin.run/mcpGive the app a key
In Drin, open Agents & keys and create one for the app. Store it as a secret in the project and ask the agent to send and read mail with the Drin API.
Get a webhook when mail lands
In Drin, open Webhooks, add your app's https address and pick the new-mail event (inbound_received). Each email arrives as a signed POST.
These steps follow Replit's own docs (docs.replit.com). If Replit changes how it works, tell us and we'll fix this page.
Mail calls your app.
Your Replit app gets a signed POST for each new email, with the clean text in the body. Check the Drin-Signature header with the secret Drin showed you once, when you made the webhook.
curl -X POST https://api.drin.run/v1/webhooks \
-H "Authorization: Bearer $DRIN_KEY" \
-H 'content-type: application/json' \
-d '{ "url": "https://app.acme.com/api/drin",
"eventTypes": ["inbound_received"] }'
# → { "id": "…", "signingSecret": "whsec_…", … } the secret is shown once
# Below full access, or from an agent's key, it needs webhooks:write, answers 202
# and delivers nothing until a person approves.import { verifyWebhook } from "@drin00/sdk";
export async function POST(req: Request) {
const raw = await req.text(); // the exact bytes Drin signed
const { payload } = verifyWebhook(raw, req.headers.get("drin-signature") ?? "", process.env.DRIN_WEBHOOK_SECRET!);
if (payload.type === "inbound_received") {
// payload.data.text is the clean text: answer it
}
return new Response(null, { status: 204 });
}What Replit can and can't do.
What it can do
- Your app sends. Sign-in links, receipts and replies from the app Replit Agent builds, with a key stored as a project secret. An app's key doesn't wait for a person.
- Your app hears replies. Each new email arrives as a signed POST with the sender, subject and clean text. No mail parsing.
- Test for free. The free sandbox sends test emails to verified recipients, through the same API.
What it can't do
- Mail doesn't wake Replit Agent. The webhook goes to the app it built.
- The chat's sign-in doesn't carry over. The app needs its own key, stored as a project secret.
- It can't see inboxes you didn't pick. To its key, they answer 404 on reads and 403 on writes.
- It can't mail a new address by itself. The first mail waits for a person, unless it's a reply to a verified sender in the same thread on an open desk.
Before you connect it.
Where does the app's key go?
How does my app know a webhook is from Drin?
Drin-Signature: t=…,v1=… header: an HMAC-SHA256 of the timestamp and the raw body with your webhook's secret. verifyWebhook in @drin00/sdk checks it and rejects anything older than 5 minutes.