email-mcp
Allows sending and receiving email through Gmail via IMAP/SMTP, including listing, reading, searching, and sending emails with attachments, as well as marking emails as read/unread.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@email-mcpshow me unread emails in my inbox"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
✉️ Mail MCP — Xem & Gửi Email qua MCP Server
Ứng dụng email đầy đủ: MCP server (chuẩn Model Context Protocol) để xem/gửi email qua IMAP/SMTP + Web UI hiện đại để dùng trên trình duyệt. Web UI gọi MCP server qua in-memory MCP client, và cùng MCP server đó có thể kết nối với Claude Desktop, VS Code Copilot, hay bất kỳ MCP client nào qua stdio.
✨ Tính năng
MCP Server (6 tools)
Tool | Mô tả |
| Liệt kê email (thư mục, giới hạn, từ ngày) kèm đoạn trích nội dung |
| Đọc chi tiết email: text/HTML, CC/BCC, danh sách file đính kèm |
| Tìm kiếm theo người gửi / người nhận / tiêu đề / nội dung |
| Gửi email qua SMTP (To/Cc/Bcc, HTML, đính kèm base64) |
| Tải nội dung file đính kèm (base64) |
| Thông tin tài khoản + danh sách thư mục & số chưa đọc |
| Đánh dấu đã đọc / chưa đọc |
Web UI (Vietnamese)
📥 Inbox 3 cột: thư mục + danh sách email + khung đọc, dark/light mode tự động
📖 Đọc email: render HTML an toàn (sanitize XSS), text/plain, tải file đính kèm
✍️ Soạn email: editor định dạng (B/I/U/list/trích dẫn/link), đính kèm file, reply/reply-all/forward
🔍 Tìm kiếm với debounce, đánh dấu đã đọc tự động
⚙️ Cài đặt tài khoản trực quan trên UI + kiểm tra kết nối
Related MCP server: Email MCP Server
🚀 Cài đặt
npm install
npm run build▶️ Chạy
1. Web UI (kèm MCP server nội bộ)
npm start # hoặc: npm run dev (hot reload)
# Mở http://localhost:3000 — lần đầu sẽ tự mở hộp thoại cấu hình tài khoản2. MCP server qua stdio (cho Claude Desktop, VS Code Copilot…)
npm run mcp # hoặc: node dist/index.jsVí dụ cấu hình claude_desktop_config.json:
{
"mcpServers": {
"email-mcp": {
"command": "node",
"args": ["/duong/dan/tuyet-doi/to/email-mcp/dist/index.js"]
}
}
}Hoặc cài toàn cục: npm link rồi dùng mcp-email.
⚙️ Cấu hình tài khoản
Có 2 cách (cách sau ghi đè cách trước):
File
.env— copy từ.env.examplevà điền thông tinWeb UI → Cài đặt — lưu vào settings store (xem bên dưới)
Biến | Mô tả | Mặc định |
| Máy chủ IMAP | imap.gmail.com / 993 / true |
| Tài khoản IMAP | — |
| Máy chủ SMTP | smtp.gmail.com / 465 / true |
| Tài khoản SMTP & địa chỉ From | = IMAP |
| Cổng Web UI | 3000 |
| Đường dẫn file cài đặt (Node) | .mail-settings.json |
💡 Gmail: bật 2 bước xác minh rồi tạo App password tại myaccount.google.com/apppasswords — không dùng mật khẩu đăng nhập thường.
Nơi lưu cài đặt (settings store) — tự chọn backend
src/config.ts tự động chọn nơi lưu theo môi trường chạy:
Môi trường | Backend | Chi tiết |
Node.js local / MCP stdio | File |
|
EdgeOne Pages | KV binding | Key |
EdgeOne không cho ghi filesystem nên khi chạy trên EdgeOne, cấu hình KV binding my_kv trong dashboard EdgeOne Pages → cài đặt lưu vào KV, tự động dùng khi deploy. Chạy local thì dùng file như cũ — không cần đổi code.
🚀 Deploy lên EdgeOne Pages
npm run deploy # EdgeOne Pages (đã có sẵn cấu hình deploy)Tạo KV namespace trong bảng điều khiển EdgeOne và bind tên
my_kvvào Pages projectDeploy: thư mục
functions/là entry EdgeOne (functions/index.tsxgọisrc/edgeone.ts),public/là file tĩnhCài đặt tài khoản nhập qua Web UI sẽ lưu vào KV; hoặc đặt env vars trên dashboard
🗂️ Cấu trúc dự án
src/
├── config.ts # Cấu hình env + settings store (tự chọn fs/KV) + mask mật khẩu
├── storage.ts # Tầng lưu trữ: backend KV (EdgeOne) + backend file (Node)
├── email-service.ts # Lõi IMAP (imapflow) + SMTP (nodemailer)
├── mcp-server.ts # MCP server: 7 tools, stdio + in-memory client
├── api-app.ts # Hono REST API (không phụ thuộc Node — chạy được trên EdgeOne)
├── web-server.ts # Node web server: SPA + serve static (chỉ dùng local)
├── edgeone.ts # Entry EdgeOne Functions: KV binding + phục vụ file tĩnh
└── index.ts # CLI: `mcp-email` (stdio) | `mcp-email web` (port 3000)
public/ # Web UI: index.html + style.css + app.js
functions/ # EdgeOne Pages entry: index.tsx → src/edgeone.ts🔌 API Web (REST)
Endpoint | Mô tả |
| Kiểm tra MCP server |
| Tài khoản + thư mục |
| Danh sách email |
| Chi tiết email |
| Tải file đính kèm |
| Đánh dấu đã đọc |
| Tìm kiếm |
| Gửi email |
| Xem / lưu cài đặt (mật khẩu được mask) |
🔐 Bảo mật
Mật khẩu được mask khi trả về API (
********)HTML email được sanitize (chặn script, iframe,
on*,javascript:…) trước khi renderFile
.mail-settings.jsonvà.envđã được gitignore — mật khẩu lưu dạng văn bản thuần, chỉ dùng cho máy cá nhân; trên EdgeOne cài đặt nằm trong KVmy_kv(được bảo vệ bởi quyền truy cập platform)
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceMCP server that integrates with Gmail to enable sending, reading, and managing emails through tools like send-email, trash-email, get-unread-emails, and read-email.Last updated73GPL 3.0
- Flicense-qualityDmaintenanceAn MCP server that enables AI models to read, search, and send emails via IMAP and SMTP protocols. It supports various providers like Gmail and Outlook, allowing for tasks such as retrieving unread messages, searching by sender, and managing mailbox folders.Last updated
- Alicense-qualityDmaintenanceA generic IMAP and SMTP MCP server that enables AI agents to interact with email accounts for reading, searching, and sending messages. It provides high-level tools for managing email workflows like daily digests and folder organization across any standard email provider.Last updated1MIT
- Alicense-qualityBmaintenanceMCP server for managing email via IMAP/SMTP, supporting multiple accounts and tools for reading, sending, searching, and organizing emails.Last updated18MIT
Related MCP Connectors
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Hosted email MCP for AI agents with inboxes, send/receive, memory, recovery, and credits.
Shipmail MCP server for AI agent custom-domain email inboxes with REST API and webhooks.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/contributory/email-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server