
统一的MCP服务器,用于跨Gmail、Outlook、iCloud和IMAP的电子邮件访问
概览
一个统一的MCP服务器,支持跨Gmail、Outlook、iCloud及通用IMAP提供商的电子邮件访问。 - —— Gmail(REST API)、Outlook(Microsoft Graph)、iCloud(IMAP)及通用 IMAP/SMTP —— 基于浏览器的 Gmail 和 Outlook OAuth 流程,具备自动令牌刷新功能 —— 搜索、阅读、发送、回复、转发、整理和管理草稿 —— 一次调用即可删除、移动或标记数百封邮件 —— 默认为紧凑的搜索结果(~20KB 对比 ~1.4MB),并可选全文检索 —— AES-256-GCM 静态加密,机器源密钥 —— 在功能更丰富时使用 Gmail API 和 Microsoft Graph,恢复 IMAP 以实现通用兼容性 或者直接用NPX运行(无需安装): 1. 运行交互式设置向导以添加您的邮箱账户: 该包声明两个二进制文件(MCP服务器的邮箱-mcp,向导的邮箱-mcp-setup)。
概述(AI 翻译)
一个统一的MCP服务器,支持跨Gmail、Outlook、iCloud及通用IMAP提供商的电子邮件访问。
特色
- 多提供者支持 —— Gmail(REST API)、Outlook(Microsoft Graph)、iCloud(IMAP)和通用 IMAP/SMTP
- OAuth2 认证 —— 基于浏览器的 Gmail 和 Outlook OAuth 流程,自动刷新令牌
- 完整邮件客户端 —— 搜索、阅读、发送、回复、转发、组织和管理草稿
- 批处理操作 ——在一次通话中删除、移动或标记数百封邮件
- 轻量级搜索 —— 默认为精简搜索结果(~20KB 对 ~1.4MB),并可选全体检索
- 加密凭证存储 —— AES-256-GCM 静态加密,机器衍生密钥
- 提供者原生API ——在功能更丰富时使用 Gmail API 和 Microsoft Graph,为实现通用兼容性而退回 IMAP
安装
从npm全局安装:
或者直接用NPX运行(无需安装):
快速启动
- 运行交互式设置向导以添加您的邮箱账户:
需要
-p/[--package标志。 该包声明两个二进制文件(MCP 服务器的 [email-mcp,该向导的email-mcp-setup)。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 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:
npm install -g @marlinjai/email-mcp
Or run directly with npx (no install needed):
npx @marlinjai/email-mcp
Quick Start
- Run the interactive setup wizard to add your email accounts:
npx -y -p @marlinjai/email-mcp@latest email-mcp-setup
The
-p/--packageflag is required. This package declares two binaries (email-mcpfor the MCP server,email-mcp-setupfor this wizard). Without-p, npx runs the bin matching the package’s own name (email-mcp, the server) and silently passesemail-mcp-setupto it as an ignored argument — the server then sits waiting for MCP protocol input on stdin forever, producing no output at all. It looks exactly like a hang.-ptells npx explicitly which package to resolve and which of its binaries to actually run.
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.
- Add the server to your MCP configuration (
.mcp.json):
{
"mcpServers": {
"email": {
"command": "npx",
"args": ["@marlinjai/email-mcp"]
}
}
}
- 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):
npx -y -p @marlinjai/email-mcp@latest email-mcp-setup
# Select "Gmail" when prompted
# Choose "Full" or "Restricted" permission scope when asked
# A browser window opens for Google authorization
# Grant the requested permissions and return to the terminal
The wizard asks which Gmail permission scope to authorize:
- Full (default) — everything below, plus immediate, Trash-bypassing permanent deletion (
https://mail.google.com/, Gmail’s maximum-permission scope).
安装
npx @marlinjai/email-mcp配置
{
"mcpServers": {
"email": {
"command": "npx",
"args": ["@marlinjai/email-mcp"]
}
}
}