MAILGENT
Integrations

Claude Code

Connect Mailgent to Claude Code

Add Mailgent as an MCP server in Claude Code to give it email, vault, 2FA, calendar, and identity capabilities.

Setup

claude mcp add mailgent --scope user --transport stdio -e MAILGENT_API_KEY=loid-your-api-key -- npx -y @mailgent/mcp

Manual config

Add to ~/.claude.json (global) or .claude/settings.json (project):

{
  "mcpServers": {
    "mailgent": {
      "command": "npx",
      "args": ["-y", "@mailgent/mcp"],
      "env": {
        "MAILGENT_API_KEY": "loid-your-api-key"
      }
    }
  }
}

Restart Claude Code after adding.

Verify

Run /mcp to check the connection status, then ask:

"Who am I?"

Claude will call identity.whoami and return your agent's name, email, and scopes.

Available tools

CategoryTools
Identityidentity.whoami, identity.sign, identity.verify
Mailmail.send, mail.reply, mail.list_messages, mail.get_message, mail.get_attachment, mail.list_threads, mail.get_thread, mail.update_labels, mail.update_thread_labels, mail.delete_message, mail.delete_thread
Vaultvault.list, vault.get, vault.store, vault.delete, vault.totp
Calendarcalendar.create, calendar.update, calendar.list, calendar.get, calendar.delete, calendar.set_public

Tools only appear if your identity has the required scopes.

Usage examples

> Send an email to john@acme.com about the Q4 report
> Check my inbox for unread emails
> Reply to the latest email from Sarah
> Store my Stripe API key in the vault
> Get the TOTP code for my AWS account
> Create a calendar event for tomorrow at 2pm

Multiple inboxes

claude mcp add mailgent-sales --scope user --transport stdio -e MAILGENT_API_KEY=loid-sales-key -- npx -y @mailgent/mcp
claude mcp add mailgent-support --scope user --transport stdio -e MAILGENT_API_KEY=loid-support-key -- npx -y @mailgent/mcp

Or in config:

{
  "mcpServers": {
    "mailgent-sales": {
      "command": "npx",
      "args": ["-y", "@mailgent/mcp"],
      "env": { "MAILGENT_API_KEY": "loid-sales-key" }
    },
    "mailgent-support": {
      "command": "npx",
      "args": ["-y", "@mailgent/mcp"],
      "env": { "MAILGENT_API_KEY": "loid-support-key" }
    }
  }
}

Claude will see mailgent-sales:mail.send and mailgent-support:mail.send as separate tools.

Platform mode

Use a platform key (lopk-) to manage all identities in your org:

claude mcp add mailgent-platform --scope user --transport stdio -e MAILGENT_API_KEY=lopk-your-platform-key -- npx -y @mailgent/mcp

This exposes identities.list, identities.create, identities.delete, identities.rotate_key, and identities.update_scopes.

Remove

claude mcp remove mailgent

On this page