Email Agent Mcp
@UseJunior
About Email Agent Mcp
Email connectivity for AI agents — MCP server for Claude Code, Gemini CLI, Cursor, and more
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"email-agent-mcp": {
"command": "npx",
"args": [
"-y",
"email-agent-mcp"
]
}
}
}Tools
26List recent emails with filtering by unread status, folder, sender, and limit. Use offset for pagination. A row with `isDraft: true` is an unsent draft — it has NOT been sent, and its `receivedAt` is provider-supplied metadata, not evidence of delivery. Never describe such a row as a sent, delivered, or received email.
Read the full content of an email by ID, transformed to token-efficient markdown. When the response has `isDraft: true` the message is an unsent draft — it has NOT been sent, and `receivedAt` is provider-supplied metadata, not evidence of delivery; never describe it as a sent, delivered, or received email. Set format to 'html' to get the raw body HTML instead of markdown — use this when you need to preserve inline styling (colour, background-colour, underline, strikethrough) that the markdown conversion discards, e.g. to change one sentence of a formatted body and leave the rest alone. Raw HTML costs far more tokens than markdown, so leave the default alone unless you need the styling; check `bodyFormat` (`text` means the message had no HTML part, so do not send it as HTML) before writing a body back, and never write one back with `bodyTruncated: true` — you do not have the whole body. strip_quoted_history and strip_signatures are markdown-shaped text transforms and are NOT applied when format is 'html'; the HTML is returned verbatim. To write it back, call create_draft/update_draft with format: 'html' AND force_black: false — force_black defaults to true and wraps your HTML in a force-black div, so leaving it on nests another wrapper on every round trip. Set strip_quoted_history to true to drop the terminal "On … wrote:" / Outlook-header / `>`-prefix reply chain and replace it with a short marker. Set strip_signatures to true to remove detected signatures and legal disclaimers; it defaults to false here for MCP compatibility even though the core action defaults to true.
Search emails using full-text query across one or all mailboxes. Use offset for pagination. Results include unsent drafts: a row with `isDraft: true` has NOT been sent — its `receivedAt` is provider-supplied metadata, not evidence of delivery. Never describe such a row as a sent, delivered, or received email.
Get mailbox connection status, unread count, and warnings
List every configured mailbox: its logical `name` (pass this as the `mailbox` argument to other tools), its `emailAddress`, provider, connection status, and which one is the default. Reports mailboxes that failed to authenticate too, so it stays useful for diagnosing a broken setup.
Retrieve all messages in a conversation thread by message ID. A thread can end with an unsent draft reply: a message with `isDraft: true` has NOT been sent, so it is not a sent reply — though earlier sent replies from the same author may exist elsewhere in the thread. Never describe such a message as a sent, delivered, or received email.
Compose and send a new email. Gated by send allowlist. Draft mode bypasses allowlist. If a send fails with SEND_STATUS_UNKNOWN, the message may already have been delivered; do not resend without checking Sent Items.
Reply to an email within an existing thread. Default reply_all=true cc's the original thread; pass reply_all=false to reply only to the sender. Send path validates all effective recipients against the send allowlist; draft path bypasses. If a send fails with SEND_STATUS_UNKNOWN, the message may already have been delivered; do not resend without checking Sent Items.
Create an email draft. Supports body_file with YAML frontmatter. Use reply_to for threaded reply drafts, where to and subject are derived from the parent message and may be omitted; pass reply_all=false with reply_to to draft a sender-only reply.
Send a previously created draft. Enforces send allowlist before sending. Rate-limited. If a send fails with SEND_STATUS_UNKNOWN, the message may already have been delivered; do not resend without checking Sent Items.
Update a draft email. Body edits are refused for reply drafts; non-reply body edits require replace_body=true and replace the body wholesale. Subject, recipients, and attachments remain editable. Allowlist is enforced at send_draft time, not here.
Cancel a pending provider-held scheduled send. Only verified scheduled drafts can be cancelled.
List pending provider-held scheduled sends for a mailbox
List attachments for a specific email message
Download a single attachment as inline base64. Default max_size_mb=5 (hard ceiling 25). File attachments only — Microsoft item/reference attachments return NOT_SUPPORTED.
Apply labels or categories to one or more emails
Flag or unflag an email as important/starred
Mark an email as read or unread
Delete an email (disabled by default, requires explicit configuration)
Move an email to a specific folder (inbox, archive, trash, etc.). Returns the new message ID since Graph assigns a new ID after moving.
Recursively list mail folders, including computed paths for nested folders
Create a custom child mail folder (defaults to a child of Inbox)
Delete a custom mail folder, including any mail it contains (disabled by default, requires explicit configuration). Well-known/system folders are protected.
List server-side inbox rules with all fields reported by the provider
Create a persistent server-side inbox rule using safe actions only; forwarding, redirection, and deletion are blocked. Confirm with the user before calling — this creates a rule that keeps acting on the mailbox 24/7 after the session ends.
Delete a server-side inbox rule by id (disabled by default, requires explicit configuration). Removing a rule can silently re-expose the mailbox to mail the rule was filtering.
Overview
What is Email Agent Mcp?
Email Agent Mcp is an open-source TypeScript MCP server that lets AI agents (Claude Code, Cursor, Gemini CLI, OpenClaw, and others) read, search, draft, reply, label, mark read, move, and send email through your own mailbox. It supports Microsoft 365/Outlook and Gmail with security-first defaults that prevent agents from sending email until you explicitly configure an allowlist.
How to use Email Agent Mcp?
Run npx -y email-agent-mcp to start the interactive setup wizard, which walks you through OAuth configuration and mailbox selection. Then add the server to your MCP client’s settings (e.g., Claude Code settings.json, Cursor .cursor/mcp.json, or Gemini CLI). For OpenClaw, configure an mcp block in ~/.openclaw/openclaw.json. An optional email watcher polls your mailbox and sends wake signals to OpenClaw when new email arrives.
Key features of Email Agent Mcp
- 15 MCP tools for reading, writing, and managing email
- Send allowlist empty by default; agents cannot send until configured
- Delete disabled by default; requires explicit operator opt-in
- Error sanitization that strips API keys, file paths, and stack traces
- Body file sandboxing with path traversal protection
- Outbound attachments via file path or inline base64 (25 MB cap)
Use cases of Email Agent Mcp
- AI agents reading and summarizing recent email from your mailbox
- Drafting and sending email replies under allowlist control
- Full-text search across mailboxes for relevant threads
- Labeling, flagging, moving, and deleting emails (with security gates)
- Monitoring a mailbox for new messages and triggering agent workflows
FAQ from Email Agent Mcp
Does this work with Claude Code?
Yes. Run npx email-agent-mcp to start the MCP server, then configure it in your Claude Code settings.
Can agents send email without my permission?
No. The send allowlist is empty by default. Agents cannot send any email until you explicitly configure allowed recipients.
Does this store my email credentials?
OAuth tokens are managed by MSAL (Microsoft) and stored in your OS keychain or local config files under ~/.email-agent-mcp/. Agent Email never stores raw passwords.
Can I connect multiple mailboxes?
Yes. You can configure Microsoft 365 and Gmail simultaneously. Read actions default to your primary mailbox; write actions require specifying a mailbox when multiple are configured.
The OpenClaw CLI rejects my config with "Unrecognized key: mcp"
The OpenClaw CLI and macOS app can be different versions. The app may support config keys the CLI doesn't recognize yet. Update the CLI with npm install openclaw@latest in your NemoClaw directory, or restart the gateway directly.
Frequently asked questions
Does this work with Claude Code?
Yes. Run `npx email-agent-mcp` to start the MCP server, then configure it in your Claude Code settings.
Can agents send email without my permission?
No. The send allowlist is empty by default. Agents cannot send any email until you explicitly configure allowed recipients.
Does this store my email credentials?
OAuth tokens are managed by MSAL (Microsoft) and stored in your OS keychain or local config files under `~/.email-agent-mcp/`. Agent Email never stores raw passwords.
Can I connect multiple mailboxes?
Yes. You can configure Microsoft 365 and Gmail simultaneously. Read actions default to your primary mailbox; write actions require specifying a mailbox when multiple are configured.
The OpenClaw CLI rejects my config with "Unrecognized key: mcp"
The OpenClaw CLI and macOS app can be different versions. The app may support config keys the CLI doesn't recognize yet. Update the CLI with `npm install openclaw@latest` in your NemoClaw directory, or restart the gateway directly.
Basic information
More AI & Agents MCP servers
XDC AI
XDC AI is a remote MCP server available at https://xdcai.tech.
GetIntel
tarang8811Public docs + tool manifest for the GetIntel MCP connector (app.getintel.ai)
Orders of Magnitude — x402 API Catalog
OrdersOfMagnitudeLLC1000+ pay-per-call API endpoints across finance, weather, geography, economic data, agent infrastructure (memory, coordination, secrets, simulation, verification), and NS compute. Payments via x402 protocol on Base/USDC.
Agentic Atlas
Avery JonesConsult field-tested agent-system design patterns through 8 hosted, read-only tools for orientation, deep reading, relationships, provenance, glossary terms, and publication decisions.
Sphere
dtajitdinov-arisOpen marketplace where AI agents register, publish services, and transact via escrowed contracts. Live at starsphera.com.
Comments