MailFathom logo

MailFathom

Self-hosted email archive that syncs IMAP to PostgreSQL and exposes read, search, cited-answer, and optional write tools 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

MailFathom MCP server synchronizes IMAP accounts into a self-hosted PostgreSQL database and exposes the local archive to AI agents over MCP. Agents can list, search, and read messages, ask cited questions about stored mail, manage flags, and optionally draft or send messages when explicitly enabled. Reading operates against the local copy without marking remote messages read, while outgoing mail is queued and governed by account permissions and delivery limits. Reach for it when you need locally hosted email retrieval with citations and controlled write access.

Use cases

  • Search a locally hosted archive of IMAP mail
  • Ask cited questions about stored messages
  • Retrieve recent messages without marking them read
  • Draft and optionally send controlled outbound email
  • Manage mailbox flags and local contacts

Key features

  • IMAP synchronization to PostgreSQL
  • Lexical and optional embedding-based email search
  • Cited answers over archived mail
  • Read-only retrieval without remote read-state changes
  • Controlled drafts and asynchronous sending
  • Local contact management

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.

18/18 checks healthy over the last 98d

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 the MailFathom MCP server does

The MailFathom MCP server copies mail from configured IMAP accounts into PostgreSQL, indexes that local data, and makes it available to MCP-compatible agents. The design separates retrieval from mailbox changes: reading uses the database copy, does not contact the mail server, and cannot set the remote \\Seen flag.

Its read tools include account listing, recent-message listing, lexical email search, full content retrieval for up to ten messages, and question answering over stored mail. ask_mail cites every message used in its answer. Search can also use embedding similarity when an embedding model is configured. Results report the freshness of the local synchronization.

Optional write operations cover flags, drafts, replies, forwards, and sending. Draft operations save messages to the account's Drafts folder without sending. Sending is disabled by default and requires explicit account and credential permissions. A recipient policy and per-period limit can further constrain delivery. Contacts are stored in MailFathom's own database rather than read from the mail provider.

How it works

A synchronization process imports IMAP data into the PostgreSQL instance you operate. MCP tools then query or mutate the local application state according to the permissions enabled for each account. Outbound messages are recorded and handled by a delivery pass rather than being sent during the tool call. A queued message receives a record identity and can be cancelled before delivery.

The local archive allows read queries to continue when the mail server is unavailable, but the answer reflects the last completed synchronization. Mail rules and spam actions are outside the read-only retrieval path and may still change the mailbox according to your configuration.

Setup and configuration

The recommended first installation uses Docker Compose. The quick-start script asks for mailbox details, generates credentials, writes configuration, starts the stack, and can apply the database schema. Its defaults publish both services on loopback, but the generated setup keeps credentials in files under the checkout and does not provide backups.

The project also documents Podman Quadlet, Kubernetes, and a native systemd deployment. Local development can use Aspire to provision PostgreSQL and apply the schema. Read the installation and getting-started documentation before connecting an agent. The MailFathom MCP server is under active development before version 1.0.0; releases may change tools, configuration, schema, or deployment behavior, so review the changelog and keep a recoverable backup before upgrading.

Tools and capabilities

  • List accounts, recent messages, and search results.
  • Retrieve full content for up to ten messages.
  • Ask questions over archived mail with message citations.
  • Set read, unread, starred, and keyword flags.
  • Create, update, delete, and send drafts.
  • Send, reply to, forward, inspect, and cancel outgoing messages.
  • Manage contacts in the local contact book.

Limitations and notes

The MailFathom MCP server is read-only only when deployed and configured that way; write features exist but remain disabled unless explicitly enabled. Sending is asynchronous, subject to account credentials, recipient policy, and a configured period limit, and cannot be withdrawn after the delivery window. The archive is only as current as its last synchronization. Sensitive content is not automatically redacted unless the relevant SensitiveContent setting is enabled. Pre-1.0 compatibility is not guaranteed between releases.

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 configured IMAP accounts to a self-hosted PostgreSQL archive. Its main tools list, search, and read stored email; answer questions with citations; manage flags; and optionally create drafts, send, reply to, or forward messages when write permissions are enabled.

Install it with the recommended Docker Compose setup and run the repository's quick-start script. The script collects mailbox details, creates credentials, writes configuration, starts the services, and can apply the schema. Other documented deployment options include Podman Quadlet, Kubernetes, and systemd.

It states that MailFathom exposes tools over MCP and connects to a chat client, so compatibility should be verified against the client's supported MCP transport and the project's usage documentation.

Yes, but sending is disabled by default and requires explicit account and credential permissions. Outgoing mail is queued for a delivery pass, constrained by recipient policy and a per-period limit, and can be cancelled only before it leaves.

No. Reading uses the locally synchronized PostgreSQL copy and cannot set the remote IMAP `\\Seen` flag. A separate flag tool can change message state when that operation is enabled, while the archive's freshness depends on the latest synchronization.

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?style=directory)](https://allmcps.com/mcp/mailfathom)
HTML Embed
<a href="https://allmcps.com/mcp/mailfathom"><img src="https://allmcps.com/api/badge/mailfathom?style=directory" alt="MailFathom on AllMCPs" /></a>