MailFathom logo

MailFathom

Self-hosted email archive that syncs IMAP to PostgreSQL and exposes search, cited answers, and email actions over MCP.

Install MailFathom

Run the project’s own setup commands, in order.

Setup steps from the project

MailFathom installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    git clone https://github.com/fathomise/MailFathom.git
    
  2. 2. Install
    cd MailFathom
    
  3. 3. Install
    scripts/quick-start-compose.sh
    

Overview

The MailFathom MCP server synchronizes IMAP accounts into a self-hosted PostgreSQL database and exposes the local copy to AI agents over MCP. Agents can search and read messages, ask questions with message citations, manage flags and drafts, use a database-backed contact book, and send or cancel email when explicitly enabled. Reading operates on the local archive without marking messages read on the mail server, while outbound actions are separately permissioned and queued. Reach for it when an agent needs controlled access to one or more mailboxes without making the mail provider the read path.

Use cases

  • Search synchronized mail from an AI client
  • Ask questions and receive citations to source messages
  • Create and manage drafts without sending them
  • Send, reply to, or forward email under account policies
  • Maintain contacts in the local PostgreSQL database

Key features

  • IMAP synchronization into PostgreSQL
  • Local email search and content retrieval
  • Cited answers from archived messages
  • Drafting, sending, replying, and forwarding
  • Queued-send status and cancellation
  • Database-backed contact tools

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

12/12 checks healthy over the last 48d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars22Stargazers on the source repository.
Last commit10d agoMost recent push to the default branch.

How MailFathom works

What MailFathom MCP server does

The MailFathom MCP server keeps a local archive of mail from configured IMAP accounts and makes that archive available to MCP-compatible AI clients. PostgreSQL stores the synchronized copy, which MailFathom indexes for retrieval. This design lets agents answer questions from locally stored messages rather than querying the mailbox for every read.

The server covers both read and write workflows. Agents can inspect accounts, list or search messages, retrieve message content, and ask questions that cite the messages used for an answer. They can also change flags, create or update drafts, send messages, reply, forward, inspect queued outgoing mail, or cancel a send when the relevant account permissions allow those actions.

How it works

MailFathom imports mailbox data through IMAP and serves tools through the Model Context Protocol. Read operations use the database copy and report the freshness of that copy. They do not contact the mail server for each request and cannot set the remote read flag.

Outbound mail follows a separate path. A send is recorded and queued instead of being completed during the tool call. A delivery process attempts the send, and cancellation is possible only during the period before delivery leaves the system. Sending remains disabled unless it is enabled for the account and credential, and deployments configured as read-only reject it.

Search ranks lexical matches. Embedding-based similarity can also be used after an embedding model is configured. MailFathom stores its own contact records in the database; these are distinct from an address book maintained by the mail provider.

Setup and configuration

The recommended initial deployment uses Docker Compose. Its setup provisions PostgreSQL, publishes the services on loopback by default, asks for mailbox details, starts the stack, and can apply the database schema. The quick-start flow is intended for evaluation rather than production operation: its generated setup serves one machine over plain HTTP, keeps credentials under the checkout, and does not create backups.

The project also documents Compose, Podman Quadlet, Kubernetes, and a native systemd process. A local Aspire development path provisions PostgreSQL and applies the schema for developers working from the repository. After installation, the getting-started documentation covers connecting a chat client and making an initial tool call.

Tools and capabilities

The documented MCP surface contains 21 tools, grouped as follows:

  • Read mail with list_accounts, list_emails, search_emails, get_email_content, and ask_mail.
  • Apply read, unread, star, and keyword changes with set_mail_flags.
  • Send, reply to, or forward messages with send_email, reply_to_email, and forward_email.
  • Check or cancel queued delivery with get_outgoing_email and cancel_outgoing_email.
  • Manage drafts with save_draft, update_draft, delete_draft, and send_draft.
  • Use six tools for contacts stored in MailFathom's database.

The message-question tool includes citations for the messages used in its answer. Reply and forward operations derive addressing, subject, threading, quotation, and attachments from the stored message copy.

Limitations and notes

The MailFathom MCP server is under active development before version 1.0.0. Releases may change tools, configuration, database schema, or deployment behavior incompatibly, so operators should review the changelog before upgrades and keep a recoverable backup.

Sending is off by default for each account, constrained by recipient policy and a configured per-period limit, and cannot be used to choose an arbitrary sender identity. The local archive's freshness depends on synchronization, so results should be interpreted with the freshness information returned by the server.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MailFathom

MailFathom is an MCP server that connects IMAP mailboxes to a self-hosted PostgreSQL archive and exposes tools for listing, searching, reading, and asking questions about email. It also supports flags, drafts, contacts, sending, replies, forwards, outgoing-send status, and cancellation when explicitly enabled.

Install it with the documented Docker Compose flow or follow the guides for Podman Quadlet, Kubernetes, or native systemd. The quick-start script can configure a mailbox, start the stack, and offer schema setup, but its defaults are intended for evaluation rather than production.

Yes, MailFathom reads and searches the synchronized PostgreSQL copy rather than contacting the mail server for each request. Read operations do not mark messages as read remotely, and tool results report how fresh the local copy is.

No, sending is disabled unless it is explicitly enabled for an account and credential. Enabled sends are recorded and queued for delivery, constrained by recipient policy and a per-period limit, and can be canceled only before they leave the system.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMailFathom AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mailfathom-2?style=directory)](https://allmcps.com/mcp/mailfathom-2)
HTML Embed
<a href="https://allmcps.com/mcp/mailfathom-2"><img src="https://allmcps.com/api/badge/mailfathom-2?style=directory" alt="MailFathom on AllMCPs" /></a>