v0 built the contact form, and the server route that sends through mails.ai needed one environment variable.

Mateo SilvaFounder, Tansyfield

In action

See it work in v0

Press play to run the session. Each call is a real mails tool, and each result has the shape the API returns.

Try it

Things to ask v0

Copy any prompt into v0 and the agent does the rest with the mails tools.

  • “Build a waitlist page that emails a welcome note from the hello agent”

  • “Add a contact form whose messages reach support through mails.ai”

  • “On Pro (5 agents), create an agent called receipts for order emails”

  • “Send a test from the hello agent to reply@test.mails.ai”

  • “Show me the replies the hello agent got this week”

  • “Is jane@example.com on our suppression list?”

Step by step

Add mails to v0

v0 uses the server while it builds. The app it generates can’t call MCP tools, so its own email goes through the API with a key.

v0 · + → MCPs
  1. Open MCPs

    In the prompt form, open the + menu and choose MCPs.

  2. Add a custom server

    Configure a custom MCP server: name it mails and enter https://api.mails.ai/mcp.

  3. Choose how it signs in

    Pick OAuth to sign in to mails.ai, or Bearer Token and paste an API key. v0 then uses the tools as you chat.

  4. Give the app a key

    In the project menu, open Settings → Environment Variables, add MAILS_API_KEY with Development ticked, and ask v0 to send with it.

import { createClient } from "@mailsai/sdk";

const mails = createClient({ apiKey: process.env.MAILS_API_KEY });

export async function POST(req: Request) {
  const { email, message } = await req.json();
  const sent = await mails.agent("hello").send({
    to: "you@yourcompany.com",
    subject: `New message from ${email}`,
    body: message,
    reply_to: email,
  });
  return Response.json({ id: sent.id });
}

“Replies come back as events with an injection score already on them. We deleted a whole layer of parsing code the week we switched, and we gate on the quarantine flag, so our agent never sees the ones that look like attacks.”

Tomás VargaStaff Engineer, Cinderjay

“Moving our agent onto our own domain was a few DNS records at the registrar. No nameserver move, and our existing mail kept working. Replies to the agent still come back to its inbox, threaded with the message they answer.”

Ishani VaidyaCTO, Sedgequay

“The 422 on cold outreach is the feature I didn’t know I wanted. An agent can’t talk itself into emailing strangers.”

Marcus FeldFounder, Marrowkite

“Our tests send to the test address and wait for the real reply, so the whole loop is covered before a customer ever writes in. It answers in about a second, which keeps the suite fast.”

Ana Lucía RíosEngineering Lead, Gorsefinch

“Adding the MCP server was one JSON block. Claude Code could send and read its own inbox a minute later.”

Jonah AbramsDeveloper, Wickerjay

“A reputation score per agent tells us exactly which one needs attention, instead of one number for the whole account. It comes from each agent’s own replies, bounces and complaints, and we read it from the API.”

Mei Lin ZhouOperations, Larchwhistle

“Sends and replies have separate allowances, so a busy inbox never eats our sending quota. Pricing was the easy part.”

Kwabena AdomakoFounder, Oxbowlark

“Half our agents are LangGraph in Python and half are Node. Both SDKs make the same calls, so the team doesn’t have to think about it.”

Sofia BrandtEngineer, Moss & Ladder

“Signed webhooks, retries with backoff and an event id to dedupe on. The boring plumbing, done properly.”

Nikhil BhonsleBackend Lead, Thimblecrow

“We signed up, made a key and sent our first message without talking to anyone, and the free tier never asked for a card. That’s how infrastructure should feel.”

Frieda WesselFounder, Ploverwick Studio

Give your first agent an inbox

Free covers 3,000 emails and 3,000 inbound replies a month, with no card. Upgrade when your agents get busy.

Get your API key