testmail.app
Email testing MCP server for Claude Code, Codex and Cursor: your AI agent creates test addresses and reads the OTP and 2FA codes, magic links and emails your app sends, for end-to-end tests.
Hosted MCP Server
npx add-mcp 'https://api.testmail.app/mcp'Installs into Claude Code, Codex, Cursor and more
Documentation
Let AI agents test emails
Our MCP server lets your agent create test addresses and read the codes and links in your test emails. Sign in with your browser, no API key.
Connect your agent
https://api.testmail.app/mcp
- Run this in your terminal:
Add --scope user to use it in all your projects.claude mcp add --transport http testmail https://api.testmail.app/mcp - Start Claude Code (or restart it), type /mcp, select testmail, then Authenticate. Or sign in from your terminal: claude mcp login testmail
Or in the VS Code extension:
Type /mcp and click Add server. Name it testmail, choose HTTP (remote), paste the URL above and click Add server. Then click Authenticate, and start a new conversation: the tools load there.
Then ask your agent "Who am I on testmail.app?" It answers with your account's email.
Example session
- Test the signup on my app with a new testmail.app address and verify the email.
- testmail_generate_test_addressab12cd.signup-7f3e2a…@inbox.testmail.app
- Signed up with that address.
- testmail_get_verificationCode 482913, from an email that arrived after 4 seconds
- Entered the code. The account is verified.
Let your agent set it up
Paste this prompt into Claude Code or Codex
Set up the testmail.app MCP server in this agent, so you can read my test emails while we test my app.
It's a remote server at https://api.testmail.app/mcp with no API key: I sign in to testmail.app in my browser.
1. First check whether it's already set up: claude mcp list in Claude Code (a claude.ai connector for testmail.app counts too), or codex mcp list in Codex. If one already uses https://api.testmail.app/mcp as its URL, don't add another: if it shows Connected (Claude Code) or OAuth under Auth (Codex), skip to step 4; if it's turned off, tell me how to turn it on; otherwise go to step 2. If testmail is there with another URL, ask me before changing it. Otherwise add it with your own command, not by editing config files:
- Claude Code: claude mcp add --transport http testmail https://api.testmail.app/mcp
- Codex: codex mcp add testmail --url https://api.testmail.app/mcp
- Another agent: tell me where to add the address in your settings, then stop.
2. Then ask me to sign in. Don't try it yourself: it needs me, in the app and in my browser.
- Claude Code: I type /mcp, choose testmail, then Authenticate. If it isn't listed (this chat started before it was added), I run claude mcp login testmail in my own terminal.
- Codex: your add command may already have started the sign-in: it opens my browser or prints a link. If it did, tell me, give me the link if there is one, and wait while I finish. If it didn't, or that sign-in ends without success, ask me to run codex mcp login testmail in my own terminal.
testmail.app opens in my browser; I sign in (or sign up) and click Allow.
3. Never ask me to paste a password, sign-in code, link or API key into this chat, and never sign in or click Allow for me.
4. When I say I'm done, check it: claude mcp get testmail says Connected (Claude Code), or codex mcp list shows OAuth under Auth for testmail (Codex). Then tell me to start a new chat so the testmail tools load; testmail_whoami there shows the account.
What to ask your agent
Test a signup
Sign up on my app with a new testmail.app address and verify the account.
Test a password reset
Request a password reset for my test user, then follow the reset link from the email.
Check your inbox
Did I get any emails in the last 10 minutes?
Read recent emails
Read me the last 3 emails in my test inbox.
Tools your agent gets
All six are read-only
Generate an address
Creates an email address in one of your namespaces. testmail_generate_test_address
Get a code or link
Finds the verification code or link in your newest emails. testmail_get_verification
Read emails
Reads the emails in one of your namespaces. testmail_get_emails
List namespaces
Lists the namespaces you can use. testmail_list_namespaces
Who am I
Shows which account your agent is signed in as. testmail_whoami
About
Gets information about testmail.app. testmail_about
Get started with our free forever plan
No credit card required.
FAQ
MCP (Model Context Protocol) is an open standard for connecting AI apps to outside tools. With our MCP server, agents like Claude Code or Codex can create addresses in your namespaces and read the emails in your test inboxes.
Do I need to add my API key to my AI agent?
No. Your agent signs in to your testmail.app account with OAuth. On our side, we use your API key to read your test inboxes.
Any agent that supports remote MCP servers with OAuth should work, including Claude Code, Claude, Codex, Cursor and VS Code.
What can my AI agent do with my testmail.app account?
It can create addresses in your namespaces and read the emails in them. The tools are read-only: your agent can't change your account, manage your API keys or send emails.
Will usage through an AI agent count towards my plan's limits?
Reading emails counts towards your plan's API request limits, the same as a request to our JSON or GraphQL API. Generating addresses doesn't.
I signed in with the wrong testmail.app account. What now?
Click Cancel on the Allow page. Sign out of testmail.app, sign in with the right account, then connect again from your agent.
My agent says testmail.app needs authentication. What do I do?
Sign in again from your agent: in Claude Code, type /mcp, select testmail, then Authenticate; in Codex, run codex mcp login testmail. This can happen after 30 days, or when several sessions of the same agent renew their sign-in at the same time.
Remove testmail.app from your agent: in Claude Code, run claude mcp remove testmail; in Codex, run codex mcp logout testmail, then codex mcp remove testmail. If you added it in Claude or claude.ai, remove it in Customize > Connectors; that also removes it from Claude Code. For security, an agent's access also ends after 30 days. To keep using it after that, sign in again from your agent (in Claude Code: /mcp, then Authenticate).
© testmail.app