io.github.marlinjai/email-mcp

平台与服务

by marlinjai

统一邮件 MCP 服务器,支持 Gmail、Outlook、iCloud 与 IMAP,并提供批量邮件操作能力。

什么是 io.github.marlinjai/email-mcp

统一邮件 MCP 服务器,支持 Gmail、Outlook、iCloud 与 IMAP,并提供批量邮件操作能力。

README

@marlinjai/email-mcp

A unified MCP server for email access across Gmail, Outlook, iCloud, and generic IMAP providers.

Features

  • Multi-provider support -- Gmail (REST API), Outlook (Microsoft Graph), iCloud (IMAP), and generic IMAP/SMTP
  • OAuth2 authentication -- Browser-based OAuth flows for Gmail and Outlook, with automatic token refresh
  • Full email client -- Search, read, send, reply, forward, organize, and manage drafts
  • Batch operations -- Delete, move, or mark hundreds of emails in a single call
  • Lightweight search -- Compact search results by default (~20KB vs ~1.4MB) with optional full body retrieval
  • Encrypted credential storage -- AES-256-GCM encryption at rest with machine-derived keys
  • Provider-native APIs -- Uses Gmail API and Microsoft Graph where available for richer features, falls back to IMAP for universal compatibility

Installation

Install globally from npm:

bash
npm install -g @marlinjai/email-mcp

Or run directly with npx (no install needed):

bash
npx @marlinjai/email-mcp

Quick Start

  1. Run the interactive setup wizard to add your email accounts:
bash
npx @marlinjai/email-mcp setup

The wizard will walk you through provider selection and authentication. After each account, it asks if you'd like to add another — so you can set up Gmail, Outlook, and iCloud all in one go.

  1. Add the server to your MCP configuration (.mcp.json):
json
{
  "mcpServers": {
    "email": {
      "command": "npx",
      "args": ["@marlinjai/email-mcp"]
    }
  }
}
  1. Start using email tools in Claude Code — search your inbox, send emails, organize messages, and more.

Provider Setup Guides

Gmail

No configuration needed — the setup wizard handles everything using built-in OAuth credentials (PKCE):

bash
npx @marlinjai/email-mcp setup
# Select "Gmail" when prompted
# A browser window opens for Google authorization
# Grant the requested permissions and return to the terminal

Note: If you prefer to use your own OAuth app, create a Desktop OAuth 2.0 Client in the Google Cloud Console with the Gmail API enabled.

Outlook

No configuration needed — the setup wizard handles everything using built-in OAuth credentials (PKCE):

bash
npx @marlinjai/email-mcp setup
# Select "Outlook" when prompted
# A browser window opens for Microsoft authorization
# Sign in and grant the requested permissions

Note: If you prefer to use your own OAuth app, register one in the Azure Portal with Mail.ReadWrite, Mail.Send, and offline_access permissions.

iCloud

  1. Go to appleid.apple.com and sign in.
  2. Navigate to App-Specific Passwords and generate a new password.
  3. Run the setup wizard:
bash
npx @marlinjai/email-mcp setup
# Select "iCloud" when prompted
# Enter your iCloud email address
# Enter the app-specific password you generated

Generic IMAP

Run the setup wizard with your IMAP/SMTP server details:

bash
npx @marlinjai/email-mcp setup
# Select "Other IMAP" when prompted
# Enter your IMAP host, port, and credentials
# Optionally enter SMTP host and port for sending

Available Tools (25)

Account Management (4)

ToolDescription
email_list_accountsList all configured accounts with connection status
email_add_accountAdd a new IMAP or iCloud account (Gmail/Outlook require setup wizard)
email_remove_accountRemove an account and its stored credentials
email_test_accountTest connection to an account

Reading & Searching (5)

ToolDescription
email_list_foldersList all folders/labels for an account
email_searchSearch emails with filters. Returns compact results by default (returnBody=false). Set returnBody=true to include full email bodies
email_getGet full email content by ID (headers, body, attachment metadata)
email_get_threadGet an entire email thread/conversation
email_get_attachmentDownload a specific attachment by ID (returns base64 data)

Sending & Drafts (5)

ToolDescription
email_sendCompose and send a new email (to, cc, bcc, subject, body)
email_replyReply to an email (supports reply-all, preserves threading)
email_forwardForward an email to new recipients
email_draft_createSave a draft without sending
email_draft_listList all drafts

Organization (8)

ToolDescription
email_moveMove an email to a different folder. Supports sourceFolder for IMAP/iCloud
email_transferMove or copy emails between accounts, preserving the original message (sender, date, threading) via raw MIME transfer. deleteAfter=true trashes the source only after a confirmed import (safe cross-account move)
email_deleteDelete an email (trash or permanent). Supports sourceFolder for IMAP/iCloud
email_markMark as read/unread, starred, or flagged. Supports sourceFolder for IMAP/iCloud
email_labelAdd/remove labels (Gmail only)
email_folder_createCreate a new folder
email_get_labelsList all labels with counts (Gmail only)
email_get_categoriesList all categories (Outlook only)

Batch Operations (3)

ToolDescription
email_batch_deleteDelete multiple emails at once (up to 1000 for Gmail, batches of 20 for Outlook, UID ranges for IMAP)
email_batch_moveMove multiple emails to a folder in a single call
email_batch_markMark multiple emails read/unread, starred, or flagged at once

All batch tools accept a sourceFolder parameter for IMAP/iCloud and include a sequential fallback for maximum compatibility.

Usage with Claude Code

Add the following to your .mcp.json file (project-level or global ~/.claude/.mcp.json):

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

Once configured, you can ask Claude to interact with your email:

  • "Check my inbox for unread messages"
  • "Search for emails from alice@example.com in the last week"
  • "Reply to the latest email from Bob and thank him"
  • "Move all newsletters to the Archive folder"
  • "Delete all spam emails" (uses batch operations for speed)
  • "Draft a follow-up email to the team about the meeting"

Development

bash
# Install dependencies
pnpm install

# Build the project
pnpm build

# Run in development mode (watch for changes)
pnpm dev

# Run tests
pnpm test

# Run tests in watch mode
pnpm test:watch

# Run integration tests (requires real email accounts)
pnpm test:integration

Support

If this project is useful to you, consider supporting its development:

License

MIT

常见问题

io.github.marlinjai/email-mcp 是什么?

统一邮件 MCP 服务器,支持 Gmail、Outlook、iCloud 与 IMAP,并提供批量邮件操作能力。

相关 Skills

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描164.6k

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描164.6k

接口测试套件

by alirezarezvani

Universal
热门

扫描 Next.js、Express、FastAPI、Django REST 的 API 路由,自动生成覆盖鉴权、参数校验、错误码、分页、上传与限流场景的 Vitest 或 Pytest 测试套件。

帮你把API与集成测试自动化跑顺,减少回归漏测;能力全面,尤其适合复杂接口场景的QA团队。

平台与服务
未扫描23.3k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
89.0k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
79.5k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
71.5k

评论