MailMCP
Uses Backblaze B2 as an S3-compatible blob store for encrypted message bodies, raw source, and attachments.
Uses Cloudflare R2 as an S3-compatible blob store for encrypted mail content and attachments.
Connects cPanel-hosted mailboxes over IMAP/SMTP, letting agents read, search, organize, and send email.
Connects Gmail mailboxes via app password over IMAP/SMTP for reading, searching, organizing, and sending mail; Gmail API support is planned.
Connects iCloud mailboxes over IMAP/SMTP for reading, searching, organizing, and sending email.
Uses MinIO as an S3-compatible blob store for encrypted mail content and attachments.
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.
Cloud Mail MCP
Self-hosted email for AI agents. Cloud Mail MCP connects all your mailboxes, keeps a fast local index of your mail, and lets AI agents (Claude, ChatGPT, or your own app) read, search, organize and send mail over MCP. Each agent has its own permissions per mailbox, sends can wait for your approval, and every action is recorded in an audit log.
Status: v0.1, early but working end to end for IMAP/SMTP mailboxes (cPanel and other hosting mail, Apple iCloud, Gmail via app password). Microsoft 365 and the Gmail API are next. See docs/SPEC.md.
Install on your server
You need a Linux server (or any machine) with Docker. If you run your own fork, use your repository in place of Cloud-Mail-Mcp/cloud-mail-mcp.
# With your own domain: automatic HTTPS certificates (point the domain's DNS at the server first)
curl -fsSL https://github.com/Cloud-Mail-Mcp/cloud-mail-mcp/releases/latest/download/install.sh | sh -s -- --domain mail.example.com
# Without a domain: plain HTTP on port 8787 (trusted networks only)
curl -fsSL https://github.com/Cloud-Mail-Mcp/cloud-mail-mcp/releases/latest/download/install.sh | shThe installer creates a cloud-mail-mcp/ folder with compose.yml and a .env (it generates a random database password), then starts everything. Open the address it prints and the setup wizard walks you through it:
Your account: the owner login.
Server: a name, and the public URL your AI clients will use.
Mail storage: this server's disk, or S3-compatible storage (AWS S3, Cloudflare R2, Backblaze B2, MinIO).
Sync: how much mail to download.
Finish: back up the encryption key, then add your first mailbox.
The wizard only appears until it's finished. Everything after that is managed in the admin panel.
Installer options: --domain NAME, --dir PATH, --port N, --edge (follow every change instead of stable releases), --auto-update (apply updates daily), --repo OWNER/NAME.
Back up your encryption key. It encrypts every saved mail password and all stored mail, and it is deliberately not in the database:
cd cloud-mail-mcp && docker compose cp mailmcp:/data/master.key ./master.key.backup
Other ways to install:
Enhance: GitHub deploy plus Node.js; no build step, and updates arrive automatically.
cPanel, Plesk or any Node.js host: the prebuilt
cloud-mail-mcp-nodezip.Easypanel, Coolify, Dokploy, CapRover, Portainer: the Docker image.
Updates
Settings → Updates shows the running version and whether a newer one exists. Update now pulls the new image and restarts Cloud Mail MCP. Your data, settings and key are kept, and database changes apply automatically. You can also choose:
Stable releases (tagged versions) or Every change (the
edgebuild ofmain).Daily automatic updates (
AUTO_UPDATE=truein.env).
From the command line: cd cloud-mail-mcp && docker compose pull && docker compose up -d.
Publishing your own version (forks)
Nothing is tied to one GitHub account. Fork the repo and the included workflows publish everything under your fork:
Every push to
mainbuildsghcr.io/<you>/<repo>:edge.Every tag like
v1.2.0builds:1.2.0and:latest, and creates a GitHub release withinstall.shandcompose.ymlattached, already pointing at your repository.Installs made from your releases check your repository for updates.
One-time step after the first build: on GitHub open Packages → your image → Package settings and set visibility to Public, so servers can pull it without logging in.
Try it locally from source
git clone https://github.com/Cloud-Mail-Mcp/cloud-mail-mcp mailmcp && cd mailmcp
docker compose -f deploy/docker-compose.yml up -d # builds the image locallyThen open http://localhost:8787.
Related MCP server: email-mcp-server
Connect Claude, ChatGPT and other AI apps
Your MCP server URL is your Cloud Mail MCP address plus /mcp, e.g. https://mail.example.com/mcp. Apps that support MCP sign-in (OAuth) only need that URL: they send you to a Cloud Mail MCP page where you choose which mailboxes the app can use and what it may do in each. Claude and ChatGPT require an https:// address.
App | How |
Claude (web, Desktop, mobile) | Settings → Connectors → Add custom connector → paste the URL → Connect |
ChatGPT | Settings → Apps & Connectors → Advanced → turn on Developer mode, then create a connector with the URL and OAuth |
Claude Code |
|
Cursor, VS Code, others | Add a remote (HTTP) MCP server with the URL |
Connected apps appear under Agents, where you can change their access, disable them or remove them. The admin panel's Agents page shows your exact URL and these steps.
Apps without MCP sign-in: create an agent with an API key under Agents and send it as a header:
claude mcp add --transport http cloud-mail-mcp https://mail.example.com/mcp --header "Authorization: Bearer cmcp_…"Or, for clients that only run local servers (claude_desktop_config.json style):
{
"mcpServers": {
"cloud-mail-mcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mail.example.com/mcp",
"--header",
"Authorization:${CLOUD_MAIL_MCP_AUTH}"
],
"env": { "CLOUD_MAIL_MCP_AUTH": "Bearer cmcp_…" }
}
}
}Tools agents get (filtered by their permissions)
Read | Organize | Send | Folders |
|
|
|
|
Search syntax: free text plus from: to: subject:"…" in:<folder> tag:<tag> after:YYYY-MM-DD before: has:attachment is:unread is:flagged.
Prompts: triage_inbox, summarize_thread, draft_reply.
Spam and AI sorting
Spam / Not spam in Mail (and the
mark_spamtool) moves mail to the account's Spam folder, where Gmail, iCloud and many other servers learn from it, and sets the$Junkkeyword that mail apps use. "Always send mail from this sender to Spam" blocks a sender; manage the list under Spam & sorting.Each message shows what your mail server reported about it: whether the sender was verified (SPF, DKIM, DMARC) and any spam score, with a warning on suspicious mail.
AI sorting (optional, uses your Anthropic API key) tags each new message by what it is: personal, solicitation, marketing, newsletter, social media, notifications, receipts, security, spam. Tags are editable, each can archive, mark read or move to Spam automatically, and your corrections teach it. Filter Mail by tag, search with
tag:social, or ask Claude to act on a whole kind of mail ("delete all social media emails").
Moving to a new mail host
Changing hosting providers? Add the address twice under Accounts, once with the old server's settings and once with the new one. Cloud Mail MCP labels each login with its server name (you can rename the labels, e.g. "Old host" / "New host"). Then open Migrations:
Pick the old account as Copy from and the new one as Copy to. Preview folders shows where each folder will go (Inbox, Sent, Trash and so on are matched even when they're named differently, and missing folders are created).
Choose Both ways if mail may still arrive at the old server while DNS changes, and keep Keep copying new mail on.
Start migration. Every folder is copied with its read and flagged state. Messages already on the other side are skipped (matched by Message-ID), and nothing is ever deleted, so it's safe to run again. New mail is copied every couple of minutes (
MIGRATION_INTERVAL_SECONDS, default 120).When your MX records point to the new server and the old one has gone quiet, click Finish.
If a password or server address changes later, update it on the account's page under Login & server settings. Cloud Mail MCP tests the new settings before saving them.
How it's built
Postgres: metadata, permissions, and the full-text search index. Shared tables keyed by account, benchmarked in SPEC §4a.
Blob store: message bodies, raw source and attachments, compressed and AES-256-GCM encrypted per account. Stored on local disk or any S3-compatible service (configured in Settings).
Worker: pg-boss job queue, newest-first resumable sync, IMAP IDLE for instant new mail, a daily full reconcile, and Gmail's daily download limit respected.
Modules: every provider is a plug-in module behind one Module API.
apps/server HTTP: MCP endpoint, REST API, admin panel
apps/worker Sync jobs, IDLE watchers, scheduler
apps/admin Admin panel (React + Vite + Tailwind)
packages/core Sync engine, mail service, permissions, approvals, crypto
packages/db Drizzle schema + migrations
packages/search Search syntax + Postgres search driver
packages/storage Blob store drivers (fs, s3) + encryption
packages/module-sdk The Module API
modules/imap IMAP/SMTP connector
deploy/ compose.yml (production), install.sh, docker-compose.yml (development)
.github/workflows CI, and image/release publishingDevelopment
Requires Node 22+ (nvm use), Docker, and pnpm (via corepack enable).
pnpm install
cp .env.example .env # only the database URL
pnpm db:up && pnpm db:migrate # Postgres on localhost:5433
pnpm --filter @cloud-mail-mcp/admin build
pnpm --filter @cloud-mail-mcp/server start # http://127.0.0.1:8787/admin/
pnpm --filter @cloud-mail-mcp/worker start # in another terminalpnpm dev runs everything with live reload (admin on http://localhost:5173/admin/).
Test mail server. GreenMail provides three throwaway mailboxes (see deploy/docker-compose.yml):
docker compose -f deploy/docker-compose.yml --profile testmail up -d greenmail
pnpm --filter @cloud-mail-mcp/worker seed -- --count 3000 # realistic mail for alice@example.test
pnpm --filter @cloud-mail-mcp/worker sync-once # sync all accounts in the foregroundIn the admin panel choose Other IMAP server with host 127.0.0.1, IMAP 3143, SMTP 3025, TLS off, user alice@example.test / alice-pass-123.
The dev stack's Compose project is mailmcp-dev, so it never collides with a production install on the same machine.
Checks: pnpm typecheck · pnpm lint · pnpm test. Tests include integration and end-to-end suites against GreenMail; they skip themselves if it isn't running.
Releasing a new version
One command updates every install method together:
pnpm release 0.2.0 --dry-run # preview
pnpm release 0.2.0 # bump versions, check, tag v0.2.0, pushIt checks that main is clean, in sync and green on CI. It then bumps the version (including the Easypanel template's pinned image), runs lint and typecheck, and pushes the tag. GitHub Actions builds the Docker image and the Node.js bundle. Only if both succeed does it publish them all at once:
Docker image
:0.2.0/:latestthe
distbranch for Enhance and git-deploy hoststhe GitHub release with the installer, Compose file and zip
Installs see the update after that, through Settings → Updates, auto-deploy, or the updater. Every push to main publishes the edge image and the dist-edge branch the same way.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Email inboxes for AI agents: send, receive, reply, search, and manage threaded email over MCP.
Hosted email MCP for your own Gmail, Outlook.com, Microsoft 365, iCloud or IMAP inbox: read, search, draft, reply in thread, forward and file mail. It moves or flags up to 500 messages in one call, and a send leaves exactly one copy in Sent. A calendar is a separate connection, and connecting one adds diary and scheduling tools.
Email and optional phone for AI agents: send, receive, search, draft and call over MCP.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceConnects any IMAP/SMTP mailbox to AI agents via MCP, enabling email read, search, send, reply, and management through natural language.14 npmMIT
- FlicenseBqualityDmaintenanceEnables external AI agents to read, send, and manage email over IMAP/SMTP via MCP, including inbox listing, search, drafts, scheduled/batch sending, and operations like reply, archive, and labels.303-
- AlicenseBqualityBmaintenanceConnects MCP clients to any IMAP/SMTP email account, enabling email search, reading, sending, replying, forwarding, flagging, moving, and folder management via natural language.17MIT
- AlicenseNot gradedqualityCmaintenanceConnects MCP-compatible AI assistants to any IMAP/SMTP mailbox, enabling email search, reading, folder management, and sending with automatic saving to Sent.1MIT