Article featured image

Email testing MCP server: Let AI agents test your app's emails

13min readLast updated: December 3, 2026

An email testing MCP server gives an AI agent, like Claude Code, Codex or Cursor, test inboxes it can read. With testmail.app’s MCP server, your agent can create a fresh email address, sign up in your app with it, wait for the verification email and read the code or link, without a password or an API key in the chat.

This guide explains what MCP is and which kind of email MCP server fits testing. Then it covers everything you need to use testmail.app’s MCP server: how it works, the six tools it gives your agent, how to connect Claude Code, Codex, Cursor, VS Code and Claude, what to ask, and how it keeps your account safe.

Want to start now? Create a free testmail.app account, then connect your agent from our MCP setup page.

What is MCP?

MCP (Model Context Protocol) is an open standard that lets AI apps use outside tools and data. Anthropic introduced it in November 2024, and today Claude, Claude Code, ChatGPT, Codex, Cursor, VS Code and many other AI apps support it.

MCP works like a universal plug. A service builds one MCP server, and the AI apps that support MCP can use it, with no custom integration for each app.

Every MCP connection has three parts:

PartWhat it isExample
HostThe AI app you talk toClaude Code in your terminal, Cursor, the Claude app
MCP clientThe part of the host that connects to one MCP serverClaude Code’s connection to testmail.app
MCP serverA service that offers tools, each with a description and inputs, and sometimes data or promptstestmail.app’s server, with tools such as “generate a test email address”

Inside the host, the AI model reads each tool’s description and decides when to call it.
mcp-connection-host-client-server.png

What is an MCP server?

An MCP server is the service side of MCP: it offers tools that AI apps can call, and sometimes data and ready-made prompts too. It runs either on your computer (a local server, started as a program) or on the web (a remote server, reached by a URL).

A remote server can ask you to sign in with OAuth. Your AI app opens the service’s sign-in page in your browser, you click Allow, and the app receives a token for that service. The model never sees your password or an API key.

testmail.app’s MCP server is a remote server, so your AI app reaches it at https://api.testmail.app/mcp over the web. For the protocol itself, see the official MCP documentation.

Which email MCP server do you need?

“Email MCP server” can mean several kinds of server, and they do different jobs:

Kind of email MCP serverWhat the agent can doBest for
SendingSend email through an email delivery serviceAgents that need to send email
Your own mailboxRead and send the mail in a real account, such as Gmail or OutlookWorking with your own email
Local email catcherRead the email your app sends to a local SMTP serverApps you can point at that server, on your computer or in CI
Hosted test inboxes, like testmail.appCreate test addresses on a real domain and read the email sent to themEnd-to-end tests of signups, OTPs, magic links and password resets, in any environment

For end-to-end tests, hosted test inboxes fit best: your app sends real email to a real address from any environment, with no change to its SMTP settings, and the agent reads it without access to anyone’s real mailbox. A local catcher also works when you can point your app at it.

Why AI agents get stuck on emails

AI coding agents can write and run a signup test on their own: they start your app, fill in the form and press the button. Then your app sends a verification email, and the agent stops, because it has no inbox.

The usual workarounds each cost something:

  • Mock the mailer. The test can check what your code meant to send, but not the email your users actually receive.
  • Give the agent a real mailbox. Now an AI tool holds credentials to an inbox, and every test lands among real mail.
  • Paste the code in by hand. It works once, but it isn’t a test anyone can run again.

To test emails properly, an agent needs four things:

  1. A fresh address for each run, so this run’s email can’t be confused with an earlier one.
  2. A way to wait for the email, because sending takes a few seconds, sometimes more.
  3. The code or link, already picked out, so it doesn’t have to dig through a whole HTML email.
  4. No secrets in the chat: no password and no API key pasted into a conversation.

ai-agent-email-testing-needs.png

An email testing MCP server gives an agent all four. For the basics of email testing itself, see Email testing 101.

How testmail.app’s MCP server works

testmail.app’s MCP server connects your AI agent to your testmail.app test inboxes. You sign in once in your browser, and from then on your agent can create test addresses and read the emails your app sends to them.

Every testmail.app address has the form {namespace}.{tag}@inbox.testmail.app with two parts: the namespace comes with your account, and the tag can be any text allowed in an email address. So your agent makes a new address for each test run with no setup. Why a unique address per test matters is covered in Test email addresses for developers and QA.

testmail-address-namespace-tag.png

Here’s what a run looks like:

You: Test the signup on my app with a new testmail.app address and verify the email.
Agent: Calls testmail_generate_test_address, gets the address ab12cd.signup-7f3e2a9c41d0b8e25a6f3c1d@inbox.testmail.app and signs up with it.
Agent: Calls testmail_get_verification and gets code 482913, from an email that arrived after 4 seconds. Enters the code.
Agent: The account is verified.

ai-agent-signup-test-verification-code.png

Your agent drives your app the way it already can: with a browser tool such as Playwright’s MCP server, with your test framework, or with plain HTTP requests. testmail.app gives it the inbox.

The six testmail.app MCP tools

Once connected, your agent gets six tools. All of them are read-only: they create addresses and read your test inboxes, and nothing else. You don’t need to name them; ask in plain words and your agent picks the right one.

ToolWhat it doesWhen your agent uses it
testmail_generate_test_addressCreates a fresh address in one of your namespaces, and notes when it was madeAt the start of each test run
testmail_get_verificationWaits for an email to an address (30 seconds by default, up to 45), then looks for its verification code and its linksTo finish a signup, an OTP sign-in, a magic link or a password reset
testmail_get_emailsReads emails in a namespace, newest first, with their text (and HTML if asked), and can wait up to 45 seconds for one to arriveTo check an email’s content, or to see what arrived
testmail_list_namespacesLists the namespaces you can useWhen your account has more than one
testmail_whoamiShows which testmail.app account the agent is signed in asTo check the connection
testmail_aboutGives the agent facts about testmail.appWhen it needs to explain the service

How to set up the testmail.app MCP server

You need a testmail.app account. The free plan works (100 emails a month), and new accounts start with a 14-day free trial, no credit card required. Every app uses the same server URL:

https://api.testmail.app/mcp

The first time your agent connects, testmail.app opens in your browser. Sign in (or sign up) and click Allow. There’s no API key to copy. The same steps, with copy buttons, are on our MCP setup page.

connect-ai-agent-testmail-mcp-oauth.png

Claude Code

  1. Run this in your terminal:

    claude mcp add --transport http testmail https://api.testmail.app/mcp
    

    Add --scope user to use it in all your projects.

  2. Start Claude Code (or restart it), type /mcp, select testmail, then Authenticate. Or sign in from your terminal with claude mcp login testmail.

--transport http tells Claude Code that the server is on the web. Without it, Claude Code tries to start the URL as a program.

In the Claude Code extension for VS Code, type /mcp and click Add server. Name it testmail, choose HTTP (remote), paste the URL and click Add server. Then click Authenticate, and start a new conversation: the tools load there.

Codex

  1. Run this in your terminal:

    codex mcp add testmail --url https://api.testmail.app/mcp
    
  2. Sign in to testmail.app in the browser window that opens and click Allow. Then start Codex (or restart it). No window? Open the link Codex prints, or run codex mcp login testmail if it printed none.

In the Codex app or IDE extension, open Settings > MCP servers > Add server. Name it testmail, choose Streamable HTTP and paste the URL. Save, restart, then click Authenticate.

Cursor

  1. Click Add to Cursor and confirm in Cursor.
  2. Sign in to testmail.app when Cursor asks, and click Allow.

To add it yourself, open Cursor’s Customize page, add a new MCP server and paste the URL. Or put this in ~/.cursor/mcp.json (for one project only, in .cursor/mcp.json in that project):

{
  "mcpServers": {
    "testmail": {
      "url": "https://api.testmail.app/mcp"
    }
  }
}

VS Code (GitHub Copilot)

  1. With GitHub Copilot, run MCP: Add Server from the Command Palette. Choose HTTP, paste the URL, name it testmail, then choose Global > Copilot Global.
  2. Sign in to testmail.app when VS Code asks, and click Allow.

Or put this in ~/.copilot/mcp-config.json (to share it with your team, in .mcp.json at the root of your workspace):

{
  "mcpServers": {
    "testmail": {
      "type": "http",
      "url": "https://api.testmail.app/mcp",
      "tools": ["*"]
    }
  }
}

Claude (claude.ai and the Claude apps)

  1. In claude.ai or the Claude app, open Customize > Connectors and add a custom connector with the URL.
  2. Click Connect, sign in to testmail.app and click Allow. In a chat, check that testmail is switched on: the + button, then Connectors.

On a Claude Team or Enterprise plan, an owner adds it first, in Organization settings > Connectors; then each person connects it with their own testmail.app account. If you also use Claude Code with the same claude.ai account, the connector appears in its /mcp list too.

Any other AI agent

testmail.app’s MCP server works with any app that supports remote MCP servers with OAuth sign-in. Add https://api.testmail.app/mcp as a remote (HTTP) server in the app’s settings, and sign in when it asks.

Or let your agent set it up

Copy the setup prompt from our MCP setup page into Claude Code or Codex. Your agent adds the server with its own command, then hands the sign-in to you. It never asks for your password or an API key, and never clicks Allow for you.

Check that it works

Ask your agent: “Who am I on testmail.app?” It answers with the email of the testmail.app account it’s signed in to. If it says it has no testmail tools, start a new chat or restart the app: most apps load an MCP server’s tools when a session starts.

What to ask your agent

Ask in plain words, and ask for a new testmail.app address in each test so every run starts clean. These prompts work:

TaskWhat to ask
Test a signupTest the signup on my app with a new testmail.app address and verify the email.
Test a password resetRequest a password reset for my test user, follow the reset link from the email and set a new password.
Test a magic linkSign in with a magic link for a new testmail.app address and tell me where the link lands.
Check a transactional emailPlace a test order with a new testmail.app address and check the confirmation email: subject, order number, total and every link.
Find a missing emailSign up with a new testmail.app address and wait for the email. If none comes, list the emails that arrived in my namespace in the last hour.
Check your inboxDid I get any emails in the last 10 minutes?

A few habits make runs reliable:

  • Use one fresh address per run. The address comes with the time it was made, and the tools tell the agent to pass that time to its later reads, so an email from an earlier run can’t pass for this one.
  • Let it wait. The verification tool waits 30 seconds by default and up to 45 if asked; the email reader waits only when asked, also up to 45. If your app sends slowly, ask the agent to try again rather than read an older email.
  • If a code looks wrong, ask for the email. The verification tool finds common code formats; for an unusual one, the agent can read the email itself.
  • Ask for the email’s content when it matters. “Check that the welcome email greets the user by name” makes the agent read the email’s text, not just the code. Very long emails come back shortened, with a link to the whole email.

For tests that run in CI without an agent, use our JSON or GraphQL API with an API key: it reads the same inboxes. Our guides to signup testing with Playwright, email testing with Cypress and email OTP testing show how.

Is testmail.app’s MCP server safe?

Yes. Your agent signs in with OAuth, gets read-only access to your test inboxes and never gets your password or your API key.

  • Read-only tools. The tools create addresses and read your test inboxes. They can’t change your account, manage your API keys or send email.
  • No secrets in the chat. You sign in on testmail.app itself, in your browser. On our side, we use your API key to read your test inboxes; the agent sees only its first and last four characters, so you can tell which key was used.
  • Access that ends. An agent’s access ends after 30 days, and signing in again takes a click. To disconnect sooner, remove the server from your agent.
  • Email content is treated as untrusted. Anyone can send an email that says “ignore your instructions.” The tools mark email content as outside data, and the verification tool returns the code, the links, the sender and the subject, never the email’s body.
  • Only test inboxes. The agent reads addresses at inbox.testmail.app in your namespaces, never your personal email.

email-mcp-verification-untrusted-content.png

Plans and limits

The MCP server is included in every testmail.app plan, including the free plan. Reading emails through it counts toward your plan’s API request limits, the same as a request to our JSON or GraphQL API; generating addresses doesn’t. Emails are kept for 1 day on the free plan, up to 3 days on Essential, up to 30 days on Pro and for a custom period on Enterprise. See pricing for each plan’s limits.

Troubleshooting

ProblemWhat to do
Claude Code says the server needs authenticationType /mcp, select testmail and choose Authenticate, or run claude mcp login testmail in your terminal. The sign-in needs you, in your browser. This can also happen before the 30 days are up when several Claude Code sessions share one sign-in.
Codex didn’t open a browserOpen the sign-in link Codex printed. If it printed none, run codex mcp login testmail in your terminal.
The tools don’t appear after signing inStart a new chat or restart the app: most apps load an MCP server’s tools when a session starts.
Claude doesn’t use the toolsIn the chat, click +, then Connectors, and switch testmail on.
You signed in with the wrong testmail.app accountClick Cancel on the Allow page, sign out of testmail.app, sign in with the right account and connect again.
Add to Cursor opened a web page but not CursorInstall Cursor, or copy the configuration from that page into ~/.cursor/mcp.json.
The agent can’t find the emailCheck that your app sent it to the exact address the agent generated, after the address was made.
Claude says only an owner can add connectorsOn a Claude Team or Enterprise plan, an owner adds testmail.app in Organization settings > Connectors first; then connect it yourself.

FAQ

What is an email testing MCP server?

An email testing MCP server is an MCP server that gives AI agents test inboxes: it creates email addresses and reads the emails sent to them. testmail.app’s MCP server lets agents like Claude Code, Codex and Cursor test signup, OTP, magic link and password reset emails from start to finish.

Which email MCP server should I use for testing?

One that gives your agent test inboxes, not a sending service or your own mailbox. A local email catcher works when you can point your app at it. testmail.app’s MCP server works from any environment: your agent creates unlimited test addresses at inbox.testmail.app and reads the emails your app sends to them.

Can Claude Code read verification emails?

Yes, with an email testing MCP server. Add testmail.app’s server to Claude Code with the command in the setup steps above and sign in. Then ask Claude Code to test your signup: it creates the address, waits for the email and reads the code or link.

Is testmail.app’s MCP server free?

Yes. It’s included in every plan, including the free plan (100 emails a month, no credit card). Reading emails through it counts toward your plan’s API request limits, like a request to our API.

Do I need to give my AI agent an API key?

No. Your agent signs in to your testmail.app account with OAuth, in your browser. We use your API key on our side, and the agent sees only its first and last four characters.

Which AI agents work with testmail.app’s MCP server?

Any agent that supports remote MCP servers with OAuth sign-in, including Claude Code, Codex, Cursor, VS Code with GitHub Copilot, and Claude (claude.ai and the Claude apps).

Can my AI agent read my personal email?

No. It reads only your testmail.app test inboxes: the addresses at inbox.testmail.app in your namespaces.

Can my AI agent send emails or change my account?

No. All six tools are read-only. Your app sends the emails, and the agent reads them.

How long does my agent stay connected?

30 days. After that, sign in again from your agent (in Claude Code: /mcp, then Authenticate). To disconnect sooner, run claude mcp remove testmail in Claude Code, or codex mcp logout testmail and then codex mcp remove testmail in Codex. In Claude, remove it under Customize > Connectors.

Can I use the MCP server in CI/CD?

The MCP server is for AI agents you work with. For automated tests in CI/CD, use our JSON or GraphQL API with an API key: they read the same inboxes, and our email OTP testing guide shows a complete setup.

Does it work with Playwright or Cypress?

Yes. Your agent can drive your app with a browser tool such as Playwright’s MCP server while testmail.app provides the inbox. For test suites without an agent, our Playwright and Cypress guides use the API.

How do I get started?

Create a free testmail.app account, then follow the steps for your agent on our MCP setup page.

Subscribe to blog

Stay updated with our latest insights and curated articles delivered straight to your inbox.