Skip to content
send.io
All posts

Email MCP server: the implementation guide for AI agent email

Email MCP server exposes email operations as tools AI agents call via MCP, replacing custom adapter code. Learn how to provision an agent inbox with scoped API keys, configure Streamable HTTP for Claude Code and Cursor, and map inbound webhooks and threading headers to tool calls.

On this page
TL;DR: an email MCP server exposes email operations as tools that an agent calls through the Model Context Protocol, with a scoped API key for each agent inbox. The send.io hosted server uses Streamable HTTP at /mcp and provides 160 tools, while the local stdio mode exposes only a 5-tool free-inbox subset. Use the hosted HTTP server for production. Inbound mail arrives through a webhook whose documented payload includes in_reply_to, references, and the full headers, and reply routing depends on the In-Reply-To and References headers. Use OAuth 2.1 sign-in when a person connects an MCP client interactively, and use a scoped API key when the agent operates its own inbox.

Your agent needs a real inbox, not a workaround through a shared account. When an AI agent replies to a customer inquiry, waits for a verification code, or reads an inbound request that arrived minutes ago, it needs its own email identity with scoped credentials. A custom adapter built for a single project might handle sending. It rarely handles the inbound loop, threading, and credential isolation that production agents require.

An email MCP server solves this by exposing email operations as tools an agent can call through the Model Context Protocol. Instead of writing custom API wrappers for each assistant, you configure an MCP server that handles authentication, tool registration, and the webhook payload transformation between your agent and the email infrastructure.

How email MCP servers enable agent workflows

An email MCP server translates agent tool calls into email API operations and turns inbound webhook events into results the agent can read.

Core architecture of email MCP servers

An email MCP server sits between the MCP client (Claude, Cursor, Codex) and the email infrastructure, translating tool calls into API requests and webhook events. The protocol layer uses JSON-RPC 2.0, which provides the request/response semantics and error handling that tool calling requires.

The data flow follows a specific path: the agent sends a tool call to the MCP server, which authenticates against the email API using a scoped key, which then executes the SMTP or IMAP operation. For inbound messages, the flow reverses: the email server receives the message, parses it, and fires a webhook event that the MCP server transforms into a structured tool result the agent can consume.

This architecture reduces the per-project adapter code you would otherwise write for each agent. Instead of writing custom integration logic for each assistant framework, you configure the MCP server once and the agent discovers available tools through the protocol's standard listing mechanism.

Defining the email MCP server scope

An email MCP server exposes tools for sending, reading, threading, drafting, forwarding, and managing attachments. The send.io implementation provides 160 tools covering email operations, domain management, API key administration, webhook configuration, suppression lists, templates, logs, agent inboxes, automations, and events, per the send.io MCP documentation.

The scope covers more than one-to-one mail. The MCP server also exposes tools to manage contacts, segments, topics, and contact properties, import contacts from CSV, and create, schedule, and send broadcasts, as listed in the send.io MCP documentation. Routing decisions, such as which agent handles which inbound message, remain application-level concerns. For autonomous agent work, the server handles sending a reply, parsing an inbound message, reading an attachment, and checking for a verification code.

Scoping the MCP server to a specific inbox with a dedicated API key prevents a compromised agent credential from accessing your entire email infrastructure. The API layer enforces the key's permissions, not the agent's instructions, so a manipulated prompt can't widen the key's reach.

Why agents require direct mail access

AI agents that interact with external systems need to receive and respond to email without routing through a human account. Password reset flows, two-factor authentication codes, and customer replies to support requests all require the agent to read inbound mail and respond within the same thread.

Building this with a custom adapter means handling SMTP authentication, IMAP polling, threading headers, and webhook verification for each project. An MCP server replaces that with a standardized interface. The agent calls send_emailsend-email with a recipient and body, and the MCP server handles the rest. When a reply arrives, its In-Reply-To and References headers map back to the original conversation. The documented webhook payload carries both as the in_reply_to and references fields.

The alternative, routing through a shared human account, creates audit problems and breaks the agent's ability to operate independently. With direct mail access and scoped credentials, the agent reads inbound replies, sends responses, and completes workflows without a human forwarding messages.

Defining the MCP email tool schema

Each tool's name and input schema define what an agent can send, receive, and read. The server checks every call's arguments against that schema before anything runs.

Implementing SMTP relay for AI agents

SMTP relay provides the outbound path for agent sends. The send.io SMTP server accepts connections on port 587 with STARTTLS. The SMTP password returned at mailbox creation also serves as the API key scoped to sending from that mailbox's domain. It is distinct from any admin-level bearer key. See the send.io SMTP documentation for the credential format.

import smtplib

smtp = smtplib.SMTP('smtp.send.io', 587)
smtp.starttls()
smtp.login('agent@yourdomain.com', 'smtp-password-here')
smtp.sendmail('agent@yourdomain.com', 'user@example.com', message)

The REST API authenticates differently: a POST to /emails with a bearer API key in the Authorization header sends through the same infrastructure, with the added benefit of idempotency keys for retry protection.

An agent inbox's scoped API key, returned by POST /v0/inboxes, is the bearer key for that inbox. For details on the REST API endpoints and request formats, see the send.io API documentation.

Filtering inbound email for AI agents

Inbound email arrives at your verified domain's MX record, gets parsed by the email infrastructure, including attachments, and fires a webhook event to your configured endpoint. The send.io API documentation specifies the inbound payload: email_id, message_id, in_reply_to, references, from, to, subject, date, text, html, headers, attachments, envelope, SPF/DKIM/DMARC authentication results, and spam scoring. Attachments arrive either inline as base64 (up to 2 MB each and 10 MB per message) or as download_url links that expire.

Not every provider delivers the full message to the webhook. Resend's inbound webhook, for example, delivers metadata only and does not include the message body or attachments. Postmark's inbound webhook includes the full body, headers, spam score, and Base64-encoded attachments, as does SendGrid's inbound parse, but neither provides an agent inbox primitive for scoped credential management.

Replies carry the threading headers (In-Reply-To, References) that connect them to original messages. The documented webhook payload exposes them as the in_reply_to and references fields, and the full header set appears in headers. Your webhook handler needs them to route the message to the correct agent conversation.

Mapping inbound threads to agent logic

Threading connects inbound replies to the original outbound message. When your agent sends an email, the message ID gets stored. When a reply arrives, the In-Reply-To header contains that message ID, and the References header contains the full thread history.

function extractConversationId(webhookPayload) {
const inReplyTo = webhookPayload.headers['In-Reply-To'];
const references = webhookPayload.headers['References'] || '';

// Extract message IDs from References header
const messageIds = references.match(/<[^>]+>/g) || [];

// Return the conversation root (first message ID in thread)
return messageIds[0] || inReplyTo;
}

The agent uses this conversation ID to retrieve prior context from its session state and generate an appropriate reply. Without threading headers, the agent cannot connect the reply to the original request, and the workflow breaks.

Managing pending outbound messages

Drafts and scheduled sends use the same API with additional fields. The scheduled_at field schedules a message for future delivery. The Idempotency-Key header prevents duplicate sends when the agent retries a request.

curl -X POST https://api.send.io/emails \
-H "Authorization: Bearer scoped-api-key" \
-H "Idempotency-Key: agent-123-msg-456" \
-H "Content-Type: application/json" \
-d '{
"from": "agent@yourdomain.com",
"to": "user@example.com",
"subject": "Follow-up",
"text": "Checking in on your request.",
"scheduled_at": "2026-11-20T09:00:00Z"
}'

The idempotency key gets stored for 24 hours. A retry with the same key returns the original result instead of sending a duplicate. This matters for agents that might retry a failed send without knowing whether the first attempt succeeded.

Configuring automated message routing

Routing logic lives in your webhook handler. Use the recipient address, subject, and header fields from the documented inbound payload to route to specific agent logic.

app.post('/webhook/inbound', (req, res) => {
const payload = req.body;
const subject = payload.subject.toLowerCase();

if (subject.includes('support')) {
routeToAgent('support-agent', payload);
} else if (subject.includes('sales')) {
routeToAgent('sales-agent', payload);
} else {
routeToAgent('default-agent', payload);
}

res.status(200).send('OK');
});

The routing decision happens in your application, not in the MCP server. The MCP server provides the tools, and your application logic determines which agent handles which message.

Processing binary email attachments

The send.io MCP server documents list-email-attachments and get-email-attachment, which return download URLs for an email's attachments instead of inline content. The inbound webhook payload carries attachments inline as base64 (up to 2 MB each and 10 MB per message) or as expiring download_url links, so fetch attachment content through a download URL rather than decoding large files from the payload. The documentation doesn't say whether a download URL requires an Authorization header, so test that before you deploy. The example below takes a URL returned by get-email-attachment and fetches the file.

import requests

def process_attachment(download_url):
response = requests.get(download_url, timeout=30)
response.raise_for_status()

content = response.content
content_type = response.headers.get('Content-Type', '')

if content_type == 'application/pdf':
return extract_pdf_text(content)
elif content_type.startswith('image/'):
return analyze_image(content)

The agent calls get-email-attachment with the attachment ID to retrieve the download URL, then passes that URL to the function above for analysis. This keeps the webhook handler lightweight while giving the agent access to attachment content when needed.

Authentication flows for MCP email servers

A scoped API key fixes which inbox an agent can reach and what it can do there. The transport you choose determines how that key reaches the server.

Stdio vs HTTP transport mechanics

MCP supports two transport modes: stdio for local development and Streamable HTTP for production. Stdio launches the MCP server as a subprocess and exchanges messages over standard input/output. HTTP hosts the server as a remote service that accepts JSON-RPC messages over HTTP POST.

The send.io hosted MCP server uses Streamable HTTP at the /mcp endpoint, with the same bearer-token authentication as the REST API. A local stdio mode ships via the CLI as sendio mcp serve --tools free-inbox, which lets you test with a free inbox without signing in. That flag exposes a 5-tool subset (free_inbox_create, free_inbox_list, free_inbox_wait_for_email, free_inbox_connectfree_inbox_read, and free_inbox_connect), not the full 160 tool set, so use the hosted HTTP server when an agent needs sending, domains, webhooks, or automations.

For production agents, use HTTP transport. The hosted server runs independently of the client process, and each tool call is logged as an API request. Stdio works for local testing but ties the server to the client's subprocess and lacks the retry logic, rate limiting, and error handling that production workloads require.

Architecting per-agent access keys

Scoped API keys isolate each agent to a specific inbox with specific permissions. When you provision an agent inbox via POST /v0/inboxes, the response includes an inbox-scoped API key that can send from that address and read messages delivered to it.

The key cannot access other inboxes, cannot create new API keys, and cannot modify account settings. A compromised agent credential exposes only that agent's inbox, not your entire email infrastructure.

curl -X POST https://api.send.io/v0/inboxes \
-H "Authorization: Bearer admin-api-key" \
-H "Content-Type: application/json" \
-d '{
"username": "support-agent",
"domain": "yourdomain.com"
}'

The response includes the IMAP/SMTP credentials and the scoped API key. Store the key in your secrets manager because it gets returned only once.

Provisioning OAuth tokens for email MCP

OAuth provides an alternative to API keys for scenarios where the agent acts on behalf of a person rather than as an independent identity. The send.io MCP documentation describes OAuth 2.1 sign-in with PKCE for the hosted MCP server. The client opens send.io in your browser, you pick the team and what the assistant may do, and the connection receives an access token. The documentation doesn't state the token lifetime, so confirm it before you design around expiry; the MCP client handles re-authentication. Approving a connection takes admin access to the team. The send.io documentation does not currently document OAuth support for the REST API, so confirm before implementing an OAuth flow against it.

For most agent workflows, scoped API keys provide simpler management and clearer audit trails. OAuth adds complexity (token refresh, redirect handling, consent screens) that agent developers typically want to avoid. Use OAuth sign-in when a person connects an MCP client interactively, and use a scoped API key when the agent operates its own inbox.

Managing scoped API key rotation

Rotation for standard mailboxes follows a documented flow. The send.io API documentation describes POST /mailboxes/{id}/password under “Reset a mailbox password”: it sets a new IMAP/SMTP password and returns it once, and the old password stops working immediately. For those mailboxes the new password is also the new API key. This flow belongs to mailboxes created through POST /mailboxes, not to agent inboxes provisioned through POST /v0/inboxes, whose inbox-scoped key is a separate credential. The password reset documentation doesn't cover inbox-scoped keys, so confirm how to rotate one before you automate rotation for agent inboxes.

Production checklist:

  • Rotate keys on a schedule that your security policy sets, because the send.io documentation doesn't recommend a rotation interval, and rotate immediately on suspected compromise
  • Store keys in a secrets manager with access logging, and inject them into the client or server process at launch instead of committing them to code or config files
  • Monitor for authentication failures that might indicate a leaked key
  • Test the rotation flow in staging before executing in production
  • Confirm whether the rotation endpoint is idempotent, because the documentation doesn't state it. The documented reset behavior is that the old password stops working immediately and the new password is returned only once, so a duplicated call invalidates the key the first call just issued. Write the new key to your secrets manager before any retry logic can fire.

Configuring isolated agent inboxes for email MCP

Isolation starts at provisioning: each agent inbox is created with its own address and its own inbox-scoped API key.

Programmatic mailbox setup for MCP

Agent inboxes provision via POST /v0/inboxes. Omit the username for a random address, or omit the domain to use the shared agent domain. The response includes IMAP/SMTP credentials and the inbox-scoped API key.

For immediate testing without an account, the instant agent mailbox provides a free, receive-only inbox at a generated address with no API key required. Limits: 100 messages per inbox per day, mail held up to 72 hours, and 5 new inboxes created per network per hour (10 per day).

Configuring inbound email DNS records

Inbound email requires an MX record pointing to the email infrastructure. For a verified domain, add the MX record provided during domain verification. The DNS configuration routes inbound mail to the parsing layer that fires webhook events.

; Replace <inbound-host> with the host shown during domain verification,
; and use the priority shown there (10 below is an example)
MX 10 <inbound-host>.sendiodns.com.

DKIM, SPF, and DMARC records establish sending reputation. The email infrastructure handles the DNS verification process, and you add the records once during domain setup.

Restricting API keys for agent inboxes

Scoped keys carry permission lists that determine what the key can do. An inbox-scoped key can send from that address, read messages delivered to it, and manage its own settings. It cannot access other inboxes, create new keys, or modify account-level settings.

The permission model prevents privilege escalation. Even if an agent's prompt gets manipulated to attempt unauthorized actions, the scoped key cannot execute them. The key's permissions are enforced at the API layer, not by the agent's instructions.

Enforcing agent inbox permissions

Inbox pods group inboxes for isolation. A pod's API key can only see that pod's inboxes, and a pod cannot be deleted while it still holds inboxes. In a multi-tenant setup, that means one tenant's compromised key cannot reach another tenant's inboxes.

The scoped key model works like a keyed entry card: it opens only the inbox it was provisioned for. A compromised agent credential cannot access your primary account, other agent inboxes, or administrative functions.

Configuring MCP for Claude and Cursor

Each MCP client reads its own configuration file, but the server definition follows the same pattern of endpoint, transport, and credentials.

Configuring the email MCP server

Claude Code supports MCP servers through the claude mcp add command or direct configuration file editing. The configuration specifies the server URL, transport type, and authentication credentials.

{
"mcpServers": {
"sendio": {
"command": "sendio",
"args": ["mcp", "serve"],
"env": {
"SENDIO_API_KEY": "scoped-api-key-here"
}
}
}
}

For the hosted HTTP transport, the send.io MCP documentation gives a single command that registers the remote /mcpendpoint with Claude Code:

claude mcp add --transport http sendio https://api.send.io/mcp

The hosted server accepts the same bearer-token authentication as the REST API, and the OAuth 2.1 sign-in described later covers interactive connections. The scoped-api-key-here values in the stdio and Cursor examples are placeholders. Load the real key from your secrets manager when the client launches, and don't commit it to a config file or repository.

Connecting Cursor to email MCP servers

Cursor uses a similar configuration structure in its MCP settings file. The server definition includes the command, arguments, and environment variables.

{
"mcpServers": {
"sendio-email": {
"url": "https://api.send.io/mcp",
"headers": {
"Authorization": "Bearer scoped-api-key-here"
}
}
}
}

The config omits a transport field because Cursor infers the remote transport from the url. Cursor discovers available tools through the MCP protocol's tools/list method, presenting them in the agent's tool palette.

Defining the email MCP server config

The server configuration defines which tools are available and how they map to API operations. A minimal configuration exposes send, read, and thread tools. The name and version values in this example are placeholders for your own server definition.

{
"name": "example-email-server",
"version": "1.0.0",
"tools": [
{
"name": "send-email",
"description": "Send an email from the agent's inbox",
"inputSchema": {
"type": "object",
"properties": {
"to": { "type": "string" },
"subject": { "type": "string" },
"body": { "type": "string" }
}
}
}
]
}

The full implementation exposes 160 tools covering email operations, domain management, webhooks, and automations.

Mapping email actions to MCP tools

Email Action

Tool

Parameters

Return Type

Send message

send-email

Inline html or text, a published template with its variables, or a transactional email by transactional_id. Argument names are snake_case, such as scheduled_at and idempotency_key

The API's JSON answer as one text block (no structuredContent). If the API refuses the call, isError: true with the API's error name and message

Read message

get-email

Identifies one sent email. The MCP reference doesn't list the exact argument name

The API's JSON answer as one text block: the sent email with its status and content

List sent emails

list-emails

Optional filter to the sends of one transactional email. Results arrive newest first

The API's JSON answer as one text block: the list of sent emails, newest first

List attachments

list-email-attachments

Identifies one sent email. The MCP reference doesn't list the exact argument name

Attachment download URLs

Get attachment download URL

get-email-attachment

Identifies one attachment of a sent email. The MCP reference doesn't list the exact argument names

Attachment download URL

The agent discovers these tools through the MCP protocol and calls them with the appropriate parameters. Parameter schemas and return types for the full tool set are documented in the live MCP reference, so confirm the exact signatures there before coding against them. Third-party MCP implementations document return confirmations and email IDs for equivalent send tools.

Inbound webhook loop for send-and-reply workflows

The inbound webhook loop returns replies to the agent with enough context to continue the conversation.

Configuring inbound webhook handlers

The webhook handler receives POST requests with the parsed email payload. Signature verification ensures the request came from the email infrastructure, not a malicious actor.

app.post('/webhook/inbound', express.raw({type: 'application/json'}), (req, res) => {
// Use the signature header name documented in your send.io
// webhook configuration
const signature = req.headers['x-webhook-signature'];
const payload = req.body;

// Verify the signature against the raw request body with the
// algorithm and secret from your send.io webhook configuration
if (!verifyWebhookSignature(payload, signature, webhookSecret)) {
return res.status(401).send('Invalid signature');
}

processInboundEmail(JSON.parse(payload));
res.status(200).send('OK');
});

The handler must respond quickly to avoid timeout retries, so push heavy processing to an asynchronous worker or queue.

Mapping payloads to MCP tool schemas

The webhook payload maps to MCP tool results that the agent consumes. A received message becomes a read_emailstructured result built from the documented payload fields, which your application passes to the agent.

function mapToToolResult(webhookPayload) {
return {
result: {
message_id: webhookPayload.message_id,
from: webhookPayload.from,
to: webhookPayload.to,
subject: webhookPayload.subject,
headers: webhookPayload.headers,
attachments: webhookPayload.attachments
}
};
}

The agent receives this as the result of a tool call or as an event notification, depending on the MCP client configuration.

Mapping inbound emails to conversation IDs

The In-Reply-To and References headers provide the threading information. Extract these to map the inbound message to the correct conversation.

def extract_thread_id(headers):
in_reply_to = headers.get('In-Reply-To', '')
references = headers.get('References', '')

# References contains the full thread history
if references:
# Return the root message ID
return references.split()[0]

return in_reply_to

Store the mapping between message IDs and conversation IDs in your session state. When the agent sends a reply, it includes the appropriate References header to maintain the thread.

Defining inbound webhook event triggers

Event Type

Trigger Condition

Payload Contents

email.received

New inbound message

{type, created_at, data} envelope. Capped at 256 KB: for larger mail, body fields are omitted and flagged in bodies_omitted

email.replied

Reply received in an existing thread

{type, created_at, data} envelope

email.bounced

Delivery failure

Bounce details, diagnostic code

email.complained

Spam complaint

Complaint details, feedback loop

The send.io API documentation specifies the event payload shape as {type, created_at, data}. Received-mail events such as email.received and message.received cap at 256 KB. For larger mail, the body fields are omitted and flagged in bodies_omitted. Inbound routes deliver the full sendio inbound payload format described earlier.

The agent subscribes to relevant events through the MCP server configuration. Not all events require agent action. Bounces and complaints might route to monitoring rather than agent logic.

Managing session state across turns

Long-running email threads require session state that persists across agent turns. Store the conversation history, participant addresses, and context in a database keyed by conversation ID.

The MCP server does not manage this state. MCP tool calls are JSON-RPC request/response exchanges, so each call carries its own arguments and the tools only send and receive mail. Your application maintains the conversation context, retrieving it when a reply arrives and providing it to the agent as context for generating the next response.

When a reply arrives, look up the conversation record by the ID you derived from the threading headers. Then load the stored history and pass it to the model as context for the next turn. Cap the history you load and set a turn budget, so a long thread can't inflate the context window or run the agent loop past its limit.

Troubleshooting mailbox connectivity failures

Common failure modes in an email MCP setup fall into five groups:

  • Connection drops between the MCP client and server
  • Expired or revoked credentials
  • Tool call timeouts
  • Webhook delivery errors
  • Broken threading, where a reply starts a new conversation

Resolving MCP connection drops

Connection drops between the MCP client and server typically indicate network issues, server restarts, or timeout misconfiguration. The MCP client should implement reconnection logic with exponential backoff.

For HTTP transport, check that the server endpoint responds to a simple health check before attempting tool calls. A 503 or connection refused indicates the server is unavailable, and a 401 indicates authentication failure.

Resolving authentication timeout failures

Authentication timeouts usually indicate expired credentials or clock skew. Verify that the scoped API key is valid and has not been revoked. Check that the system clock is synchronized, because OAuth tokens and JWT validation are time-sensitive.

A common starting point is to retry with exponential backoff: wait 1 second, then 2, then 4, up to a maximum of 30 seconds. After 5 failed attempts, alert on-call and pause the agent to prevent credential lockout. These values are suggested defaults, not send.io-documented limits, so tune them to your workload.

Configuring timeout limits for tool calls

Tool calls should have explicit timeouts to prevent runaway agent loops. Set a tighter bound on send operations than on reads, since a hung send should fail fast while a read returning a large attachment may take longer to complete.

const result = await Promise.race([
mcpClient.callTool('send-email', params),
new Promise((_, reject) =>
setTimeout(() => reject(new Error('Timeout')), toolCallTimeoutMs)
)
]);

The turn budget (maximum tool calls per conversation turn) prevents infinite loops. Set the limit based on expected workflow complexity: a simple send-and-reply flow needs only a few calls, while multi-step triage with attachment processing needs more headroom.

Handling inbound email webhook errors

The send.io API documentation specifies the retry policy for inbound route deliveries to a forward_url. Deliveries use the webhook delivery system: any HTTP 2xx response counts as success, and failures are retried with backoff for 8 attempts over about 28 hours. Each delivery has a stable svix-id, and the API includes endpoints that list the attempts for each delivery. Because an unhealthy endpoint can receive the same event more than once within that window, make the handler correct under repeated delivery.

Implement idempotency in your handler: the same message might be delivered multiple times during retries. Use the message ID to detect duplicates.

For persistent failures, route to a dead-letter queue for manual inspection. Do not let failed webhooks silently drop, because they represent messages the agent never processed.

Debugging email threading logic

Threading bugs typically manifest as replies that start new threads instead of continuing existing ones. Verify that the References header includes the full thread history, not just the immediate parent.

Check that your session state correctly maps message IDs to conversation IDs. A missing or incorrect mapping causes the agent to treat a reply as a new request, breaking the workflow context.

Log the threading headers for every inbound message during debugging. The In-Reply-To and References headers should show a clear chain back to the original message.

Provision an agent inbox and connect it to your MCP-compatible assistant with the quickstart guide. Test the inbound routing behavior in the sandbox before committing to an integration.

FAQs

Can an existing email account work with an MCP server?

No. The MCP server requires a dedicated agent inbox with scoped credentials. Using an existing human account breaks the isolation model and creates audit problems. Provision a new inbox for the agent.

How do you handle rate limits on email sending?

The send.io API documentation documents the sending limits as 429 responses. A rate_limit_exceeded error means you sent more than 10 requests per second per team. A daily_quota_exceeded error means you hit the daily quota: the limit that applies before your first credit purchase, or 5,000 emails per day for the first 7 days after a new paid account's first purchase, resetting at 00:00 UTC. The API also returns subaccount daily and monthly quota errors, and free mailboxes have a daily sending limit. Design the agent to handle 429 responses by backing off exponentially, and for high-volume scenarios, consider distributing sends across multiple inboxes only after you confirm that these limits allow it.

What happens if the webhook endpoint is unreachable?

The send.io API reference documents the retry behavior: failed deliveries are retried with backoff for 8 attempts over about 28 hours, and any HTTP 2xx response counts as success. Each delivery carries a stable svix-id, and the API lists the attempts for each delivery. Give events that exhaust all 8 attempts a dead-letter path so they are not silently dropped. Monitor your endpoint health and set up alerts for repeated failures.

How do you test inbound email handling locally?

Use the send.io CLI's listen command to forward signed test webhook events to a local endpoint. This provides the full payload structure without requiring a public URL. The instant agent mailbox also supports WebSocket, long-polling, and wait-for-one receive modes.

Can multiple agents share the same inbox?

Technically yes, but not recommended. Each agent should have its own inbox for isolation, auditability, and credential scoping. Shared inboxes make it impossible to attribute actions to specific agents and complicate key rotation.

Key terms glossary

MCP (Model Context Protocol): an open protocol for connecting AI assistants to external data sources and tools, using JSON-RPC 2.0 over stdio or HTTP transport.

Tool calling: the mechanism by which an AI agent invokes external functions through the MCP protocol, with defined input schemas and return types.

Scoped API key: an API key with restricted permissions, limited to specific resources or operations. For agent inboxes, the key can only access that inbox's messages and settings.

Inbound webhook: an HTTP callback that delivers parsed email content to your application when a message arrives at a monitored address.

MX record: a DNS record that specifies the mail server responsible for accepting email on behalf of a domain.

Idempotency key: a client-generated identifier that ensures a request is processed exactly once, even if retried. Stored for 24 hours.

Agent inbox: a dedicated email address provisioned for an AI agent, with scoped credentials and independent sending/receiving capability.

Session state: the persistent context maintained across multiple agent turns, including conversation history, participant addresses, and workflow progress.