Connect MultiMail to Emacs for AI Email

Add email capabilities to Emacs through MCP. Integrate MultiMail with gptel or ellm for AI-assisted email within your Emacs workflow.


Emacs users can integrate MultiMail's MCP server through packages like mcp.el, bringing AI-powered email tools into the Emacs ecosystem. Combined with AI packages like gptel or ellm, you get a fully Emacs-native AI assistant that can send emails, manage inboxes, and handle contacts.

Configuration is done in Emacs Lisp within your init.el file. The mcp.el package handles the stdio transport protocol, connecting to the MultiMail MCP server and making its tools available to your AI assistant package. This fits naturally into the Emacs tradition of extending the editor to handle every task.

For Emacs users who already manage email through mu4e, notmuch, or Gnus, MultiMail adds a complementary AI agent layer. Your agent gets its own mailbox with oversight controls, separate from your personal email, letting AI handle operational email while your existing Emacs mail setup remains untouched.

Get started

1

Get your MultiMail API key

Sign up at multimail.dev and create an API key from your dashboard. This key authenticates all MCP server requests.

2

Install mcp.el

Install the mcp.el package via your preferred package manager (use-package, straight.el, or package.el). This provides the MCP client protocol implementation for Emacs.

3

Install an AI assistant package

Install gptel, ellm, or another Emacs AI package that supports tool use. This provides the conversational interface for interacting with MCP tools.

4

Configure MultiMail in init.el

Add the MultiMail MCP server configuration to your Emacs init file.

json
(use-package mcp
  :config
  (mcp-add-server "multimail"
    :command "npx"
    :args '("-y" "@multimail/mcp-server")
    :env '(("MULTIMAIL_API_KEY" . "mm_live_your_key_here"))))
5

Create an agent mailbox

In the MultiMail dashboard, create a mailbox for your Emacs AI assistant. Start with gated_send oversight mode so outbound emails require your approval.

6

Verify the connection

Start a conversation with your AI assistant and ask it to list your MultiMail mailboxes. You can also check the *mcp* buffer for connection status and debug output.


Available MCP tools

ToolDescriptionExample
send_emailSend an email from your agent mailbox to any recipient.Send meeting notes captured in org-mode to all attendees.
reply_emailReply to a received email, maintaining the thread context.Reply to a patch review email with your analysis from the code buffer.
check_inboxCheck a mailbox for new or unread messages.Check for new emails during a break from your editing session.
read_emailRead the full content of a specific email including headers and body.Read a task assignment email before creating org-mode TODOs from it.
create_mailboxCreate a new agent mailbox on your MultiMail account.Create a mailbox for automated org-mode report distribution.
list_mailboxesList all mailboxes on your MultiMail account.View available mailboxes before choosing a sender address.
get_threadRetrieve an entire email thread to see the full conversation history.Review a project discussion thread before drafting a response.
search_contactsSearch your contact list by name, email, or tags.Find a colleague's email to send them an exported org-mode document.
add_contactAdd a new contact to your MultiMail contact list.Save a new collaborator's email from a received message.
tag_emailTag or categorize an email for organization and filtering.Tag emails by project name, matching your org-mode project structure.
list_pendingList all emails currently awaiting human approval.Review pending outbound emails before approving them.
decide_emailApprove or reject a pending email in the oversight queue.Approve a weekly report email after verifying the content.

Usage examples

Emacs mcp.el configuration
elisp
(use-package mcp
  :config
  (mcp-add-server "multimail"
    :command "npx"
    :args '("-y" "@multimail/mcp-server")
    :env '(("MULTIMAIL_API_KEY" . "mm_live_your_key_here"))))

Add this to your init.el to configure MultiMail with mcp.el.

Environment variable approach
elisp
(use-package mcp
  :config
  (mcp-add-server "multimail"
    :command "npx"
    :args '("-y" "@multimail/mcp-server")
    :env `(("MULTIMAIL_API_KEY" . ,(getenv "MULTIMAIL_API_KEY")))))

Use an environment variable instead of hardcoding the API key.

Org-mode to email workflow
text
Take the meeting notes from the current org-mode buffer, format them as a clean email summary with action items highlighted, and send it to [email protected] with the subject 'Meeting Notes - Sprint Planning'.

Ask the AI assistant to convert org-mode content into an email.

gptel with MCP tools
elisp
(use-package gptel
  :config
  (setq gptel-tools (mcp-get-tools "multimail")))

Configure gptel to use MCP tools for email operations.


Best practices

Keep your API key in auth-sources

Emacs has a built-in secrets management system via auth-sources. Store your MultiMail API key in ~/.authinfo.gpg and retrieve it with (auth-source-pick-first-password :host "multimail.dev") instead of hardcoding it in init.el.

Complement existing Emacs email clients

If you already use mu4e, notmuch, or Gnus for personal email, MultiMail adds a separate AI-operated mailbox. Your agent handles operational email (notifications, automated replies) while your existing setup handles personal correspondence.

Use org-mode integration

Emacs excels at org-mode. Ask your AI assistant to read emails and create org-mode TODO items, or convert org-mode meeting notes into formatted emails. The combination of structured org-mode content and MultiMail's email tools is powerful.

Check the *mcp* buffer for debugging

If the MCP server fails to connect, check the *mcp* buffer in Emacs for error messages and debug output. This buffer shows the raw stdio communication, making it easy to diagnose configuration issues.


Common questions

Which Emacs packages do I need for MCP support?
You need mcp.el (or a similar MCP client package) for the protocol layer, and an AI assistant package like gptel or ellm for the conversational interface. mcp.el handles connecting to MCP servers via stdio, while the AI package provides the chat interface where you interact with the tools.
Does this replace mu4e or notmuch for email?
No, MultiMail serves a different purpose. It provides AI agent mailboxes with oversight controls, designed for automated email operations. Your existing mu4e or notmuch setup handles your personal email. MultiMail adds a complementary layer where AI agents can send and receive email on your behalf with configurable human approval.
Can I use this with org-mode?
Yes, and the combination is powerful. You can ask your AI assistant to read emails and create org-mode tasks, or take org-mode content and send it via email. For example, convert meeting notes into an email summary, or turn incoming feature requests into org-mode TODO items with deadlines.
How do I keep my API key secure?
Use Emacs' auth-sources system to store your key in ~/.authinfo.gpg (GPG-encrypted). Retrieve it in your config with (auth-source-pick-first-password :host "multimail.dev"). This keeps the key out of your init.el, which is especially important if you share your dotfiles.
Does mcp.el work with Emacs daemon mode?
Yes, mcp.el works with Emacs running as a daemon. The MCP server process is started when mcp.el initializes, and it persists as long as the Emacs daemon is running. If you restart the daemon, the MCP server will be restarted on the next initialization.

More MCP clients

The only agent email with a verifiable sender

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