mailcow MCP
Click on "Deploy 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., "@mailcow MCPcheck my spam and quarantine for replies from Acme and draft a follow-up"
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.
mailcow MCP
A self-hosted remote MCP server for mailcow. Users connect their mailbox to any MCP client (Claude, Cursor, VS Code, Claude Code, …) by URL and sign in with their mailcow account. An AI agent can then send, draft, read and follow up on email: attachments (including PDFs rendered on the server), reply tracking, rescuing replies from spam and quarantine, delivery status and contacts.
Status: 0.x. Runs on a production mailcow server; tested against a real Dovecot/Postfix and a mock of mailcow's API. Configuration may still change before 1.0 (see docs/upgrading.md).
This is a community project. It is not affiliated with or endorsed by the mailcow team or The Infrastructure Company GmbH.
How it works
No installs, no passwords handed to third parties. Add
https://mcp.example.com/mcpto the client, click Sign in with mailcow, sign in on mailcow's own login page (2FA included). mailcow-mcp creates an app password namedMCP: <app> (…)for IMAP, SMTP and contacts only; the user sees it in mailcow and can delete it any time.Each connection acts only as the mailboxes signed into it: one or several (a user can add their other mailboxes to the same connector).
The mailcow API key never sits in an internet-facing process. A small internal broker holds it and can only create and delete app passwords for mailboxes that signed in, and read their quarantine and delivery log, proven by signed capability tokens.
Any MCP client works: Streamable HTTP with the standard MCP authorization (OAuth 2.1, dynamic client registration, PKCE).
Generic mode runs against any IMAP/SMTP server with a password sign-in.
Drafts only, if you like: with
SENDING=drafts_onlyno tool sends mail; the assistant writes drafts and people send them from their mail app.
Tools: list_mailboxes, add_mailbox, remove_mailbox, send_email, save_draft, send_draft, delete_draft, list_folders,
list_messages, search_messages, read_message, get_attachment, find_replies,
get_thread, mark_messages, move_messages, list_spam, rescue_from_junk,
release_from_quarantine, delete_from_quarantine, delivery_status, my_addresses,
find_contacts. See docs/tools.md.
Related MCP server: OutreachEmailMCP
5-minute quick start (mailcow)
On the mailcow server, with a DNS record mcp.example.com pointing to it:
sudo mkdir -p /opt/mailcow-mcp && sudo chown "$USER" /opt/mailcow-mcp && cd /opt/mailcow-mcp
curl -fsSL https://github.com/nitramxx/mailcow-mcp/releases/latest/download/mailcow-kit.tar.gz | tar xz
sudo ./setup-mailcow.sh --hostname mcp.example.com # read-only: checks and shows what it will doIt checks each step against mailcow (DNS, certificate, OAuth2 app, API key, Fail2ban allowlist) and lists what's left, with exact values. Once the mailcow-side steps show ✓:
sudo ./setup-mailcow.sh --hostname mcp.example.com --apply --restart # writes the config, startsUpdating later: sudo ./setup-mailcow.sh update.
The full guide, with a check and troubleshooting for every step: docs/deploy-mailcow.md. Connecting clients: docs/clients.md.
Supported mailcow versions: 2026-07 and later.
Security model in short
Two containers from one image: the app (behind mailcow's nginx; no API key) and the broker (internal network only; the API key; a fixed list of mailbox-scoped operations).
Access tokens last an hour, refresh tokens rotate, credentials are encrypted at rest, tokens are stored as hashes. Connections end after 30 days without use.
Email content returned to the model is marked as untrusted to blunt prompt injection; sending and releasing tools are marked destructive so clients ask first. Don't choose "always allow" for them.
SMTP is always authenticated; mail server certificates are verified (
TLS_VERIFY=falseexists for testing only).
Details, threat model and what is stored: docs/security.md.
Documentation
For contributors: CONTRIBUTING.md, mailcow API notes
Development
Requires uv; integration tests need Docker.
uv sync
scripts/check # lint, format, types, testsRun it locally in generic mode against any IMAP server, then connect an MCP client (for example
MCP Inspector) to http://localhost:8090/mcp:
mkdir -p data
MODE=generic PUBLIC_URL=http://localhost:8090 TRUSTED_PROXIES=127.0.0.1 DATA_DIR=./data \
IMAP_HOST=imap.example.org SMTP_HOST=smtp.example.org \
ENC_KEY=$(uv run mailcow-mcp generate-key) uv run mailcow-mcp serveLicense
This server cannot be deployed
Maintenance
Related MCP Connectors
Shipmail MCP server. Modern email for your business, with an API for your agents.
Email infrastructure for AI agents — send, receive, search, and reply to 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.
Hosted email for AI agents: create inboxes, send, receive, and reply over MCP with scoped API keys
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server that enables email management (send, read, search, delete, etc.) via IMAP/SMTP, compatible with Gmail, Outlook, Yahoo, iCloud, and other standard mail servers.11MIT
- AlicenseNot gradedqualityBmaintenanceMCP server that acts as an email gateway for Gmail and Microsoft 365, enabling AI agents to send and read emails via MCP tools, with SMTP/IMAP and REST APIs for email sequencing and automation.1AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceMCP server providing read and send access to a single IMAP/SMTP mailbox over Streamable HTTP with GitHub OAuth authentication, featuring recipient allowlists for security, email reading/searching/threading, attachments, drafts, folder management, and sending/reply tools.MIT
- AlicenseNot gradedqualityAmaintenanceA self-hosted MCP server that unifies multiple IMAP/SMTP mailboxes into one agentic inbox, enabling agents to list, search, read, and send email through MCP tools.MIT