Skip to main content

mcp-mailcow

PyPI npm License: MIT

Model Context Protocol server for Mailcow. Pilot your Mailcow instance from Claude (or any MCP-compatible client): read/send mail, manage mailboxes, aliases, domains, app passwords.

This is a BYOK (Bring Your Own Keys) package — install it on your own machine, point it at your Mailcow, use your credentials.

Features

User mode (mailbox operations)

  • Read inbox, search messages, download attachments
  • Send mail, reply to messages
  • Mark read/unread/flagged, move, delete

Admin mode (server operations)

  • Manage mailboxes (create / list / update / delete / quota)
  • Manage aliases (create / list / delete)
  • Manage domains (list / create)
  • Manage app passwords (list / create / delete with protocol scoping)
  • Quota reports, deliverability tests, server status

Install

# Zero-install with uvx (recommended)
uvx mcp-mailcow --mode user

# Or pip install
pip install mcp-mailcow

Node / TypeScript

npm install -g mcp-mailcow
# or use npx
npx mcp-mailcow --mode user

Configuration

Claude Desktop / Claude Code

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "mailcow-mailbox": {
      "command": "uvx",
      "args": ["mcp-mailcow", "--mode", "user"],
      "env": {
        "MAILCOW_HOST": "mail.example.com",
        "MAILCOW_MAIL_USER": "you@example.com",
        "MAILCOW_MAIL_PASS": "your-app-password"
      }
    },
    "mailcow-admin": {
      "command": "uvx",
      "args": ["mcp-mailcow", "--mode", "admin"],
      "env": {
        "MAILCOW_ADMIN_URL": "https://mail.example.com",
        "MAILCOW_ADMIN_API_KEY": "your-api-key"
      }
    }
  }
}

You can run both modes simultaneously (each gets its own server entry).

Environment variables

User mode

Variable Required Description
MAILCOW_HOST yes Mailcow hostname (e.g. mail.example.com)
MAILCOW_MAIL_USER yes Full email address (e.g. you@example.com)
MAILCOW_MAIL_PASS yes App password (recommended) or main password
MAILCOW_IMAP_PORT no Default 993 (IMAPS)
MAILCOW_SMTP_PORT no Default 587 (STARTTLS)

Admin mode

Variable Required Description
MAILCOW_ADMIN_URL yes Base URL (e.g. https://mail.example.com)
MAILCOW_ADMIN_API_KEY yes Mailcow API key (admin → Configuration → Access → API)

Common

Variable Default Description
MCP_MAILCOW_AUDIT_LOG ~/.local/state/mcp-mailcow/audit.log Audit log path (JSONL)
MCP_MAILCOW_TLS_VERIFY true Set to false only for self-signed certs (not recommended)

Security best practices

  1. Use app passwords, not your main mailbox password. In Mailcow: mailbox → app passwords → create, scope to IMAP+SMTP only.

  2. Use a Read-Only API key for admin mode if you only need to query. (Set API_KEY_READ_ONLY instead of API_KEY in mailcow.conf.)

  3. Audit log review: tail ~/.local/state/mcp-mailcow/audit.log periodically.

  4. Destructive operations (mailbox_delete, alias_delete) require an explicit confirm: true parameter. The server refuses without it.

Development

This is a monorepo with parallel Python and TypeScript implementations. Both share a common tool schema (tools-schema.yaml) as source of truth.

mcp-mailcow/
├── tools-schema.yaml       ← source of truth (read by both impls at build time)
├── py/                     ← Python implementation (PyPI)
├── node/                   ← TypeScript implementation (npm)
└── shared/                 ← shared mocks, integration tests

See CONTRIBUTING.md for setup and contribution guidelines.

License

MIT — see LICENSE.

Metadata

Release files for mcp-mailcow 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-mailcow 1.0.3
File Size Uploaded Provenance Actions
mcp_mailcow-1.0.3.tar.gz 39.0 kB Without provenance Details for mcp_mailcow-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcp-mailcow 1.0.3
File Interpreter ABI Platform Actions
mcp_mailcow-1.0.3-py3-none-any.whl Python 3 none any Details for mcp_mailcow-1.0.3-py3-none-any.whl

Total release size: 78.8 kB

Release files / mcp_mailcow-1.0.3.tar.gz

Download URL mcp_mailcow-1.0.3.tar.gz
Size 39.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4afbd4564e9e4a55b3e8950ab8bc6a4ce6b176cedcbc225f3c750de9c48c8a63
BLAKE2b-256 checksum
How to use checksums
edbdf968a4840b592cb63132809af2121b03d69b72989bd36037f640f8b94995
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / mcp_mailcow-1.0.3-py3-none-any.whl

Download URL mcp_mailcow-1.0.3-py3-none-any.whl
Size 39.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1656d25c0292efba1906ee2e9e88dc4cc5a809f6b8b38961362a1c413f14b40e
BLAKE2b-256 checksum
How to use checksums
ea785c07a13016274fcdcbad1bf761528877cfa40f7722f04a7a9de48bf27f2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for mcp-mailcow 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page