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.
MailMCP
Self-hosted email for AI agents. MailMCP connects all your mailboxes, keeps a fast local index of your mail, and lets AI agents (Claude, 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/mailmcp.
# With your own domain: automatic HTTPS certificates (point the domain's DNS at the server first)
curl -fsSL https://github.com/Cloud-Mail-Mcp/mailmcp/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/mailmcp/releases/latest/download/install.sh | shThe installer creates a mailmcp/ 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 mailmcp && docker compose cp mailmcp:/data/master.key ./master.key.backup
Updates
Settings → Updates shows the running version and whether a newer one exists. Update now pulls the new image and restarts MailMCP. 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 mailmcp && 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/mailmcp 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
Claude Code:
claude mcp add --transport http mailmcp http://localhost:8787/mcp --header "Authorization: Bearer mmcp_…"Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"mailmcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://localhost:8787/mcp",
"--header",
"Authorization:${MAILMCP_AUTH}"
],
"env": { "MAILMCP_AUTH": "Bearer mmcp_…" }
}
}
}Any MCP client: Streamable HTTP at /mcp with Authorization: Bearer <key>.
Tools agents get (filtered by their permissions)
Read | Organize | Send | Folders |
|
|
|
|
Search syntax: free text plus from: to: subject:"…" in:<folder> after:YYYY-MM-DD before: has:attachment is:unread is:flagged.
Prompts: triage_inbox, summarize_thread, draft_reply.
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 @mailmcp/admin build
pnpm --filter @mailmcp/server start # http://127.0.0.1:8787/admin/
pnpm --filter @mailmcp/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 @mailmcp/worker seed -- --count 3000 # realistic mail for alice@example.test
pnpm --filter @mailmcp/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.
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.15 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