AI 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.

Prerequisite: Create an API Key

You’ll need a human to create an AgentMail account at console.agentmail.to. Once you have an account, create an API key from the dashboard. With an API key, your agent can create inboxes, send and receive emails, manage threads, and more.

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 "command": "npx",
5 "args": ["-y", "agentmail-mcp"],
6 "env": {
7 "AGENTMAIL_API_KEY": "YOUR_API_KEY"
8 }
9 }
10 }
11}

You can selectively enable specific tools using the --tools argument:

1{
2 "mcpServers": {
3 "AgentMail": {
4 "command": "npx",
5 "args": ["-y", "agentmail-mcp", "--tools", "get_message,send_message,reply_to_message"],
6 "env": {
7 "AGENTMAIL_API_KEY": "YOUR_API_KEY"
8 }
9 }
10 }
11}

Available MCP Tools

ToolDescription
create_inboxCreate a new email inbox for an agent
list_inboxesList all inboxes in your account
get_inboxGet details of a specific inbox
delete_inboxDelete an inbox
send_messageSend an email from an agent inbox
reply_to_messageReply to an email in a thread
forward_messageForward an email
update_messageUpdate message labels or status
list_threadsList email threads in an inbox
get_threadGet a full email thread with messages
get_attachmentDownload an email attachment

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

Create an inbox and send your first email in a few lines:

1from agentmail import AgentMail
2
3client = AgentMail(api_key="am_...")
4inbox = client.inboxes.create(display_name="My AI Agent")
5print(f"Agent email: {inbox.inbox_id}")
6
7# Send an email
8client.inboxes.messages.send(
9 inbox.inbox_id,
10 to="user@example.com",
11 subject="Hello from my AI agent",
12 text="Hi! I'm an AI agent with my own email address."
13)

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 (SendGrid, Resend, Mailgun) 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