MCP tools
MCPMail exposes these tools via the Model Context Protocol. Your agent calls them like any other MCP tool — no SDK, no client library, no REST API to learn.
Mailbox management
Provision a new agent mailbox. Returns a mailbox ID and ingest address for email forwarding.
| Param | Type | Description |
|---|---|---|
| address | string required | Email address the agent will send/receive as, e.g. ops@acme.com |
| display_name | string optional | Friendly name shown in From header |
| approval_mode | string optional | all (default) | smart | none. Controls outbound review. |
// Returns
{
id: "mbx_a8Kq7fR2xZ",
address: "ops@acme.com",
ingest_address: "mbx_a8Kq7fR2xZ@ingest.mcpmail.app",
status: "active"
}
List all mailboxes on your account.
mailbox.list()
// Returns { mailboxes: [{ id, address, display_name, status, approval_mode }] }
Update mailbox settings — display name, approval mode, auto-approve rules.
| Param | Type | Description |
|---|---|---|
| id | string required | Mailbox ID |
| display_name | string optional | Updated display name |
| approval_mode | string optional | all | smart | none |
| auto_approve_rules | array optional | Rules for auto-approving outbound. See Approval Queue. |
Delete a mailbox and all stored messages. This action is irreversible.
| Param | Type | Description |
|---|---|---|
| id | string required | Mailbox ID to delete |
Domain management
Start domain verification. Returns DNS records to add for SPF and DKIM.
| Param | Type | Description |
|---|---|---|
| domain | string required | Domain to verify, e.g. acme.com |
// Returns
{
domain: "acme.com",
status: "pending",
dns_records: [
{ type: "TXT", name: "@", value: "v=spf1 include:mcpmail.app ~all" },
{ type: "CNAME", name: "mcpm1._domainkey", value: "dkim1.mcpmail.app" },
{ type: "CNAME", name: "mcpm2._domainkey", value: "dkim2.mcpmail.app" },
{ type: "CNAME", name: "mcpm3._domainkey", value: "dkim3.mcpmail.app" }
]
}
Check DNS verification status for a domain.
| Param | Type | Description |
|---|---|---|
| domain | string required | Domain to check |
// Returns
{ domain: "acme.com", status: "verified",
spf: "pass", dkim: "pass", dmarc: "pass" }
Mail operations
Send an email from a mailbox. If approval_mode is all or smart, the message enters the approval queue before sending. Returns a message ID and queue status.
| Param | Type | Description |
|---|---|---|
| mailbox | string required | Mailbox ID |
| to | string | string[] required | Recipient address(es) |
| subject | string required | Email subject |
| body | string required | Plain text body |
| html | string optional | HTML body (sent alongside text) |
| cc | string[] optional | CC recipients |
| bcc | string[] optional | BCC recipients |
| reply_to | string optional | Reply-to thread (message ID) |
| attachments | array optional | File attachments: [{ name, content_type, data }] |
| headers | object optional | Custom email headers |
// Returns
{ id: "msg_xK2mN...", status: "queued",
queue_position: 3 }
// or with approval_mode: "none"
{ id: "msg_xK2mN...", status: "sent" }
List messages in a mailbox with filtering and pagination.
| Param | Type | Description |
|---|---|---|
| mailbox | string required | Mailbox ID |
| direction | string optional | inbound | outbound | all (default) |
| unread | boolean optional | Filter to unread only |
| from | string optional | Filter by sender address |
| since | string optional | ISO date or relative: 24h, 7d |
| limit | number optional | Max results (default 20, max 100) |
| cursor | string optional | Pagination cursor |
Get a single message with full body and parsed attachments.
| Param | Type | Description |
|---|---|---|
| id | string required | Message ID |
// Returns
{
id: "msg_...",
from: "vendor@acme.com",
to: "ops@your-company.com",
subject: "RE: PO #4821",
body: "Confirmed. Shipping Friday.",
html: "...",
thread_id: "thr_...",
attachments: [{
name: "invoice.pdf",
content_type: "application/pdf",
size: 48210,
parsed: { text: "Invoice #9102..." }
}],
received_at: "2026-04-17T14:30:00Z"
}
Block until a matching message arrives or timeout expires. This is the key primitive — it turns email into a synchronous step in an agent workflow.
| Param | Type | Description |
|---|---|---|
| mailbox | string required | Mailbox ID to watch |
| from | string optional | Match sender address (exact or glob) |
| subject_contains | string optional | Match subject substring |
| thread_id | string optional | Match thread |
| timeout | string required | Max wait: 1h, 24h, 7d, etc. Max 7 days. |
// Blocks until match or timeout
const reply = await mail.wait({
mailbox: "mbx_ops",
from: "vendor@acme.com",
timeout: "48h"
})
if (reply.timed_out) {
// No reply within 48h — send a follow-up
} else {
// reply.body, reply.attachments, reply.parsed_attachments
}
Archive a message. Archived messages are retained but excluded from mail.list by default.
| Param | Type | Description |
|---|---|---|
| id | string required | Message ID |
Parse attachments from a message into structured data. PDFs are extracted to text, CSVs are parsed to JSON arrays, images are OCR'd.
| Param | Type | Description |
|---|---|---|
| id | string required | Message ID |
Approval queue
List messages pending approval.
| Param | Type | Description |
|---|---|---|
| mailbox | string optional | Filter by mailbox |
| status | string optional | pending | approved | rejected | all |
Approve a queued message for sending. Optionally edit the message before it goes out.
| Param | Type | Description |
|---|---|---|
| message_id | string required | Message ID in queue |
| edits | object optional | Override body, subject, or recipients before sending |
Reject a queued message. It will not be sent.
| Param | Type | Description |
|---|---|---|
| message_id | string required | Message ID to reject |
| reason | string optional | Reason for rejection (stored for agent learning) |
Threads
List conversation threads in a mailbox.
| Param | Type | Description |
|---|---|---|
| mailbox | string required | Mailbox ID |
| participant | string optional | Filter by participant address |
| since | string optional | Threads with activity since |
Get all messages in a thread, in chronological order.
| Param | Type | Description |
|---|---|---|
| id | string required | Thread ID |
Contacts
Add a contact to a named list. Used for auto-approve rules and recipient management.
| Param | Type | Description |
|---|---|---|
| string required | Contact email address | |
| name | string optional | Contact name |
| list | string optional | Named list, e.g. approved_vendors |
| metadata | object optional | Arbitrary metadata |
Search contacts by email, name, or list.
Webhooks
Register a URL to receive real-time event notifications.
| Param | Type | Description |
|---|---|---|
| url | string required | Webhook endpoint URL |
| events | string[] required | Event types: message.received, message.sent, message.bounced, queue.pending |
| mailbox | string optional | Scope to a specific mailbox |