Anthropic's Model Context Protocol (MCP) is rapidly becoming the standard way to give language models access to external tools. Instead of writing custom function-calling glue code for every integration, you register an MCP server once and any compatible host — Claude Desktop, Cursor, or your own agent runtime — can call its tools automatically.

What AgentMailr's MCP Server Provides

AgentMailr ships a production-ready MCP server (@agentmailr/mcp-server) that exposes 32 tools to any MCP-compatible host. The core tools your agent will use most:

  • create_inbox — provision a new email address on demand
  • wait_for_email — block until an email arrives (long-poll, up to 5 minutes)
  • get_otp — wait for and extract just the OTP code from the next email
  • send_email — send outbound email from the agent's address
  • reply_to_email — reply in-thread, preserving Message-ID headers
  • list_threads — list conversation threads for context

Wiring It Into Claude Desktop

Add the MCP server to your claude_desktop_config.json:

{
  "mcpServers": {
    "agentmailr": {
      "command": "npx",
      "args": ["-y", "@agentmailr/mcp-server"],
      "env": {
        "AGENTMAILR_API_KEY": "ak_your_key_here"
      }
    }
  }
}

Restart Claude Desktop and the email tools appear automatically. You can now prompt Claude: "Create an inbox, sign up for the GitHub beta waitlist using it, and tell me when you get a confirmation."

A Real Agentic Loop

Here is what Claude does when given that prompt:

  1. Calls create_inbox → receives claude-abc123@agentmailr.com
  2. Uses browser_navigate + browser_type to fill the signup form
  3. Calls wait_for_email with a 120-second timeout
  4. Reads the confirmation email content and reports back to you

No code. No polling. No IMAP configuration. Just a natural-language instruction that results in real internet action.

Self-Hosted MCP for Production

For production agents, run the MCP server in HTTP mode instead of stdio. This lets multiple agent processes share a single MCP endpoint:

npx @agentmailr/mcp-server --transport http --port 3002

Connect your agent framework to http://your-server:3002/mcp using the Streamable HTTP transport. Every agent instance that connects gets access to all 32 email tools with your API key's quota.