PrivateEmail MCP
MCP server for Namecheap PrivateEmail that enables reading, searching, sending, and managing emails and folders via IMAP/SMTP.
README
PrivateEmail MCP
PrivateEmail MCP is a Model Context Protocol server for Namecheap PrivateEmail.
It connects to mail.privateemail.com over IMAP and SMTP so Claude Code can read inboxes, search mail, draft replies, send messages, manage folders, and work with drafts.
This server is built for the Namecheap email provider called PrivateEmail. It is session scoped by design. Everything runs while Claude Code is connected to the server. There are no background workers, schedulers, or durable campaign daemons.
Reliability notes (v1.1.2)
- Each IMAP tool call uses its own short-lived connection instead of one shared mailbox session
- Inbox listings use header and snippet fetches instead of downloading full message bodies
- Tool failures return clearer, agent-friendly error messages for bad UIDs, missing folders, and auth issues
- Prompts such as
draft_replysend compact email payloads instead of full HTML blobs - Sent-folder archival no longer uses fragile
aioimaplibAPPEND. After every SMTP send, the server archives a CRLF-normalized copy intoSentwith stdlibimaplib, retries, and fails loudly if the Sent copy cannot be saved
What it does
- Reads inbox messages, threads, and attachments
- Searches mail by sender, recipient, subject, body text, and date filters
- Sends new emails
- Replies and forwards while preserving thread headers
- Saves and sends drafts
- Moves, copies, deletes, and marks messages
- Creates, renames, and deletes folders
- Exposes inbox context as MCP resources
- Exposes reusable prompts for summarizing inboxes and drafting replies
- Saves sent messages into the
Sentfolder so they appear in PrivateEmail webmail
Why this exists
Namecheap PrivateEmail does not provide a public API for mailbox automation in the same way many SaaS products do. The supported integration path is standard email protocols. This server gives Claude Code a clean MCP interface on top of those protocols.
Features exposed to Claude Code
Tools
health_checkaccount_infolist_folderslist_emailssearch_emailsget_emailget_threaddownload_attachmentsend_emailreply_emailforward_emailsave_draftlist_draftssend_draftmove_emailcopy_emaildelete_emailmark_emailcreate_folderrename_folderdelete_folder
Resources
privateemail://accountprivateemail://foldersprivateemail://inbox/recentprivateemail://inbox/unreadprivateemail://email/{folder}/{uid}
Prompts
summarize_inboxtriage_unreaddraft_replycompose_email
Requirements
- Python 3.11 or newer
uvinstalled- A Namecheap PrivateEmail mailbox
Installation for Claude Code
Fastest install from GitHub
After this repository is pushed, add it directly to Claude Code with one command:
claude mcp add --scope user \
--env PRIVATEEMAIL_ADDRESS="you@yourdomain.com" \
--env PRIVATEEMAIL_PASSWORD="your-password" \
--env PRIVATEEMAIL_DISPLAY_NAME="Your Name" \
privateemail \
-- uvx --from git+https://github.com/ciphersolutions-dev/private-email-mcp privateemail-mcp
Notes:
--scope userinstalls it once for all your projects. Use--scope projectif you want a repo-local setup instead.- Everything after the
--separator is the command Claude Code runs. uvx --from git+... privateemail-mcpinstalls and launches the server directly from GitHub.
Install from a local clone
git clone https://github.com/ciphersolutions-dev/private-email-mcp.git
cd private-email-mcp
uv sync
claude mcp add --scope user \
--env PRIVATEEMAIL_ADDRESS="you@yourdomain.com" \
--env PRIVATEEMAIL_PASSWORD="your-password" \
--env PRIVATEEMAIL_DISPLAY_NAME="Your Name" \
privateemail \
-- uv run --directory "$PWD" privateemail-mcp
Helper install script
You can also use the included helper script after cloning the repo:
./scripts/install-claude-code.sh "you@yourdomain.com" "your-password" "Your Name"
By default it registers the server at user scope. Pass a fourth argument of project to make it project scoped:
./scripts/install-claude-code.sh "you@yourdomain.com" "your-password" "Your Name" project
Configuration
Environment variables:
PRIVATEEMAIL_ADDRESS- full mailbox addressPRIVATEEMAIL_PASSWORD- mailbox passwordPRIVATEEMAIL_DISPLAY_NAME- display name used for outbound mailPRIVATEEMAIL_IMAP_HOST- defaults tomail.privateemail.comPRIVATEEMAIL_IMAP_PORT- defaults to993PRIVATEEMAIL_SMTP_HOST- defaults tomail.privateemail.comPRIVATEEMAIL_SMTP_PORT- defaults to465PRIVATEEMAIL_MAX_ATTACHMENT_BYTES- maximum attachment payload returned by the server
Example .env:
PRIVATEEMAIL_ADDRESS=you@yourdomain.com
PRIVATEEMAIL_PASSWORD=your-password
PRIVATEEMAIL_IMAP_HOST=mail.privateemail.com
PRIVATEEMAIL_IMAP_PORT=993
PRIVATEEMAIL_SMTP_HOST=mail.privateemail.com
PRIVATEEMAIL_SMTP_PORT=465
PRIVATEEMAIL_DISPLAY_NAME=Your Name
PRIVATEEMAIL_MAX_ATTACHMENT_BYTES=10485760
Usage in Claude Code
Useful Claude Code commands:
claude mcp listclaude mcp get privateemailclaude mcp remove privateemail
Typical flows:
- Read inbox: use
privateemail://inbox/recentor calllist_emails - Review unread mail: use
triage_unread - Draft a reply: use
draft_reply - Send a message now: use
send_email - Reply in-thread: use
reply_email - Save a draft: use
save_draft
Development
uv sync
uv run pytest tests/ -q
Run locally:
uv run privateemail-mcp
PrivateEmail behavior note
SMTP delivery alone does not create a copy in the Sent folder.
This server explicitly appends a copy to Sent after a successful send so the message shows up in PrivateEmail webmail.
Security
- Keep your mailbox password in environment variables, not source control
.envis ignored by git- Consider using a dedicated mailbox or app-specific credential if your setup allows it
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。