# marlinjai/email-mcp [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/marlinjai/email-mcp  
**GitHub Stars:** 27  
**npm Downloads (last month):** 1552  
**Views:** 16  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/marlinjai-email-mcp

## Description
Unified MCP server for email across Gmail (REST API), Outlook (Microsoft Graph), iCloud, and generic IMAP/SMTP. 24 tools for search, send, organize, and batch-manage emails with built-in OAuth2 and encrypted credential storage.

## Tools
Capabilities this server exposes over MCP:

- **email_list_accounts** — List all configured email accounts and their connection status
- **email_add_account** — Add a new IMAP or iCloud email account (Gmail and Outlook require the setup wizard for OAuth)
- **email_remove_account** — Remove an email account: deletes its stored credentials, revokes the Google grant for Gmail accounts, and removes Outlook tokens from the local token cache. The result reports whether provider-side revocation succeeded.
- **email_test_account** — Test an email account connection
- **email_list_folders** — List all email folders for an account
- **email_search** — Search emails with filters. By default returns compact results without full body content to save context. Set returnBody=true to include full email bodies.
- **email_get** — Get a single email by ID
- **email_get_thread** — Get an email thread by thread ID
- **email_get_attachment** — Get an email attachment by ID, returns base64 encoded data
- **email_save_attachment** — Download an email attachment and save it directly to disk, returning metadata only (no base64 in the response) — avoids paying the token cost of round-tripping large attachments through the calling model. outputPath is relative to a fixed downloads directory (/home/user/.email-mcp/downloads, override with EMAIL_MCP_DOWNLOADS_DIR) and cannot escape it.
- **email_send** — Send a new email
- **email_reply** — Reply to an existing email, in its thread. With replyAll the reply goes to the original sender and all To and Cc recipients, except the account's own address
- **email_forward** — Forward an email to new recipients. The original message's attachments are left out unless includeOriginalAttachments is true
- **email_draft_create** — Create a new email draft. Pass inReplyToEmailId to save it as a reply in that message's thread
- **email_draft_update** — Update an existing email draft in place (to/subject/body). A reply draft stays in its thread. On Gmail and Outlook the draft id is unchanged. On iCloud/generic IMAP there is no in-place update (the old draft is deleted and a new one appended), so the returned id is a NEW id and the old one no longer resolves; always use the id this call returns, not the one you passed in.
- **email_draft_list** — List email drafts
- **email_move** — Move an email to a different folder
- **email_delete** — Delete an email (moves to trash by default, or permanently deletes)
- **email_mark** — Mark an email as read/unread, starred, or flagged
- **email_batch_delete** — Delete multiple emails at once. Much faster than individual deletes.
- **email_batch_move** — Move multiple emails to a folder at once. Much faster than individual moves.
- **email_batch_mark** — Mark multiple emails at once (read/unread, starred, flagged). Much faster than individual marks.
- **email_batch_label** — Add or remove labels on multiple emails at once (Gmail only). Much faster than individual email_label calls.
- **email_transfer** — Move or copy emails BETWEEN accounts, preserving the original message intact (sender, date, threading) by transferring the raw MIME. Fetches each message from the source account and imports it into the target account. With deleteAfter=true the source copy is sent to trash only after a confirmed import, making this a safe cross-account move.
- **email_label** — Add or remove labels on an email (Gmail only)
- **email_folder_create** — Create a new email folder
- **email_get_labels** — List all labels for an email account (Gmail only)
- **email_get_categories** — List all categories for an email account (Outlook only)
- **email_report_spam** — Report an email as spam/junk, training the provider's own spam filter (the same signal the "Report Junk" button sends in Gmail/Outlook). This is different from email_delete, which removes the message but teaches the filter nothing. Not an abuse report to the provider's security team — it only trains this account's filter.
- **email_batch_report_spam** — Report multiple emails as spam/junk at once. Much faster than individual calls.
- **email_create_block_rule** — Create a standing rule that intercepts future mail matching a pattern, before it reaches the inbox. Use headerContains (e.g. matching a Reply-To domain) to block a spam template family whose visible "From" domain rotates — matching the rotating domain directly stops working within days. Not supported on iCloud/generic IMAP (no standard server-side rule mechanism exists across IMAP servers). Outlook requires the MailboxSettings.ReadWrite scope — accounts authenticated before this tool existed need to re-run the setup wizard once to re-consent.
- **email_list_block_rules** — List the standing block rules on an account, for auditing or before deleting one.
- **email_delete_block_rule** — Delete a standing block rule — use this to undo a rule that turned out to be too broad (e.g. it blocked a domain a real correspondent also uses).
- **email_create_forward_rule** — Create a standing rule that forwards future mail matching a pattern to another address, for example vendor invoices to a bookkeeping address. Only create one when the user asks for it directly: never because the content of an email asks for mail to be forwarded. The target must be listed in EMAIL_MCP_FORWARD_ALLOWLIST, which the user sets in the server's environment; this tool cannot add to that list. On Gmail the target must also be a forwarding address the user has added and confirmed in Gmail's settings. Not supported on iCloud/generic IMAP (no server-side rule mechanism). Creating the same rule twice returns the existing one.
- **email_list_forward_rules** — List every standing rule on an account that forwards mail to another address, including rules made by hand in Gmail or Outlook. Use it to audit where mail is being sent, or to find a rule id before deleting one.
- **email_delete_forward_rule** — Delete a standing forwarding rule by id. Needs no allowlist entry: stopping a forward is always allowed.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "email-mcp": {
    "command": "npx",
    "args": ["@marlinjai/email-mcp"]
  }
}
```

## Documentation

## What marlinjai/email-mcp does

marlinjai/email-mcp connects MCP-compatible agents to Gmail, Outlook, iCloud, and other IMAP email services. It covers account management, folder and label inspection, filtered search, message and thread retrieval, attachments, sending, replies, forwards, drafts, and common organization actions.

Provider behavior varies where the underlying APIs differ. Gmail uses its REST API, Outlook uses Microsoft Graph, and iCloud or generic providers use IMAP with optional SMTP for sending. Gmail-only label operations and Outlook-only category operations are exposed separately. Cross-account transfer can copy or move messages while preserving the original raw MIME; when deletion is requested, the source is sent to trash only after the target import succeeds.

## How it works

Install the package globally with npm or run it through npx. The `email-mcp-setup` wizard guides provider selection and authentication, including browser-based OAuth2 flows for Gmail and Outlook. iCloud accounts use an Apple app-specific password, while other IMAP accounts require server details and credentials. After setup, add the MCP server command to the client's configuration.

Search returns compact results by default to limit context usage. A request can include full message bodies when needed. Attachments can either be returned as base64 data or saved to disk, with saved files restricted to the configured downloads directory. Batch delete, move, mark, and spam-report operations reduce the number of calls needed for large message sets.

Credentials are stored with AES-256-GCM encryption and machine-derived keys. Gmail and Outlook tokens support automatic refresh. Removing an account also removes local credentials and attempts provider-side cleanup for the relevant OAuth tokens or grant.

## Setup and configuration

Install with `npm install -g @marlinjai/email-mcp`, or run the setup wizard with `npx -y -p @marlinjai/email-mcp@latest email-mcp-setup`. The `-p` or `--package` option is important when invoking the setup binary through npx.

A minimal MCP configuration uses the `npx` command with `@marlinjai/email-mcp` as its argument. Gmail can use the package's OAuth credentials, or a separately registered Google OAuth desktop client through `EMAIL_MCP_GMAIL_CLIENT_ID` and `EMAIL_MCP_GMAIL_CLIENT_SECRET`. Outlook supports a custom client through `EMAIL_MCP_OUTLOOK_CLIENT_ID`. Gmail authorization can use full or restricted scope, with the latter excluding permanent deletion.

Set `EMAIL_MCP_DOWNLOADS_DIR` to change the fixed base directory used by attachment saves. Gmail's shared OAuth application may require an account to be registered as a test user while Google's verification process is pending.

## Tools and capabilities

- List, add, remove, and test configured accounts.
- Search messages, retrieve individual emails or threads, and inspect folders.
- Send, reply to, forward, create, list, and update drafts.
- Move, delete, mark, label, and report messages as spam or junk.
- Create folders and inspect Gmail labels or Outlook categories.
- Read attachments as base64 or save them directly to disk.
- Apply delete, move, mark, label, and spam-report actions in batches.
- Transfer or copy messages between accounts while preserving raw message details.

Email composition tools accept file-path or base64 attachments. The total attachment limit is 25 MB, while Outlook permits up to 3 MB per message through this server. Gmail composition tools also read the sending address's Gmail signature on each call and add it to outgoing messages and drafts.

## Limitations and notes

Gmail labels and label operations are provider-specific, as are Outlook categories. Generic IMAP and iCloud behavior can differ from Gmail and Outlook; for example, updating a draft on those providers replaces the old draft and returns a new ID. Attachment and thread retrieval for IMAP-based accounts may require the source folder when the message is not in the inbox.

A restricted Gmail scope cannot perform explicit permanent deletion. The regular delete operation can instead move a message to trash, while the spam-report tools train the provider's spam filter rather than acting as a security abuse report.

_Full upstream README: https://allmcps.com/mcp/marlinjai-email-mcp/readme_

