Skip to content

Email for professionals and teams

3.9 KB
Raw Blame

Email assistant and MCP

Configure the AI provider in Admin → Agent. Mailflare supports Cloudflare Workers AI and OpenAI-compatible providers. You can configure multiple models, then choose a model for each mailbox in the assistant's Settings view. Assistant chat is available by default once a provider is configured; an admin can turn it off in Admin → Agent. The assistant works within the selected mailbox. Mailbox managers can set writing instructions, a draft reviewer, and a daily auto-draft limit. Automatic reply drafts are off until enabled for that mailbox, and a person must review a draft before sending it. Admin → Agent → View Usage shows AI request totals, estimated spend, daily usage, and a paginated activity log.

The list_emails tool uses cursor pagination: omit cursor or set it to null for the first page, then pass the exact nextCursor returned by the previous page for the same mailbox and folder. A null nextCursor means there are no more pages. Cursors are message IDs, not page numbers or offsets; an invalid or inaccessible cursor returns retry guidance rather than restarting pagination silently.

You can follow up on an assistant draft in chat. The assistant can revise its body, subject, sender, recipients, and send time, copy an attachment from an email in the selected mailbox, or remove a draft attachment. It reads the latest draft revision before editing. A requested send time does not queue delivery on its own: the assistant creates a review link, and the user confirms the exact draft and time in Mailflare. The composer can also edit an assistant draft, add local files, and request the same review. Apply the latest database migration before using scheduled assistant drafts.

While the assistant is responding, you can enter more messages. They appear in a queue above the prompt and run in order after the current response. You can edit or remove a queued message, or choose Steer to stop the current response and send that queued message next. Switching chats or closing the assistant clears the local queue.

To connect an external AI client, create a key in Settings → API keys and enable Allow MCP access. Choose the permitted mailboxes and mail tools. After creation, copy the key or the ready-made AI agent instructions; the key is shown only once. Connect the client to https://<your-mailflare-origin>/mcp using Streamable HTTP and Authorization: Bearer <key>. Mail MCP access is limited to the selected mailboxes and the key owner's current permissions. An alias shares its parent mailbox, so selecting that mailbox also includes mail delivered to its aliases. The MCP request_send tool creates a review request; sending still requires confirmation in Mailflare. MCP mail tools do not require an AI provider.

MCP clients can use update_draft for the same draft fields and attachments, then request_send to create a human review for immediate or scheduled delivery. Attachment additions copy an existing file from an email in the key's permitted mailbox; local files are added through the composer.

Calendar access uses separate Read calendar and Manage calendar MCP permissions. The personal calendar exposes get_calendars, get_schedule, search_events, get_event, find_free_time, create_event, update_events, and delete_events. Calendar-only keys need no mailbox selection. Calendar writes save immediately. Event updates and deletes use series IDs and affect the entire recurring series; these tools record attendees but do not send invitations or cancellations. Supply absolute ISO 8601 times with offsets. Schedule and availability ranges are limited to 90 days.

For management tools, create a separate MCP key in Admin → API keys. Its selected domain, account, and mailbox management permissions do not grant access to mail content. This page also provides copyable AI agent instructions after key creation.