email-mcp
Allows storing email account passwords as 1Password references, which are resolved automatically using the 1Password CLI for secure credential management.
Supports Gmail accounts for sending and receiving emails via IMAP/SMTP, with specific configuration for appending sent messages and avoiding duplicates.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
email-mcp
MCP server (stdio) exposing structured email tools over IMAP/SMTP for multiple
accounts: email_list_accounts, email_list_folders, email_search,
email_read, email_attachment, email_mark, email_move, email_delete,
email_send, email_authenticate.
Setup
npm install
npm run buildCopy accounts.example.json to ~/.config/email-mcp/accounts.json (or set
EMAIL_MCP_CONFIG) and fill in your accounts.
auth.type: "password"— plain IMAP LOGIN / SMTP AUTH.passis either a literal or a 1Password reference (op://vault/item/field), resolved viaop readat first use — theopCLI must be signed in.auth.type: "m365-oauth"— Exchange Online / Microsoft 365 via XOAUTH2 device-code flow (basic-auth IMAP is dead there).tenantis your domain or tenant ID;clientIdis optional and defaults to Thunderbird's public client. Run theemail_authenticatetool once per account; the refresh token is cached at~/.config/email-mcp/tokens/<account>.json(chmod 600).appendToSent: true— copy sent mail to the\Sentfolder via IMAP APPEND (for servers that don't save it automatically; keepfalsefor M365/Gmail).
Related MCP server: mail-mcp
Register with Claude Code (user scope)
claude mcp add --scope user email -- node /path/to/email-mcp/dist/index.jsOr in JSON config:
{
"mcpServers": {
"email": {
"command": "node",
"args": ["/path/to/email-mcp/dist/index.js"],
"env": { "EMAIL_MCP_CONFIG": "/absolute/path/to/accounts.json" }
}
}
}Skill
Symlink the bundled orchestration skill into your personal skills directory so Claude Code picks it up:
ln -s /path/to/email-mcp/skills/email-manager ~/.claude/skills/email-managerRules mode (non-interactive sorting)
email-mcp rules sorts mail by ordered, deterministic rules from YAML files,
with an optional LiteLLM classifier for mail no rule matches. It uses the same
account config, 1Password references and M365 tokens as the server. With no
subcommand, email-mcp still starts the MCP server.
email-mcp rules check <file.yml>... # validate; exit 0/1
email-mcp rules run <file.yml>... [--dry-run] [--accounts a,b] [--since YYYY-MM-DD]
[--include-read] [--state <path>] [--report <path.json>]
[--no-classifier]
email-mcp rules folders <file.yml>... [--create]runhandles unread mail in the file's mailboxes by default. Add--sinceand--include-readfor a one-off backlog pass.--dry-runstill searches, fetches and calls the classifier, but changes nothing and never sets\Seen. It prints the planned action for each message.--stateremembers messages already decidedkeep(by a rule or the classifier), so later runs skip them. Entries older than 60 days are pruned.--reportwrites a JSON report. It is written even if the run fails.Exit codes:
0ok,1config or validation error,2some account failed (the other accounts were still processed).folderslists the folders each account's move, map and purge actions target.--createcreates the missing ones, but only those listed increate_folders.
version: 1
accounts: [personal, work] # account names from accounts.json (required)
mailboxes: [INBOX] # default [INBOX]
unread_only: true # default true
default_action: keep # no rule matched and no classifier verdict
sweep_trash_unread: false # mark unread mail in \Trash read after the pass
account_purpose: # optional context line for the classifier
personal: "personal mail: family, home, bank"
classifier: # optional
provider: luna # luna | jev
min_confidence: 0.6 # below => default_action
map: # verdict -> action; unlisted or "unsure" => default_action
fyi: read
finance: {move: Finance, read: true}
auth: {move: Auth, read: true}
trash: trash
purge: # time-based clean-up of a folder
- {folder: Auth, older_than: 24h, action: trash}
create_folders: # folders `rules folders --create` may create
personal: [Finance, Auth]
rules: # ordered; first match wins
- id: codes
accounts: [personal] # optional filter
when: # all conditions must hold; case-insensitive JS regexes
from: '@accounts\.example\.com$'
subject: 'verification code'
action: {move: Auth, read: true}
- id: replies
when: {sent_thread: true} # subject matches something you sent in the last 90 days
action: keepConditions: from, from_not, from_name, subject, subject_not, to,
cc, to_cc, list_id, body (fetched only when a rule reaches that
condition), sent_thread, sent_recipient (a sender you wrote to in the last
180 days), and older_than (Nh or Nd). Actions:
keep: change nothing.read: mark read.trash: mark read, then move to\Trash. It never expunges.{move: F, read: bool}: move to folderF. IfFis missing, only the read flag is applied and the report recordsfolder_missing.classify: send the message to the classifier.
The classifier calls LiteLLM at LITELLM_BASE_URL using LITELLM_API_KEY.
Without either it is skipped for the run and a warning goes in the report. If it fails, the
message gets default_action, except that a failure never trashes mail. The
Junk folder is never sent to the classifier.
Development
npm test # vitest unit suite (no network)
npm run build # tsc → dist/Manual end-to-end testing: run the server and exercise each tool against a real account.
Related MCP Connectors
A MCP server for Gmail that lets you search, read, and draft emails and replies.
An MCP server that provides email capabilities, hosted on Alpic platform
An MCP server that provides email capabilities, hosted on Alpic platform
An MCP server that provides email capabilities, hosted on Alpic platform
Related MCP Servers
- FlicenseBqualityNot gradedmaintenanceThis MCP server enables users to manage emails via POP3 and SMTP protocols, allowing for listing, searching, reading, and sending messages. It also supports fetching email threads and extracting text content from various document attachments including PDFs and Office files.8-
- AlicenseNot gradedqualityDmaintenanceAn MCP server for email operations supporting IMAP and SMTP protocols, enabling sending, receiving, searching, and managing emails with attachments.25 PyPI1MIT
- AlicenseBqualityCmaintenanceUniversal IMAP/SMTP MCP server that works with any email provider, providing tools to read, search, send, and manage emails.10242 npm1MIT
- AlicenseAqualityDmaintenanceMCP server that enables email management (send, read, search, delete, etc.) via IMAP/SMTP, compatible with Gmail, Outlook, Yahoo, iCloud, and other standard mail servers.11MIT