MailgentMailgent
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:

ToolInbox
mailgent-sales:mail.sendsales-a8k2m@mailgent.dev
mailgent-sales:mail.list_messagessales-a8k2m@mailgent.dev
mailgent-support:mail.sendsupport-f3x9w@mailgent.dev
mailgent-support:mail.list_messagessupport-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.dev

When the agent needs to check support inbox:

Agent uses mailgent-support:mail.list_messages → reads support-f3x9w@mailgent.dev

Security

Each identity is fully isolated:

  • mailgent-sales API key cannot read mailgent-support messages
  • Each key has its own scopes — sales might have mail:send + mail:read, while support might only have mail:read
  • Usage is tracked per identity

When to Use Multiple Identities

ScenarioSetup
Single-purpose agent (e.g., order notifications)1 identity
Agent handling sales + support2 identities
Multi-department agent1 identity per department
Separate read-only monitor + reply agent2 identities with different scopes

On this page