Reference

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

mailbox.create

Provision a new agent mailbox. Returns a mailbox ID and ingest address for email forwarding.

ParamTypeDescription
addressstring requiredEmail address the agent will send/receive as, e.g. ops@acme.com
display_namestring optionalFriendly name shown in From header
approval_modestring optionalall (default) | smart | none. Controls outbound review.
// Returns
{
  id: "mbx_a8Kq7fR2xZ",
  address: "ops@acme.com",
  ingest_address: "mbx_a8Kq7fR2xZ@ingest.mcpmail.app",
  status: "active"
}
mailbox.list

List all mailboxes on your account.

mailbox.list()
// Returns { mailboxes: [{ id, address, display_name, status, approval_mode }] }
mailbox.update

Update mailbox settings — display name, approval mode, auto-approve rules.

ParamTypeDescription
idstring requiredMailbox ID
display_namestring optionalUpdated display name
approval_modestring optionalall | smart | none
auto_approve_rulesarray optionalRules for auto-approving outbound. See Approval Queue.
mailbox.delete

Delete a mailbox and all stored messages. This action is irreversible.

ParamTypeDescription
idstring requiredMailbox ID to delete

Domain management

domain.verify

Start domain verification. Returns DNS records to add for SPF and DKIM.

ParamTypeDescription
domainstring requiredDomain 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" }
  ]
}
domain.status

Check DNS verification status for a domain.

ParamTypeDescription
domainstring requiredDomain to check
// Returns
{ domain: "acme.com", status: "verified",
  spf: "pass", dkim: "pass", dmarc: "pass" }

Mail operations

mail.send

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.

ParamTypeDescription
mailboxstring requiredMailbox ID
tostring | string[] requiredRecipient address(es)
subjectstring requiredEmail subject
bodystring requiredPlain text body
htmlstring optionalHTML body (sent alongside text)
ccstring[] optionalCC recipients
bccstring[] optionalBCC recipients
reply_tostring optionalReply-to thread (message ID)
attachmentsarray optionalFile attachments: [{ name, content_type, data }]
headersobject optionalCustom email headers
// Returns
{ id: "msg_xK2mN...", status: "queued",
  queue_position: 3 }
// or with approval_mode: "none"
{ id: "msg_xK2mN...", status: "sent" }
mail.list

List messages in a mailbox with filtering and pagination.

ParamTypeDescription
mailboxstring requiredMailbox ID
directionstring optionalinbound | outbound | all (default)
unreadboolean optionalFilter to unread only
fromstring optionalFilter by sender address
sincestring optionalISO date or relative: 24h, 7d
limitnumber optionalMax results (default 20, max 100)
cursorstring optionalPagination cursor
mail.get

Get a single message with full body and parsed attachments.

ParamTypeDescription
idstring requiredMessage 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"
}
mail.wait

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.

ParamTypeDescription
mailboxstring requiredMailbox ID to watch
fromstring optionalMatch sender address (exact or glob)
subject_containsstring optionalMatch subject substring
thread_idstring optionalMatch thread
timeoutstring requiredMax 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
}
mail.wait is not polling. The server holds the connection and pushes the message when it arrives. Your agent's context is preserved — it resumes exactly where it left off.
mail.archive

Archive a message. Archived messages are retained but excluded from mail.list by default.

ParamTypeDescription
idstring requiredMessage ID
mail.parse_attachments

Parse attachments from a message into structured data. PDFs are extracted to text, CSVs are parsed to JSON arrays, images are OCR'd.

ParamTypeDescription
idstring requiredMessage ID

Approval queue

queue.list

List messages pending approval.

ParamTypeDescription
mailboxstring optionalFilter by mailbox
statusstring optionalpending | approved | rejected | all
queue.approve

Approve a queued message for sending. Optionally edit the message before it goes out.

ParamTypeDescription
message_idstring requiredMessage ID in queue
editsobject optionalOverride body, subject, or recipients before sending
queue.reject

Reject a queued message. It will not be sent.

ParamTypeDescription
message_idstring requiredMessage ID to reject
reasonstring optionalReason for rejection (stored for agent learning)

Threads

thread.list

List conversation threads in a mailbox.

ParamTypeDescription
mailboxstring requiredMailbox ID
participantstring optionalFilter by participant address
sincestring optionalThreads with activity since
thread.get

Get all messages in a thread, in chronological order.

ParamTypeDescription
idstring requiredThread ID

Contacts

contact.create

Add a contact to a named list. Used for auto-approve rules and recipient management.

ParamTypeDescription
emailstring requiredContact email address
namestring optionalContact name
liststring optionalNamed list, e.g. approved_vendors
metadataobject optionalArbitrary metadata
contact.search

Search contacts by email, name, or list.

Webhooks

webhook.register

Register a URL to receive real-time event notifications.

ParamTypeDescription
urlstring requiredWebhook endpoint URL
eventsstring[] requiredEvent types: message.received, message.sent, message.bounced, queue.pending
mailboxstring optionalScope to a specific mailbox