MCP
Multiple Identities
Give your agent access to multiple email inboxes
A single agent can manage multiple inboxes by configuring multiple MCP server connections — one per identity.
Configuration
Each identity gets its own named MCP server:
{
"mcpServers": {
"mailgent-sales": {
"url": "https://api.mailgent.dev/mcp",
"headers": {
"Authorization": "Bearer mgent-sales-api-key"
}
},
"mailgent-support": {
"url": "https://api.mailgent.dev/mcp",
"headers": {
"Authorization": "Bearer mgent-support-api-key"
}
}
}
}How It Works
Each MCP server instance exposes the same mail.* tools, but namespaced by the server name:
| Tool | Inbox |
|---|---|
mailgent-sales:mail.send | sales-a8k2m@mailgent.dev |
mailgent-sales:mail.list_messages | sales-a8k2m@mailgent.dev |
mailgent-support:mail.send | support-f3x9w@mailgent.dev |
mailgent-support:mail.list_messages | support-f3x9w@mailgent.dev |
The agent sees all tools and can use the right one based on context.
Agent Behavior
When the agent needs to send from sales:
Agent uses mailgent-sales:mail.send → sends from sales-a8k2m@mailgent.devWhen the agent needs to check support inbox:
Agent uses mailgent-support:mail.list_messages → reads support-f3x9w@mailgent.devSecurity
Each identity is fully isolated:
mailgent-salesAPI key cannot readmailgent-supportmessages- Each key has its own scopes — sales might have
mail:send+mail:read, while support might only havemail:read - Usage is tracked per identity
When to Use Multiple Identities
| Scenario | Setup |
|---|---|
| Single-purpose agent (e.g., order notifications) | 1 identity |
| Agent handling sales + support | 2 identities |
| Multi-department agent | 1 identity per department |
| Separate read-only monitor + reply agent | 2 identities with different scopes |