cpanel-mail-mcp
Provides tools for working with cPanel-hosted mailboxes via IMAP, SMTP, and CalDAV. Supports reading mail (listing folders, listing/searching messages, fetching messages and attachments), sending and drafting mail (send, reply with reply-all and quoting, forward with attachments, create drafts), organizing mail (flags, move, archive, spam, trash, folder creation/renaming/deletion, emptying trash), and optional CalDAV calendar operations (list calendars, list/create/update/delete events).
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
__ __ _ ___ _ __ __ ____ ____
| \/ | / \ |_ _| | | \/ |/ ___| _ \
| |\/| | / _ \ | || | | |\/| | | | |_) |
| | | |/ ___ \ | || |___ | | | | |___| __/
|_| |_/_/ \_\___|_____| |_| |_|\____|_|cpanel-mail-mcp
Connect your cPanel mailbox to Claude. · cPanel posta kutunu Claude'a bağla.
IMAP · SMTP · CalDAV · stdio MCP
English
A stdio MCP server for cPanel mailboxes. It plugs straight into Claude Code and the Claude desktop app; no OAuth shim, reverse proxy or always-on server needed.
Step-by-step guide for non-technical teammates: SETUP.md · Türkçe: KURULUM.md
🚀 Install
npx -y --allow-remote=all https://github.com/Burak-Kumas/cpanel-mail-mcp/archive/refs/heads/main.tar.gz setupStep | What happens |
1 | The wizard asks for the cPanel mailbox username, password, server and IMAP/SMTP ports. Server and ports come pre-filled with the cPanel defaults. |
2 | Before saving, it verifies them with a real IMAP and SMTP login and detects whether a calendar is available. |
3 | It registers the server with both Claude Code and the desktop app. |
The server is installed under ~/.cpanel-mail-mcp/ (copied to a permanent
directory because the npx cache is temporary), and settings are kept in
~/.cpanel-mail-mcp/.env with mode 600.
Installation uses GitHub's.tar.gz archive instead of git. npm 12 and later
refuse both github: sources (EALLOWGIT) and URL tarballs (EALLOWREMOTE)
by default; --allow-remote=all allows the tarball for this one run only and
leaves your global npm config untouched. Don't use sudo.
🧰 Tools
Group | Tools |
📥 Read |
|
✉️ Write |
|
🗂️ Organize |
|
📁 Folders |
|
📅 Calendar |
|
Permanent delete: delete_message is only exposed when ALLOW_DELETE=true.
It is off by default; regular deletion uses trash_message, which moves mail
to Trash and can be undone. The INBOX folder cannot be deleted.
🔒 Design decision
The server runs one mailbox per process. Everyone runs their own instance on their own machine with their own credentials; the password never leaves that machine.
A central deployment was deliberately ruled out: cPanel mail has no OAuth or app passwords, so a central server would have to store everyone's plain IMAP password. That password grants full rights to read the mailbox and send mail as that person; a single breach would expose the whole team's correspondence.
🛠️ Development
git clone https://github.com/Burak-Kumas/cpanel-mail-mcp.git
cd cpanel-mail-mcp
npm install
npm run build
cp .env.example .env # fill in your own values
npm startbuild/ is committed so the npx tarball install works without a build step.
After changing the source, run npm run build and commit the build/ output
too.
Settings are read from the
.envfile in the server's own directory; real environment variables take precedence when set.cPanel's
cpdavdreturns the wronghrefin multistatus responses, so CalDAV discovery is done by hand (tsdav's automatic discovery fails on these servers with "cannot find homeUrl").The drafts folder is found via the IMAP
SPECIAL-USEflag; on cPanel it isINBOX.Drafts, notDrafts.The desktop app does not load the user's shell, so registration uses an absolute path instead of
node(nvm is a shell function and does not resolve in the desktop app).SMTP delivery does not put anything in Sent; the sent message is written there separately with IMAP
APPEND. The message is compiled once and both sent and filed, so both copies share the sameMessage-ID.When sending
raw, nodemailer does not read recipients from the headers; the envelope is passed separately viaMailComposer.getEnvelope()(it also carries Bcc).Message bodies are decoded with
mailparser; slicing headers out of the raw source produced unreadable output for multipart and base64-encoded messages.
Related MCP server: Email MCP Server
Türkçe
cPanel posta kutuları için stdio MCP sunucusu. Claude Code ve Claude masaüstü uygulamasına doğrudan bağlanır; OAuth shim, reverse proxy veya sürekli açık bir sunucu gerekmez.
Ekip üyeleri için adım adım kurulum rehberi: KURULUM.md
Not: Kurulum sihirbazı ve araç çıktıları İngilizcedir.
🚀 Kurulum
npx -y --allow-remote=all https://github.com/Burak-Kumas/cpanel-mail-mcp/archive/refs/heads/main.tar.gz setupAdım | Ne olur |
1 | Sihirbaz cPanel posta hesabının kullanıcı adını, şifresini, sunucusunu ve IMAP/SMTP portlarını sorar. Sunucu ve portlar cPanel varsayılanlarıyla dolu gelir. |
2 | Kaydetmeden önce gerçek bir IMAP ve SMTP girişiyle doğrular, takvimin var olup olmadığını kendisi tespit eder. |
3 | Hem Claude Code'a hem masaüstü uygulamasına kaydeder. |
Kurulum ~/.cpanel-mail-mcp/ altına yapılır (npx önbelleği geçici olduğu için
kalıcı bir dizine kopyalanır), ayarlar ~/.cpanel-mail-mcp/.env dosyasında
600 izniyle tutulur.
Kurulum git yerine GitHub'ın.tar.gz arşivinden yapılır. npm 12 ve sonrası
hem github: (EALLOWGIT) hem de URL'den paket indirmeyi (EALLOWREMOTE)
varsayılan olarak reddeder; --allow-remote=all yalnızca bu tek çalıştırma
için tarball'a izin verir, genel npm ayarını değiştirmez. sudo kullanmayın.
🧰 Araçlar
Grup | Araçlar |
📥 Okuma |
|
✉️ Yazma |
|
🗂️ Düzenleme |
|
📁 Klasörler |
|
📅 Takvim |
|
Kalıcı silme: delete_message yalnızca ALLOW_DELETE=true ise açılır.
Varsayılan kapalıdır; normal silme trash_message ile çöp kutusuna taşır ve
geri alınabilir. INBOX klasörü silinemez.
🔒 Tasarım kararı
Sunucu process başına tek posta kutusu çalışır. Herkes kendi makinesinde kendi kimlik bilgisiyle bir örnek çalıştırır; şifre o makineden hiç çıkmaz.
Merkezî bir kurulum bilinçli olarak tercih edilmedi: cPanel'de mail için OAuth ya da uygulama şifresi yoktur, dolayısıyla merkezî bir sunucu herkesin düz IMAP şifresini saklamak zorunda kalırdı. O şifre kutuyu okuma ve o kişi adına mail gönderme yetkisinin tamamıdır; tek bir ihlal tüm ekibin yazışmasını açar.
🛠️ Geliştirme
git clone https://github.com/Burak-Kumas/cpanel-mail-mcp.git
cd cpanel-mail-mcp
npm install
npm run build
cp .env.example .env # kendi değerlerini gir
npm startbuild/ depoya dahildir; npx ile tarball kurulumunun derleme adımı olmadan
çalışabilmesi için gereklidir. Kaynak değiştirdiğinde npm run build çalıştırıp
build/ çıktısını da commit et.
Ayarlar sunucunun kendi klasöründeki
.envdosyasından okunur; gerçek ortam değişkenleri verilirse onlar önceliklidir.cPanel'in
cpdavdservisi multistatus yanıtlarında yanlışhrefdöndürdüğü için CalDAV keşfi elle yapılır (tsdav'ın otomatik keşfi bu sunucularda "cannot find homeUrl" hatası verir).Taslak klasörü IMAP
SPECIAL-USEbayrağından bulunur; cPanel'de bu klasörDraftsdeğilINBOX.Draftsşeklindedir.Masaüstü uygulaması kullanıcının kabuğunu yüklemez, bu yüzden kayıt sırasında
nodeyerine mutlak yol kullanılır (nvm bir kabuk fonksiyonudur ve masaüstü uygulamasında çözülmez).SMTP teslimatı Gönderilenler'e bir şey koymaz; gönderilen mesaj IMAP
APPENDile oraya ayrıca yazılır. Mesaj bir kez derlenip hem gönderilir hem kaydedilir, böylece iki kopyanınMessage-ID'si aynı olur.rawile gönderirken nodemailer alıcıları başlıklardan okumaz; envelopeMailComposer.getEnvelope()ile ayrıca verilir (Bcc'yi de o taşır).Mesaj gövdeleri
mailparserile çözülür; ham kaynaktan başlık kesmek çok parçalı ve base64 kodlu mesajlarda okunaksız çıktı veriyordu.
This server cannot be deployed
Maintenance
Related MCP Connectors
Email for AI agents: read, search and send from your Gmail, Outlook, Yahoo, iCloud or IMAP inbox.
Email, calendar and contacts for AI agents: Gmail, Microsoft 365 and IMAP accounts behind one API.
Email inboxes and calendars for AI agents: send, receive, search, draft and schedule.
Email inboxes and calendars for AI agents: send, receive, search, draft and schedule.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to read, search, send, schedule, and organize email across multiple IMAP/SMTP accounts, including drafts, provider-aware labels, real-time inbox watching, verification-code capture, and analytics. Supports OAuth2, calendar extraction, and both local stdio and networked Streamable HTTP access.20 npmISC
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to read, search, send, reply, forward, organize, schedule, and analyze email across multiple IMAP/SMTP accounts, with drafts, provider-aware labels, calendar extraction, verification-code catching, and a real-time inbox watcher. It runs over stdio or Streamable HTTP, with TLS, OAuth2, provider auto-detection, and a guided setup wizard.20 npmISC
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to read, search, send, reply, forward, schedule, and analyze email across multiple IMAP/SMTP accounts, with drafts, templates, provider-aware labels, bulk operations, attachment handling, calendar extraction, and real-time IMAP IDLE watching. Connections are secured with TLS/STARTTLS, OAuth2 support, and rate limiting, and it can run over stdio locally or Streamable HTTP for networked access.20 npmISC
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants to read, search, send, schedule, manage, and analyze mail across multiple IMAP/SMTP accounts, including drafts, provider-aware labels, real-time IDLE triage, verification-code capture, and calendar extraction. Runs over stdio for local clients or Streamable HTTP for networked access, with a guided setup wizard and OAuth2 support.-