Emailens
Email Sandbox

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:

ToolParametersDescription
list_sandbox_inboxesNoneReturns all active inboxes, their ingestion types, and addresses
get_sandbox_messagesinboxId, limitLists captured messages in a specific inbox
get_sandbox_messagemessageIdRetrieves raw MIME headers, body HTML, text, and extracted OTP
wait_for_sandbox_messageinboxId, subject, timeoutBlocks 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."

On this page