Connect MultiMail's 43-tool MCP server to Gemini CLI and give your terminal-based AI workflows full email capabilities — send, read, thread, and approve from the command line.
Gemini CLI is Google's terminal-based AI assistant, built for developers who want agent-augmented workflows without leaving the command line. By adding MultiMail as an MCP server, Gemini CLI gains access to structured email operations: reading inboxes, sending messages, managing threads, and surfacing pending approvals for human review.
MultiMail's MCP server exposes 44 tools covering the full email lifecycle. Gemini CLI connects to it over stdio, which means the server process runs locally alongside your terminal session. Configuration requires only a MultiMail API key and a JSON edit to ~/.gemini/settings.json.
The integration suits developer automation workflows well: processing CI notifications, triaging support inboxes, or building lightweight agent loops that send transactional email under human oversight. MultiMail's graduated oversight modes let you decide how much autonomy Gemini gets — from requiring approval on every send to fully autonomous operation.
Install Gemini CLI via npm if you haven't already. Node.js 18 or later is required.
npm install -g @google/gemini-cli
gemini --versionLog in to your MultiMail account and copy your API key from the dashboard. Keys start with mm_live_ for production or mm_test_ for sandbox testing. Use mm_test_ while setting up to avoid sending live email during configuration.
Open ~/.gemini/settings.json (create it if it doesn't exist) and add the MultiMail MCP server under the mcpServers key. The npx invocation downloads and runs the server on first use.
{
"mcpServers": {
"multimail": {
"command": "npx",
"args": ["-y", "@multimail/mcp-server"],
"env": {
"MULTIMAIL_API_KEY": "mm_live_your_key_here"
}
}
}
}Start a new Gemini CLI session. The MultiMail tools should now be available. Ask Gemini to list available tools or run a test check_inbox call to confirm the connection.
gemini
# In the Gemini prompt:
# > What MultiMail tools do you have access to?By default, MultiMail uses gated_send mode — reads are autonomous but sends require your approval via decide_email. Adjust this per mailbox in the dashboard or via the API. Start here and graduate toward more autonomy once you trust the agent's behavior.
curl -X PATCH https:"cm">//api.multimail.dev/mailboxes/your-mailbox-id \
-H "Authorization: Bearer $MULTIMAIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"oversight_mode": "gated_send"}'| Tool | Description | Example |
|---|---|---|
| check_inbox | Lists recent emails in a mailbox with metadata: sender, subject, timestamp, read status, and tags. Accepts filters for date range, read state, and tags. | Check whether any new support requests arrived in [email protected] in the last 24 hours. |
| read_email | Fetches the full content of a specific email by ID, including headers, body text, and attachment metadata. | Read email em_01J9XY... to extract the order number and issue description from its body. |
| get_thread | Retrieves all messages in an email thread ordered chronologically, preserving the full conversation context. | Get the full support thread before drafting a reply so the agent doesn't repeat already-covered ground. |
| send_email | Sends a new email from a MultiMail mailbox. In gated_send or gated_all mode the message is queued for approval rather than delivered immediately. | Send a project status update to the team after a CI build completes, held for approval before delivery. |
| reply_email | Sends a reply to an existing email, preserving thread context and setting correct In-Reply-To and References headers. | Reply to a customer inquiry with a resolution, keeping the original message in the thread. |
| tag_email | Applies one or more string tags to an email for categorization, filtering, and downstream routing. | Tag inbound emails as billing, technical, or general based on subject and body classification. |
| decide_email | Approves or rejects a pending outbound message that is waiting in the gated_send or gated_all queue. | Approve a drafted reply after reviewing it for accuracy, releasing it for delivery. |
| list_pending | Lists all outbound messages currently waiting for human approval, with subject, recipient, and queued timestamp. | Review the full approval queue before starting a morning standup to see what the agent drafted overnight. |
| cancel_message | Cancels a pending outbound message before it is approved or delivered, removing it from the queue. | Cancel a scheduled email when the underlying data it references has changed and the draft is no longer accurate. |
| search_contacts | Searches contact history for email addresses matching a name, domain, or keyword from prior correspondence. | Find all known contacts at a target company before composing an outreach message. |
| create_mailbox | Creates a new mailbox on your account, either on a custom domain you control or on multimail.dev. | Provision a dedicated mailbox for a new agent workflow or project without touching the dashboard. |
{
"mcpServers": {
"multimail": {
"command": "npx",
"args": ["-y", "@multimail/mcp-server"],
"env": {
"MULTIMAIL_API_KEY": "mm_live_your_key_here"
}
}
}
}Minimal configuration to add MultiMail to Gemini CLI. Place this in ~/.gemini/settings.json on macOS or Linux, or %USERPROFILE%\.gemini\settings.json on Windows.
Check the inbox for [email protected] from the last 6 hours.
For each unread email:
1. Call read_email to get the full content
2. Call tag_email to label it as 'billing', 'technical', or 'general' based on the subject and body
3. Draft a reply acknowledging receipt and estimating a response window
4. Call send_email to queue the draft — oversight mode will hold it for my approval
After processing all emails, call list_pending so I can review the queued replies.A Gemini CLI prompt that reads an inbox, classifies emails by category, and queues replies for gated approval before delivery.
"cm">#!/bin/bash
"cm"># ci-notify.sh — called by CI pipeline after build finishes
BUILD_STATUS=${1} "cm"># 'success' or 'failure'
BUILD_URL=${2}
TEAM_EMAIL=${3:[email protected]}
gemini --prompt "Call send_email with:
from: &"cm">#039;[email protected]'
to: &"cm">#039;${TEAM_EMAIL}'
subject: &"cm">#039;Build ${BUILD_STATUS}: ${GITHUB_REF_NAME:-local}'
body: &"cm">#039;The ${GITHUB_WORKFLOW:-build} workflow completed with status ${BUILD_STATUS}. Details: ${BUILD_URL}'
Then call list_pending to confirm the message is queued for approval."Shell script that invokes Gemini CLI to send a structured build notification email when a CI job completes. Runs as a post-build step.
Call list_pending to show me all outbound emails waiting for approval.
For each pending message, show me:
- Recipient address
- Subject line
- First 300 characters of the body
- How long it has been queued
Then ask me whether to approve or reject each one. Call decide_email with my answer for each message.
When the queue is empty, tell me how many messages were approved and how many were rejected.Interactive Gemini CLI session that walks through the pending approval queue and processes each message with your input.
Call get_thread with thread_id 'th_01K2AB...' to retrieve the full conversation.
Summarize the thread in three bullet points:
- What the customer originally asked
- What has been resolved so far
- What is still open
Draft a reply that:
- Acknowledges the open items specifically
- Provides next steps with concrete timeframes
- Does not repeat information already covered
Call reply_email to queue the draft. Use oversight mode — do not send until I approve via decide_email.Retrieves a full email thread, summarizes the conversation, and drafts a reply held for approval.
Gemini CLI supports a project-level settings file at .gemini/settings.json in your repository root. Committing a shared MCP config there means every team member connects to the same MultiMail setup automatically. Omit the API key from the committed file and have each developer export MULTIMAIL_API_KEY from their shell profile — the MCP server subprocess inherits environment variables from the shell that launched Gemini.
New integrations should use gated_send oversight mode so you can audit what Gemini drafts before anything is delivered. After reviewing 20 to 30 queued sends and confirming they match your expectations, switch to monitored mode. You'll still receive notifications for every send but won't need to approve each one individually.
The npx -y @multimail/mcp-server invocation pulls the latest published version on each run. For production workflows, pin a specific release: set args to ["-y", "@multimail/[email protected]"]. This prevents unexpected behavior after upstream updates and makes your configuration reproducible across machines.
MultiMail API keys prefixed with mm_test_ route to a sandbox environment where send_email calls are captured and logged but never delivered to real recipients. Use a test key in your settings.json while developing and iterating on Gemini CLI prompts, then swap to mm_live_ only when you are ready to handle live email.
MultiMail API keys can be scoped to specific mailboxes and operations. For a Gemini CLI workflow that only needs to read and triage one inbox, create a key restricted to that mailbox with read and tag permissions only. This limits the blast radius if the key leaks from your settings.json.
Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a 38-tool MCP server. Formally verified in Lean 4.