Email Infrastructure for MetaGPT Agent Teams

Give MetaGPT's role-based agents the ability to send, read, and manage email — with oversight modes that keep external communications within approved boundaries.


MetaGPT assigns different GPT roles — product manager, architect, engineer — to form a collaborative software company. When these role-based agents need to communicate with external stakeholders via email, MultiMail provides the infrastructure with built-in safety controls.

By integrating MultiMail into MetaGPT's action system, any role can send emails, check inboxes, and manage threads. The default gated_send mode ensures that agent-composed emails are reviewed by a human before delivery, critical when multiple agents may independently decide to reach out to external contacts.

Integration works through MetaGPT's custom Action class. Define email actions that call the MultiMail REST API, then assign them to the roles that need email capabilities.

Built for MetaGPT developers

Role-Aware Email Permissions

Different MetaGPT roles can have different email capabilities. A project manager role might send status updates while an engineer role only reads support tickets. MultiMail's per-mailbox oversight modes enable this granular control.

Oversight for Multi-Agent Coordination

When multiple MetaGPT roles can trigger emails, coordination failures can lead to duplicate or contradictory messages. MultiMail's gated_send mode creates a review queue where a human can catch and resolve conflicts before delivery.

Structured Communication Workflows

MetaGPT follows Standard Operating Procedures (SOPs). MultiMail's thread tracking and contact management integrate naturally into SOP-driven workflows, maintaining structured communication records.

Audit Trail Across Roles

MultiMail logs which role and action triggered each email, providing a cross-role audit trail. This helps trace communication decisions back to the specific agent and reasoning step that initiated them.


Try it with your agent

No code, no dashboard. Paste this to your AI agent — it connects MultiMail, creates an inbox, and builds the flow for you.

1. Read https://multimail.dev/llms.txt first. Use only the MultiMail MCP server instructions documented there to connect MultiMail, then use the connected MCP tools to create a free inbox, set the mailbox oversight mode to gated_send, and set up a verified sending domain. 2. In this MetaGPT project, wire MultiMail through MetaGPT’s real extension points: create registered tools with MetaGPT’s register_tool mechanism, import those tools so they are registered, and pass their tool names into the MetaGPT DataInterpreter role or another Role that is configured to use those tools. 3. Add three registered MetaGPT tools backed only by the connected MultiMail MCP tools: one to check the inbox, one to draft a reply for operator review, and one to send email. Keep sending, composing, and scheduling inside MultiMail’s MCP capabilities; do not add raw HTTP calls or undocumented endpoints. 4. Run the MetaGPT role with a test task: check the new inbox, draft a short reply, and send a test email from the verified sender to my operator email address with a clear subject saying it is a MultiMail MetaGPT test. 5. Before the send tool is allowed to complete, confirm the mailbox is still in gated_send. The test email must pause for developer review and approval before delivery; do not switch to monitored or autonomous unless I explicitly ask.

Step by step

1

Create a MultiMail Account and API Key

Sign up at multimail.dev, create a mailbox, and generate an API key from your dashboard. Your key will start with mm_live_.

2

Install Dependencies

Install MetaGPT and the HTTP library for calling the MultiMail API.

3

Define Email Action Classes

Create MetaGPT Action subclasses that wrap MultiMail API endpoints. At minimum, define SendEmail and CheckInbox actions.

4

Assign Actions to Roles

Create a Role subclass that uses your email actions. Set constraints in the role definition to explain the oversight mode and communication guidelines.

5

Approve Pending Emails

Monitor the MultiMail dashboard for pending emails generated by your MetaGPT roles. Review and approve each message before it is delivered.


Common questions

Can different MetaGPT roles have different email permissions?
Yes. Create separate mailboxes in MultiMail with different oversight modes and assign them to different roles. A manager role might use a mailbox in monitored mode while a junior role uses gated_all. Each role's Action receives the appropriate mailbox_id.
How do I prevent duplicate emails from multiple roles?
MultiMail's gated_send mode creates a review queue where you can spot duplicates before delivery. Additionally, structure your MetaGPT SOPs so that only one designated role (like a CommunicationsManager) handles outbound email, receiving instructions from other roles via internal messages.
Can MetaGPT roles share email thread context?
Yes. Use MultiMail's get_thread endpoint to retrieve full conversation history. Pass thread data through MetaGPT's internal message system so any role processing an email thread has access to the complete conversation context.
What happens if my MetaGPT team runs out of email quota?
MultiMail returns a 429 status when plan limits are reached. Your Action classes should handle this gracefully by notifying the team that email capacity is exhausted. Plan limits range from 200 emails/month (free) to 150,000 (Scale plan).

Explore more

The only agent email with a verifiable sender

Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a hosted MCP server. Formally verified in Lean 4.