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ấu hình qua biến môi trường — hiển thị hướng dẫn ngay trên UI khi thiếu cấu hình
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 — nhớ đặt biến môi trường IMAP/SMTP trước (xem .env.example)2. 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
Toàn bộ cấu hình lấy từ biến môi trường (local dùng file .env, EdgeOne dùng dashboard). Không có cách nhập/lưu cấu hình qua Web UI.
Copy
.env.example→.envvà điền thông tin (local), hoặcĐặt biến môi trường trong dashboard EdgeOne Pages (deploy)
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 |
💡 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.
Khi thiếu cấu hình, Web UI hiển thị banner hướng dẫn đặt biến môi trường rồi tải lại trang — nhất quán trên cả Node.js local lẫn EdgeOne Pages (không cần filesystem, không cần KV).
🔌 Kết nối MCP từ xa qua HTTP (/mcp)
Web app (local lẫn EdgeOne) mở sẵn endpoint MCP Streamable HTTP tại /mcp —
trả lời JSON-RPC thuần (không cần SSE), giúp Claude Desktop, Cursor, Claude Code…
kết nối trực tiếp tới bản deploy:
{
"mcpServers": {
"email": {
"type": "http",
"url": "https://<project>.edgeone.app/mcp"
}
}
}Luồng chuẩn (JSON-RPC qua POST): initialize → notifications/initialized →
tools/list → tools/call. Server tự chèn header Accept cần thiết nên client nào
cũng gọi được; mỗi session có Mcp-Session-Id riêng (tự dọn khi đóng).
🚀 Deploy lên EdgeOne Pages
npm run deploy # EdgeOne Pages — cần đã đăng nhập `edgeone login` (hoặc token trong .edgeone/.token)
npm run deploy:ci # Dành cho CI: dùng token qua biến môi trường EDGEONE_PAGES_API_TOKENTrong bảng điều khiển EdgeOne Pages → Settings, đặt các biến môi trường:
IMAP_HOST,IMAP_PORT,IMAP_USER,IMAP_PASSWORD,SMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PASSWORD,SMTP_FROM(xem.env.example)Deploy: thư mục
functions/là entry EdgeOne (functions/index.tsxgọisrc/edgeone.ts),public/là file tĩnhKiểm tra type-check trước khi deploy:
npm run typecheck:functions
🗂️ Cấu trúc dự án
src/
├── config.ts # Cấu hình từ biến môi trường + mask mật khẩu
├── mcp-http.ts # Endpoint /mcp: MCP Streamable HTTP (JSON-RPC, không SSE)
├── 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: phục vụ API + 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 |
🔐 Bảo mật
HTML email được sanitize (chặn script, iframe,
on*,javascript:…) trước khi renderCấu hình chỉ lấy từ biến môi trường: file
.envđã được gitignore (chỉ dùng cho máy cá nhân); trên EdgeOne biến môi trường đượ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
- AlicenseNot gradedqualityDmaintenanceMCP 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.73GPL 3.0
- FlicenseNot gradedqualityDmaintenanceAn 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.
- AlicenseNot gradedqualityDmaintenanceA 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.1MIT
- AlicenseNot gradedqualityBmaintenanceMCP server for managing email via IMAP/SMTP, supporting multiple accounts and tools for reading, sending, searching, and organizing emails.444MIT
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.
Fully-managed email as MCP tools - register domains, real mailboxes, send and receive mail.
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