Add email tools to Neovim's AI workflow through mcp.nvim. Fully customizable MCP integration with Lua configuration.
Neovim's extensible architecture makes it possible to integrate MCP servers through community plugins like mcp.nvim. Combined with an AI chat plugin like avante.nvim or codecompanion.nvim, you get a fully terminal-native AI assistant with email capabilities powered by MultiMail.
The setup requires more configuration than GUI-based editors, but the result is a deeply customizable workflow. MCP servers are configured in Lua within your init.lua or a dedicated plugin config file, giving you fine-grained control over how MultiMail's tools are exposed to your AI assistant.
For developers who live in the terminal and prefer Neovim's modal editing, this integration means you never have to leave your editor to handle email. Read bug reports, send deployment updates, and manage contacts — all through your familiar Neovim keybindings and workflow.
Sign up at multimail.dev and create an API key from your dashboard. This key authenticates all MCP server requests.
Add mcp.nvim to your Neovim plugin manager. If using lazy.nvim, add it to your plugin spec. This plugin provides the MCP client infrastructure for Neovim.
Install avante.nvim, codecompanion.nvim, or another AI chat plugin that supports MCP tool use. The AI plugin provides the interface for interacting with MCP tools.
Add the MultiMail MCP server configuration to your Neovim config.
require('mcp').setup({
servers = {
multimail = {
command = 'npx',
args = { '-y', '@multimail/mcp-server' },
env = {
MULTIMAIL_API_KEY = 'mm_live_your_key_here',
},
},
},
})In the MultiMail dashboard, create a mailbox for your Neovim AI assistant. Set oversight to gated_send so outbound emails require approval.
Open your AI chat plugin and ask it to list your mailboxes. You can also run :McpStatus (if available) to check server connectivity.
| Tool | Description | Example |
|---|---|---|
| send_email | Send an email from your agent mailbox to any recipient. | Send a patch summary email after finishing a refactor in Neovim. |
| reply_email | Reply to a received email, maintaining the thread context. | Reply to a mailing list discussion with your code analysis. |
| check_inbox | Check a mailbox for new or unread messages. | Check for new patch review emails between editing sessions. |
| read_email | Read the full content of a specific email including headers and body. | Read a bug report before diving into the relevant source file. |
| create_mailbox | Create a new agent mailbox on your MultiMail account. | Create a mailbox for an open-source project you maintain. |
| list_mailboxes | List all mailboxes on your MultiMail account. | View available mailboxes to pick the right sender. |
| get_thread | Retrieve an entire email thread to see the full conversation history. | Review a full discussion thread on a mailing list. |
| search_contacts | Search your contact list by name, email, or tags. | Find a maintainer's email to send a patch for review. |
| add_contact | Add a new contact to your MultiMail contact list. | Save a contributor's email after they submit their first patch. |
| tag_email | Tag or categorize an email for organization and filtering. | Tag emails by project or component for quick filtering. |
| list_pending | List all emails currently awaiting human approval. | Review pending emails before closing your terminal session. |
| decide_email | Approve or reject a pending email in the oversight queue. | Approve a release announcement email after reviewing content. |
{
'mcp-hub/mcp.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
require('mcp').setup({
servers = {
multimail = {
command = 'npx',
args = { '-y', '@multimail/mcp-server' },
env = {
MULTIMAIL_API_KEY = vim.env.MULTIMAIL_API_KEY or 'mm_live_your_key_here',
},
},
},
})
end,
}Add this to your lazy.nvim plugin spec to configure MultiMail.
-- In your shell profile (.zshrc, .bashrc):
-- export MULTIMAIL_API_KEY='mm_live_your_key_here'
-- In your init.lua:
require('mcp').setup({
servers = {
multimail = {
command = 'npx',
args = { '-y', '@multimail/mcp-server' },
env = {
MULTIMAIL_API_KEY = vim.env.MULTIMAIL_API_KEY,
},
},
},
})Use an environment variable for the API key instead of hardcoding it.
Check my MultiMail inbox for unread emails. Summarize each one in a line. For any that look like bug reports, read the full email and check if the mentioned file exists in our project.Example interaction with your AI chat plugin using MultiMail tools.
vim.keymap.set('n', '<leader>mi', function()
-- Trigger your AI chat plugin with an inbox check prompt
-- Adjust this to match your specific AI chat plugin's API
require('avante').ask('Check my MultiMail inbox and summarize any unread emails.')
end, { desc = 'Check MultiMail inbox' })Set up a keybinding to quickly check your inbox through the AI assistant.
Instead of hardcoding your API key in init.lua, use vim.env.MULTIMAIL_API_KEY to read it from the environment. Set the key in your .zshrc or .bashrc with 'export MULTIMAIL_API_KEY=mm_live_your_key_here' to keep secrets out of your dotfiles repo.
mcp.nvim provides the MCP transport layer, but you need a chat plugin for the AI interface. avante.nvim offers a sidebar chat with tool support, while codecompanion.nvim integrates more tightly with Neovim's buffers. Try both to see which fits your workflow.
Map frequently used email operations to keybindings. For example, map <leader>mi to check your inbox, <leader>ms to draft an email, and <leader>mp to list pending approvals. This keeps email operations as fast as your regular Neovim workflow.
If the MCP server fails to connect, you can debug it directly in your terminal by running 'npx -y @multimail/mcp-server' to verify the server starts. Check Neovim's :messages or the mcp.nvim log for connection errors.
Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a 38-tool MCP server. Formally verified in Lean 4.