AI Agent Integration (MCP)
Allow AI coding agents (Claude, Cursor, Windsurf) to inspect sandbox inboxes and run end-to-end authentication tests via Model Context Protocol.
The Emailens Model Context Protocol (MCP) server allows autonomous AI coding assistants, including Claude Desktop, Cursor, and Windsurf, to interact directly with your test inboxes.
AI agents can trigger an authentication flow, inspect incoming emails in staging, retrieve one-time passwords, and debug CSS rendering issues autonomously.
Remote MCP Server Configuration
Connect your MCP client to the hosted Emailens MCP server:
Cursor (.cursor/mcp.json)
{
"mcpServers": {
"emailens": {
"url": "https://app.emailens.dev/api/mcp",
"headers": {
"Authorization": "Bearer ek_live_..."
}
}
}
}Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"emailens": {
"command": "npx",
"args": ["-y", "@emailens/mcp"],
"env": {
"EMAILENS_API_KEY": "ek_live_..."
}
}
}
}Available Sandbox MCP Tools
When connected, AI agents have access to dedicated sandbox tools:
| Tool | Parameters | Description |
|---|---|---|
list_sandbox_inboxes | None | Returns all active inboxes, their ingestion types, and addresses |
get_sandbox_messages | inboxId, limit | Lists captured messages in a specific inbox |
get_sandbox_message | messageId | Retrieves raw MIME headers, body HTML, text, and extracted OTP |
wait_for_sandbox_message | inboxId, subject, timeout | Blocks until a matching message is ingested |
Agent Prompt Examples
Once configured, you can give your AI agent natural instructions:
Example 1: "Run the auth test suite. If an email is sent to our sandbox inbox, wait for it, read the OTP verification code, and check if our dashboard redirected successfully."
Example 2: "Inspect the latest password reset email captured in our sandbox inbox. Extract the primary reset link, verify whether the button uses VML fallbacks for Outlook, and score its CSS compatibility across 21 clients."