Let an AI agent test your signup flow end to end
A coding agent can test a signup flow the way a person does. It opens the page, fills in the form, waits for the verification email and types the code. Playwright MCP gives the agent a browser, and the MailBots MCP server gives it an inbox on your own hostname, so nobody has to copy the code by hand.
Before you start
- A MailBots trial, Starter or Pro plan. The trial gives you a ready hostname such as
x7f3k2q9ab.trial.mailbots.top, with no card and no DNS. - An API key with the
messages:readanddomains:readscopes, created in Dashboard → Developer. - Claude Code, Cursor or another MCP client, and Node.js 18 or later for Playwright MCP.
- The app you want to test, running locally or on a staging server that you own.
Connect both servers
Playwright MCP runs on your machine and drives a real browser. The MailBots server is hosted, so it only needs a URL and your key.
In Claude Code:
claude mcp add playwright npx @playwright/mcp@latest
claude mcp add --transport http mailbots https://api.mailbots.top/v1/mcp --header "Authorization: Bearer mb_live_REPLACE_ME"In Cursor, add both to .cursor/mcp.json:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
},
"mailbots": {
"url": "https://api.mailbots.top/v1/mcp",
"headers": { "Authorization": "Bearer mb_live_REPLACE_ME" }
}
}
}To share the setup with your team in Claude Code, commit a .mcp.json that reads the key from an environment variable, so the key itself never enters the repository:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
},
"mailbots": {
"type": "http",
"url": "https://api.mailbots.top/v1/mcp",
"headers": { "Authorization": "Bearer ${MAILBOTS_API_KEY}" }
}
}
}Restart the client after you set MAILBOTS_API_KEY. A client that was already open does not see a new environment variable. In Claude Code, the /mcp command shows whether both servers are connected.
Ask the agent to sign up
Describe the flow and the rules in one prompt. The agent picks the tools itself.
Test the signup flow at http://localhost:3000/signup. Call list_domains and use the active hostname. Sign up with a new address signup-<current time>@<hostname> and the password Test-Password-1. After you submit the form, call get_latest_otp for that address. If found is false, wait five seconds and try again, for up to one minute. Enter the code, then check that the dashboard shows the new account. If the email has a verification link instead of a code, read it with get_message and open the link. Report every step and anything that failed.
A new address on every run means an old message can never be mistaken for the new one. Every address under your hostname is accepted, so there is nothing to create in MailBots first.
What the agent does
- Calls
list_domainsand gets your hostname, for examplex7f3k2q9ab.trial.mailbots.top. - Calls
browser_navigateto open the signup page, thenbrowser_snapshotto read the form. - Fills in the email and password with
browser_typeorbrowser_fill_form, then submits withbrowser_click. - Calls
get_latest_otpwith the address. Until the email arrives it getsfound: falseand waits. - Gets the code from the
otpfield, types it into the verification form and submits again. - Takes a final
browser_snapshotto confirm that the signup finished.
When the email has arrived, get_latest_otp returns the code with a summary of the message:
{
"found": true,
"otp": "847291",
"message": {
"id": "msg_049e0e73…",
"to": "signup-1762600000@x7f3k2q9ab.trial.mailbots.top",
"from": "noreply@example.com",
"subject": "Your verification code",
"otp": "847291",
"receivedAt": "2026-11-08T11:18:17.131Z",
"expiresAt": "2026-11-09T11:18:17.000Z"
}
}While nothing has arrived, it returns found: false with a hint to wait about five seconds and call again.
The MCP reference lists every tool.
When the email has a link instead of a code
Many apps verify an address with a link, and MailBots' own signup does too. Then get_latest_otp returns found: true with otp: null and a hint to read the message. The agent continues like this:
- Calls
get_messagewith the message id and finds the link in the plain-text body. - Opens the link with
browser_navigate, which verifies the address in the same browser session. - Takes a
browser_snapshotto confirm that the account is active.
The body that get_message returns is the email's plain-text version. Most transactional email includes one with the full link. If your app sends HTML only, add a plain-text part so both people and agents can read the link.
In a test run against the MailBots dashboard, the verification email arrived about five seconds after the form was submitted, and the agent was signed in after opening the link.
Turn the run into a regression test
An agent is good at exploring a flow and finding where it breaks. For a check that runs on every pull request, ask the agent to write the run down as a Playwright test. The Playwright guide has a helper that waits for the code through the REST API, and the CLI reads codes in a GitHub Actions step.
Limits and safe use
- Only test applications you own or are authorized to test. The acceptable use policy applies to agents as it does to people, and creating accounts on other companies' services is not allowed.
- A CAPTCHA stops the agent, as it should. On staging, use the CAPTCHA provider's test keys instead of turning protection off in production.
- The trial covers 500 messages, kept for 24 hours. Starter and Pro keep mail for 72 hours, as the pricing page shows.
- Keep the API key in the client's configuration, never in a prompt. MCP tools can only read mail, so a leaked key cannot send or delete anything, but revoke it from the dashboard anyway.
Questions
Which agents can I use?
Any MCP client that supports remote servers over Streamable HTTP for MailBots and local servers for Playwright MCP. Claude Code and Cursor both do.
Does the agent need Playwright to read the code?
No. Playwright MCP is only for the browser. If the agent signs up through your API instead of the page, the MailBots server alone is enough.
Can I try it without a domain?
Yes. Start the 14-day trial and use the trial hostname it gives you. Your own subdomain goes live when you choose Starter or Pro.