Skip to main content
Glama
leolilley

Mailcow MCP Server

by leolilley

๐Ÿ“ง Mailcow MCP Server

Model Context Protocol (MCP) server for complete Mailcow email server management

TypeScript MCP Node.js License

A comprehensive TypeScript implementation that provides AI models with full control over Mailcow email servers through the Model Context Protocol. Manage domains, mailboxes, queues, sync jobs, and send emails - all with a single, secure API.

โœจ Features

๐ŸŽฏ Complete Email Management - 20 MCP tools for full Mailcow control
๐Ÿ”’ Enterprise Security - API key authentication with granular permissions
โšก High Performance - Built with TypeScript for speed and reliability
๐Ÿ“Š Comprehensive Logging - Full audit trail and monitoring capabilities
๐Ÿงช Well Tested - Extensive test suite with >85% coverage on core modules
๐Ÿš€ Production Ready - Used in production environments

Related MCP server: pyfastmail-mcp

๐Ÿš€ Quick Start

# 1. Install dependencies
npm install

# 2. Configure environment  
cp .env.example .env
# Edit .env with your Mailcow server details

# 3. Start the server
npm run build && npm start

๐ŸŽ‰ That's it! Your MCP server is now running with 20 tools ready for AI integration.

๐Ÿ‘‰ Detailed setup: Quick Start Guide

๐Ÿ› ๏ธ Available Tools

Email Management (18 tools)

  • Domains (5): List, create, update, delete, get details

  • Mailboxes (5): List, create, update, delete, get details

  • Email Sending (3): Send emails, check delivery status, get templates

  • Queue Management (6): List, flush, delete, hold, release queue items

  • Sync Jobs (7): Manage email migration and synchronization

  • Log Analysis (4): System, error, performance, and access logs

System Tools (3 tools)

  • Health Check: Server status and metrics

  • Configuration: Current settings (sanitized)

  • API Test: Validate Mailcow connectivity

๐Ÿ“Š Current Status

๐ŸŸข MVP Complete - Full email server management capability
๐ŸŸข Production Ready - Deployed and tested in live environments
๐ŸŸข Well Documented - Comprehensive guides and API reference

Component

Status

Coverage

Tools

Domain Management

โœ… Complete

85%

5 tools

Mailbox Management

โœ… Complete

87%

5 tools

Email System

โœ… Complete

MVP

3 tools

Queue Management

โœ… Complete

New

6 tools

Sync Jobs

โœ… Complete

New

7 tools

Log Management

โœ… Complete

New

4 tools

System Tools

โœ… Complete

100%

3 tools

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   AI Models     โ”‚    โ”‚   MCP Client    โ”‚    โ”‚   Your App      โ”‚
โ”‚   (Claude, etc) โ”‚โ—„โ”€โ”€โ–บโ”‚   (Claude CLI)  โ”‚โ—„โ”€โ”€โ–บโ”‚   Integration   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                โ”‚
                                โ–ผ
                       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                       โ”‚  MCP Protocol   โ”‚
                       โ”‚   (JSON-RPC)    โ”‚
                       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                โ”‚
                                โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Mailcow MCP Server                           โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Tool Registry โ”‚ โ”‚ Auth Manager  โ”‚ โ”‚   20 MCP Tools        โ”‚  โ”‚
โ”‚  โ”‚ & Validation  โ”‚ โ”‚ & Security    โ”‚ โ”‚ โ€ข Domain Management   โ”‚  โ”‚
โ”‚  โ”‚               โ”‚ โ”‚               โ”‚ โ”‚ โ€ข Mailbox Management  โ”‚  โ”‚
โ”‚  โ”‚               โ”‚ โ”‚               โ”‚ โ”‚ โ€ข Email & Queues      โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                โ”‚                                โ”‚
โ”‚                                โ–ผ                                โ”‚  
โ”‚                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                    โ”‚
โ”‚                    โ”‚     API Client        โ”‚                    โ”‚
โ”‚                    โ”‚   (HTTP + Auth)       โ”‚                    โ”‚
โ”‚                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                โ”‚
                                โ–ผ
                       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                       โ”‚  Mailcow Server โ”‚
                       โ”‚   REST API      โ”‚
                       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“š Documentation

Document

Purpose

Quick Start

Get running in 5 minutes

Architecture

System design and components

API Reference

Complete tool documentation

Configuration

Environment setup guide

Testing Guide

Testing framework and practices

Developer Resources

๐Ÿ”ง Development

# Development mode with auto-reload
npm run dev

# Run tests
npm test

# View test coverage
npm run test:coverage

# Lint and format
npm run lint
npm run format

# Build for production
npm run build

๐ŸŒŸ Example Usage

Send an Email

// Send welcome email with template
const result = await mcp.call('send_email', {
  from: 'admin@company.com',
  to: ['user@company.com'],
  subject: 'Welcome to our service!',
  body: 'Your account is ready to use.',
  body_type: 'plain'
});

// Check delivery status  
await mcp.call('check_email_status', { 
  queue_id: result.email_details.queue_id 
});

Manage Domains

// List all active domains
const domains = await mcp.call('list_domains', { 
  active_only: true 
});

// Create new domain
await mcp.call('create_domain', {
  domain: 'newclient.com', 
  description: 'New client domain',
  quota: 5368709120  // 5GB
});

Monitor System

// Check server health
const health = await mcp.call('health_check');

// Get recent error logs
const errors = await mcp.call('get_error_logs', {
  limit: 50,
  start_time: '2023-12-01T00:00:00.000Z'
});

๐Ÿ”’ Security

  • API Key Authentication with Mailcow integration

  • Granular Permissions system (read/write/delete by resource)

  • Input Validation with JSON Schema enforcement

  • Audit Logging for all operations

  • HTTPS Enforcement and SSL certificate validation

  • Rate Limiting to prevent abuse

๐Ÿค Contributing

  1. Fork the repository

  2. Create a feature branch: git checkout -b feature/amazing-feature

  3. Add tests for your changes

  4. Ensure all tests pass: npm run test:all

  5. Commit your changes: git commit -m 'Add amazing feature'

  6. Push to the branch: git push origin feature/amazing-feature

  7. Open a Pull Request

See CONTRIBUTING.md for detailed guidelines.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ†˜ Support

๐Ÿ™ Acknowledgments


Related MCP Connectors

  • Fully-managed email as MCP tools - register domains, real mailboxes, send and receive mail.

  • Your agent needs a mailbox of its own โ€” to receive, thread, draft and send, with attachments, without borrowing your personal inbox or your company's SMTP. **What you can ask for** โ€ข "Create an inbox for this agent and tell me its address." โ€ข "Read the new messages in this thread and draft a reply." โ€ข "Send this message with the attachment and wait for the response." โ€ข "Search this inbox for everything from that domain." โ€ข "Show delivery metrics and the events on this inbox." **How to use it** Point any MCP client at https://mcp.aisa.one/mail/mcp and sign in with OAuth โ€” there is no key to create or paste. 49 tools: create and delete inboxes, list and read messages, raw message bodies, attachments, threads, drafts and draft attachments, send and reply, message search, inbox events, metrics, and list entries โ€” reads and writes. **Why this rather than the source** A real inbox an agent owns, rather than an SMTP credential it borrows from a human. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Find the contact elsewhere in the catalogue, then write to them from here โ€” without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/sales/mcp finds the person to write to.

  • Hosted email for AI agents: create inboxes, send, receive, and reply over MCP with scoped API keys

  • Email infrastructure for AI agents โ€” send, receive, search, and reply to email over MCP.

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Enables AI assistants to manage Migadu email hosting services through natural language, including creating mailboxes, setting up aliases, configuring autoresponders, and handling bulk operations efficiently.
    35
    22 PyPI
    16
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    An MCP server that provides AI assistants with full access to Fastmail accounts for managing email, contacts, calendars, and file storage. It implements 42 tools across JMAP, CardDAV, CalDAV, and WebDAV protocols to enable comprehensive account interaction through natural language.
    48
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    An MCP server for the PostStack email API that enables AI assistants to send transactional emails, manage contacts, handle inbound email threads, and perform deliverability checks through 84 curated tools.
    84
    24 npm
    1
    MIT
  • A
    license
    C
    quality
    D
    maintenance
    Enables AI agents to manage FortiMail email security through the FortiMail Engine API, providing tools for domains, users, queues, reports, logs, and SMTP configuration.
    56
    1
    MIT