Agent Onboarding

Everything you need to onboard your AI agent to AgentMail

If you’re developing with AI, AgentMail offers several resources to improve your experience.

Get an API key

Your agent can sign up programmatically using the Agent API. No console access needed.

1from agentmail import AgentMail
2
3client = AgentMail()
4response = client.agent.sign_up(human_email="you@example.com", username="my-agent")
5# response.api_key -> store this securely
6# response.inbox_id -> my-agent@agentmail.to

A 6-digit OTP is sent to the provided email. Verify to unlock full permissions:

1client = AgentMail(api_key=response.api_key)
2client.agent.verify(otp_code="123456")

The sign-up endpoint is idempotent. Calling it again with the same email rotates the API key and resends the OTP if expired.

Unverified accounts can only send email to the signup address. Until you complete OTP verification, outbound emails to any other address will fail without any error message. Always call agent.verify() before sending to external recipients.

Some domains cannot be used for agent signup. Common placeholder domains (e.g., example.com) and certain provider-specific domains are blocklisted. If signup fails, use a real email address from your own domain or a standard email provider.

Alternatively, a human can create an account at console.agentmail.to and generate an API key from the dashboard.

AgentMail’s free tier includes 3 inboxes and 3,000 emails/month. Your agent can start building immediately.

AgentMail MCP Server

MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. The AgentMail MCP server gives your AI agent tools to create inboxes, send emails, manage threads, and more.

Setup

Add this to your MCP client configuration (Claude Code, Cursor, Codex, etc.):

1{
2 "mcpServers": {
3 "AgentMail": {
4 "url": "https://mcp.agentmail.to/mcp?apiKey=YOUR_API_KEY"
5 }
6 }
7}

Clients that support remote MCP OAuth can instead use the bare https://mcp.agentmail.to/mcp and authenticate in-flow.

Available MCP tools

Your MCP client discovers tools directly from the hosted runtime. See the current MCP tool catalog for their names, descriptions, and availability.

AgentMail Docs for Agents

You can give your agent current docs in three ways:

  1. Full documentation index

    A structured index of every doc page with descriptions:

    https://docs.agentmail.to/llms.txt
  2. Complete docs in one file

    Every doc page concatenated into a single file for full context:

    https://docs.agentmail.to/llms-full.txt
  3. Markdown versions of any page

    Every doc page is available as Markdown. Append .md to any page URL:

    https://docs.agentmail.to/quickstart.md

AgentMail Skills

Skills give AI agents specialized knowledge for specific tasks. Install the AgentMail skill to give your coding assistant full email capabilities:

Claude Code

$claude-code skills install agentmail-to/agentmail-skills/agentmail

Cursor

$cursor skills install agentmail-to/agentmail-skills/agentmail

Codex

$codex skills install agentmail-to/agentmail-skills/agentmail

Manual Installation

$git clone https://github.com/agentmail-to/agentmail-skills.git ~/.skills/agentmail

Then set your API key:

$export AGENTMAIL_API_KEY="your-api-key-here"

Quick start for agents

Sign up, create an inbox, and send your first email:

1from agentmail import AgentMail
2
3# sign up (no API key needed)
4client = AgentMail()
5response = client.agent.sign_up(human_email="you@example.com", username="my-agent")
6
7# after verifying with the OTP sent to your email:
8client = AgentMail(api_key=response.api_key)
9client.agent.verify(otp_code="123456")
10
11# create an inbox and send an email
12inbox = client.inboxes.create(display_name="My AI Agent")
13print(f"Agent email: {inbox.inbox_id}")
14
15client.inboxes.messages.send(
16 inbox.inbox_id,
17 to="user@example.com",
18 subject="Hello from my AI agent",
19 text="Hi! I'm an AI agent with my own email address."
20)

Already have an API key? Skip the sign-up step and initialize the client directly with your key.

Receive and reply to emails

1# List threads in the inbox
2threads = client.inboxes.threads.list(inbox_id=inbox.inbox_id)
3
4# Get the latest thread
5thread = client.inboxes.threads.get(
6 inbox_id=inbox.inbox_id,
7 thread_id=threads.threads[0].thread_id
8)
9
10# Reply to the latest message
11latest_message = thread.messages[-1]
12client.inboxes.messages.reply(
13 inbox_id=inbox.inbox_id,
14 message_id=latest_message.message_id,
15 to=[latest_message.from_],
16 text="Thanks for your email! I'll look into this."
17)

AI Builder Integrations

AgentMail integrates with popular AI development platforms:

What Makes AgentMail Different?

Unlike traditional email APIs that are built for one-way transactional email, AgentMail is built for two-way agent communication:

FeatureAgentMailTraditional Email APIs
Per-agent inboxes✅ Create thousands via API❌ Shared sending domains
Receive & parse emails✅ Native with threads⚠️ Limited or add-on
Threaded conversations✅ First-class API support❌ Not supported
Allowlists/blocklists✅ Per-inbox controls❌ Not available
Multi-tenant (Pods)✅ Built-in isolation❌ Build it yourself
WebSocket events✅ Real-time streaming❌ Webhooks only
IMAP/SMTP access✅ Full protocol support❌ API-only
Usage-based pricing✅ Pay per email❌ Per-inbox subscriptions

Next Steps