# 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

**Server URL:** https://api.testmail.app/mcp

### 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: 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.

### 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 it prints, or run codex mcp login testmail if it printed none.

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

### Cursor

1. Click [Add to Cursor](https://cursor.com/install-mcp?name=testmail&config=eyJ1cmwiOiJodHRwczovL2FwaS50ZXN0bWFpbC5hcHAvbWNwIn0%3D) and confirm in Cursor.

2. Sign in to testmail.app when Cursor asks, and click Allow.

Or add it yourself: Open Cursor's Customize page, add a new MCP server and paste the URL above.

Or add it to the config file: `~/.cursor/mcp.json`

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

For one project only, put the same config in .cursor/mcp.json in that project.

### VS Code

1. With GitHub Copilot, run MCP: Add Server from the Command Palette. Choose HTTP, paste the URL above, name it testmail, then choose Global > Copilot Global.

2. Sign in to testmail.app when VS Code asks, and click Allow.

Or add it to the config file: `~/.copilot/mcp-config.json`

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

To share it with your team, put the same config in .mcp.json at the root of your workspace.

### Claude

1. In claude.ai or the Claude app, open [Customize > Connectors](https://claude.ai/customize/connectors) and add a custom connector with the URL above.

   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.

2. Click Connect, sign in to testmail.app and click Allow.

   In a chat, check it's switched on: + button > Connectors.

Using Claude Code too? Signed in with the same claude.ai account, Claude Code gets the connector: it's in its /mcp list.

### Check that it works

Then ask your agent "Who am I on testmail.app?" It answers with your account's email.

### Example session

- **You:** Test the signup on my app with a new testmail.app address and verify the email.
- `testmail_generate_test_address`: ab12cd.signup-7f3e2a…@inbox.testmail.app
- **Agent:** Signed up with that address.
- `testmail_get_verification`: Code 482913, from an email that arrived after 4 seconds
- **Agent:** Entered the code. The account is verified.

## Let your agent set it up

Paste this prompt into Claude Code or Codex.

```text
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.
```

The same prompt as a file: https://testmail.app/mcp/prompt.md

## How it works

1. **Add the URL.** Add the server URL to your agent with its own command, or paste it into its settings.
2. **Sign in.** testmail.app opens in your browser. Sign in (or sign up for free), and then click Allow.
3. **Start testing.** Ask your agent to test a signup. It creates the address and reads the email for you.

## 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.

| Tool | Name | What it does |
|---|---|---|
| Generate an address | `testmail_generate_test_address` | Creates an email address in one of your namespaces. |
| Get a code or link | `testmail_get_verification` | Finds the verification code or link in your newest emails. |
| Read emails | `testmail_get_emails` | Reads the emails in one of your namespaces. |
| List namespaces | `testmail_list_namespaces` | Lists the namespaces you can use. |
| Who am I | `testmail_whoami` | Shows which account your agent is signed in as. |
| About | `testmail_about` | Gets information about testmail.app. |

[Get started](https://testmail.app/signup) with our free forever plan. No credit card required.

## FAQ

### What is an MCP server?

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.

### Which AI agents are supported?

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.

### How can I disconnect my AI agent?

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).
