MailFathom MCP server
Commit Nov 15, 2026Synchronizes IMAP accounts into a local PostgreSQL database to provide AI agents with searchable, cited email access and controlled sending capabilities.
Also known as fathomise/MailFathom
- Stars
- 21
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- 0.7.0
- Last commit
- Nov 15, 2026
- License
- AGPL-3.0
What is MailFathom MCP?
MailFathom synchronizes IMAP accounts into a local PostgreSQL database to provide AI agents with searchable, cited email access and controlled sending capabilities.
Summary generated from the project's README
About MailFathom MCP server
Providing AI agents with searchable, cited email access from a local database is what MailFathom accomplishes. It synchronizes IMAP accounts into a self-hosted PostgreSQL database, allowing an agent to query a local copy of your messages rather than contacting a mail server directly. This approach ensures that reading emails is fast, works even when the server is offline, and never modifies the remote state of your inbox.
Developers can deploy this via Docker Compose, Podman Quadlet, Kubernetes, or native systemd processes. The system provides twenty-one specific tools for managing communications, including list_emails, search_emails, and ask_mail for cited answers. While reading is the default, writing capabilities like send_email, reply_to_email, and save_draft must be explicitly enabled through specific credential grants and recipient policies. This architecture ensures that an agent cannot send or modify anything unless you have specifically authorized that action for a particular account.
What you can do with it
- 1Searching messages by semantic similarityFind relevant emails using natural language searches that go beyond simple keyword matching.
- 2Drafting and managing email repliesHave an agent prepare a response to a specific message and save it to your drafts folder.
- 3Managing email organization and flagsInstruct an agent to mark specific messages as read, starred, or assigned to certain tags.
Written from the project's README. Every use case is checked against a quote from it.
How to install MailFathom MCP
MailFathom gives each account its own endpoint, so there is no address to copy here. Get yours from the provider, put it in place of the part in braces, and add it to your client as a remote server.
https://{mailfathom_host}/mcp
Automated checks
Ran Nov 13, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachablefathomise/mailfathom is public and reachablegithub.com/fathomise/mailfathom ↗Pass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)AGPL-3.0spdx.org/licenses/AGPL-3.0.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-11-12github.com/fathomise/mailfathom ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeEndpoint did not answer initialize: unreachableFinding
README
View on GitHubMailFathom
A brain for your mail — self-hosted, AI-native, and yours alone.
[!WARNING] MailFathom is under active development, and nothing between two releases is guaranteed to stay compatible until version 1.0.0. Any release before it may change the MCP tools, the configuration, the database schema, or the deployment in a breaking way — up to a release that cannot run over the previous one's configuration or data at all. Read the changelog before every upgrade, and keep a backup you can go back to.
MailFathom synchronizes your IMAP accounts into a PostgreSQL database you run, indexes that copy, and serves it to AI agents as tools over the Model Context Protocol. Reading answers from your copy rather than from a mail server, and it never marks anything read there. Writing — marking, drafting, sending — is a separate act each account and each credential has to be given, and every one of them is off until you turn it on.

One question, answered from the local copy in an ordinary chat client. The *** in these screenshots were blacked out by hand before the files entered a public repository — until you turn SensitiveContent on, MailFathom redacts nothing on its way to a client.
Install
Docker Compose is the recommended first installation. It is the only shape that provisions PostgreSQL for you, and its defaults publish both ports on loopback, so nothing is reachable from another machine until you decide it should be.
git clone https://github.com/fathomise/MailFathom.git
cd MailFathom
scripts/quick-start-compose.sh
That third line is the quick way to try it, not the way to run it: the script asks where your mailbox lives, writes the configuration, starts the stack, offers the schema step, records you and your mailbox, and hands you the key a chat client connects with — and what it prepares serves that one machine over plain HTTP, keeps its credentials in files under the checkout, and backs nothing up. It prints that list when it finishes.
Installing MailFathom is the real thing: what every shape needs, and the guide for Compose, Podman Quadlet, Kubernetes, or a native systemd process. Getting started then walks from an installed instance to a first successful tool call. To evaluate from the checkout instead, the local Aspire orchestration provisions PostgreSQL and applies the schema on its own — local development has that path.
Start here
| You are | Start at |
|---|---|
| Deciding whether MailFathom is for you | What it does well below, then the user guide |
| Installing or operating it | Installing MailFathom, then getting started |
| Connecting an agent to a running instance | Using the tools |
| Reading any of that with an AI assistant beside you | Hand it the documentation below |
| Contributing | CONTRIBUTING.md |
Hand the documentation to your agent
If an AI assistant is helping you install, configure, or use MailFathom, give it the documentation rather than a search over the site. One line is the whole of it:
Read https://fathomise.github.io/MailFathom/docs/llms.txt and follow it to the pages that answer my question.
That address is the current release's map: every published page, what it answers, and a link to its source, so the agent fetches the one page that owns your question instead of fragments of several. MailFathom also resolves in Context7 as /fathomise/mailfathom, which mirrors the default branch rather than a release.
→ Handing this guide to your own agent
What an agent gets
Twenty-one tools, and they are the whole surface.
| Reading your mail | list_accounts, list_emails, search_emails — ranked lexically, and by embedding similarity once you configure a model — get_email_content for up to ten messages in full, and ask_mail, which answers a question from your mail and cites every message it drew on |
| Marking it | set_mail_flags marks a message read or unread, stars it, and writes the keywords your client shows as tags |
| Sending | send_email sends one message; reply_to_email and forward_email answer one you already hold, deriving the addressing, subject, threading, quotation, and attachments from your stored copy; get_outgoing_email and cancel_outgoing_email report what became of a send and stop one that has not left |
| Drafting | save_draft, update_draft, and delete_draft write a message into your own Drafts folder and send nothing at all; send_draft is what sends one |
| Contacts | Six tools over MailFathom's own book of people — not addresses — which lives in your database rather than at your mail provider |
Two properties hold everywhere, and much of the design follows from them:
- Reading is local. A read answers from your copy and never contacts a mail server, so it is fast, it works while the server is down, and it changes nothing remotely. Every result states how fresh the local copy is.
- Nothing writes unless you asked for it. Retrieval cannot set the remote
\Seenflag at all. What can change your mailbox is what you configured — a mail rule, a spam action — or a tool a credential was explicitly granted. Sending is stricter again: it is off on every account, refused outright while the deployment is read-only, and bounded by a recipient policy and a per-period ceiling you set.
No send is performed while the caller waits. Each is written down, answered with a record identity, and offered by a delivery pass that survives a crash — so a message MailFathom says it queued is one it will actually try to deliver, and the seconds before it leaves are the only window in which it can be withdrawn. Nothing a client sends decides who a message is from.


Beside what a tool returns, MailFathom records what it can establish about each message: who authenticated its sender and whether you recognize that author, how much its text reads as machine written, and the conversation it belongs to. What each tool answers, refuses, and never repeats back is the contract.
Project status
0.8.0 is the current release, and it is the one in which a deployment stops being one person's mailbox described in a configuration file. The people it serves, their mail accounts, their credentials, and the roles that decide what each of them may do are records in your database, administered with mfctl while the deployment runs — so one deployment serves several people, shares a mailbox between them, and runs as more than one replica.
Upgrading from 0.7.0 is a new installation over a backup, not an upgrade in place. Applying the schema discards the stored mail, which synchronization fetches again, and nothing imports the mailboxes or credentials a 0.7.0 configuration declared: each is recorded again through mfctl. The changelog states each break against the surface it breaks, and what to do about it.
Nightly images are built from main and published beside the releases. A nightly is not a release: its schema can be ahead of any published migration, it has no upgrade path in either direction, and it is deleted once newer ones accumulate. What a nightly build risks states the whole of it.
Where the artifacts are published
| Artifact | Where |
|---|---|
| Container image | ghcr.io/fathomise/mailfathom and docker.io/fathomise/mailfathom |
| Helm chart | oci://ghcr.io/fathomise/charts/mailfathom |
| Database schema script | attached to each release |
mfctl, the administrative command |
attached to each release, one self-contained binary per platform, verified by the checksum file beside them, and installed on Linux by one command that does both |
Both registries carry the same manifest list under the same digest, so pull from whichever your environment already reaches. There is no binary artifact for the service itself: a native installation starts from a checkout.
What it does well
MailFathom is built as an enterprise-grade system from the first line, even while its feature scope is still small. Every claim below is a property of the code and the deployment assets today.
- Every act is behind a grant, and no grant implies another. Reading your mail, changing a flag, writing a draft, and sending are four separate permissions, checked when a tool is listed and again when it is called; an administrative route is checked the same way. An endpoint can also publish only some kinds of tool at all, so a deployment can offer reading and drafting while withholding sending from every credential. → Permissions
- Secure by default, and explicit about every weakening. The MCP endpoint is off until you enable it, and enabling it means saying whether it requires a credential; the unauthenticated posture is legal, warned about at startup, and never the default. Client certificates and per-client rate limits belong to the endpoint rather than to a proxy. IMAP is TLS-on-connect, and a configuration that weakens the transport fails startup unless it says so explicitly. → The MCP endpoint
- Credentials never live in configuration. A secret-bearing setting holds a reference — a file path, a systemd credential, an environment variable — so a configuration file is safe to review, diff, and back up: leaking it leaks paths, not passwords. No file MailFathom reads is ever written back; what an administrator changes while it runs is persisted in the database, behind a permission of its own. → Secret provisioning, configuration sources
- Mail is handled as personal data by the code that touches it. Content, metadata, extracted text, and search extracts are never logged and never carried in an error message; every call is bounded, so a deployment decides how much mail one call may draw out. Whether a deployment satisfies GDPR still depends on how you run it — what MailFathom offers is an architecture that keeps those choices open, with explicit seams for the data-subject workflows. → Using the tools
- It fails fast and says why. Startup resolves every secret reference and verifies the database schema before serving anything, and a refusal names the key or the pending migration that caused it. Migrations are never applied while starting, in any environment. → Health endpoints, telemetry
- The deployment assets are hardened, not illustrative. The image is chiseled — no shell, no package manager, no HTTP client — runs unprivileged on a read-only root filesystem with every capability dropped, and carries no tool that could apply a migration. Compose, the Quadlet units, and the Helm chart all ship that posture by default, and the chart meets the Restricted Pod Security Standard. → The container image, Kubernetes
- The supply chain is verifiable. Multi-architecture images from base images pinned to an exact patch, scanned before publication, with signed build provenance tying a digest to the commit and workflow that produced it. Package versions are pinned centrally with committed lock files, and every third-party component is reviewed against a licensing policy that keeps the project commercially redistributable. → Verification, THIRD_PARTY_LICENSES.md
- It is built to be maintained. A .NET 10 clean-architecture modular monolith with enforced boundaries, compiler and analyzer diagnostics as errors, tests with every behavior change, and the decisions recorded as ADRs rather than remembered. → Solution structure, decisions
Documentation
Every documentation link here goes to the documentation site, which is the readable form: the same pages with search, an API reference generated from the source, and a version selector. It opens on the current release, and an address here names no version, so a link keeps working across releases. docs/ is the index for reading the same pages in the repository instead.
| User guide | Install, configure, run, and use MailFathom |
| Configuration reference | Every user-settable option, its default, and whether changing it needs a restart |
| Permissions | What a credential may do, and what a refusal says |
| MCP tools | The tool contracts, their arguments and results, and the stable error codes |
| Mail delivery | What a send passes through before it leaves, and what bounds it |
| Architecture | The boundaries, the projects, and why they are drawn there |
Documentation under docs/ describes behavior that exists. Where something is planned, it is tracked as an issue rather than written up as though it worked.
Why it exists
A mailbox is the largest archive most people own and the least usable one. Contracts, decisions, invoices, threads that ended without a conclusion, attachments nobody will ever find again: all of it is in there, and none of it is reachable except by scrolling. Mail clients are built to show you the newest of it, one message at a time. After twenty years of accumulation, that is the wrong shape entirely.
MailFathom is being built to change what mail is to software: keep the local copy current, index it so the whole of it is reachable rather than only its most recent slice, and serve it to agents as tools. MCP is how agents reach it; it is not what MailFathom is. None of it depends on somebody else's service — the copy is yours, the database is yours, the deployment is yours, and the AI capabilities arrive as providers you choose and point at rather than as ones compiled into the product.
Where it is going
The tools are the foundation, not the product. Sending was the capability whose effect first reached somebody who is not this mailbox's user; what an agent still cannot do to a mailbox is move, file, and delete. Every later capability takes the route these took: a named permission, a recorded change, and a pass of its own that owns the mail server.
A client of MailFathom's own is being built, and it is an alpha. A web client travels inside the image, off until a deployment serves it, and the same client is attached to each release as a desktop application for Linux and Windows. It is there to be tried rather than relied on: it is incomplete, it changes from one release to the next, and the tools above remain the supported way to reach your mail. → The client endpoint, The desktop client
Ideas, not yet scope — recorded as open questions, each waiting on a decision rather than on effort. Discussions is where they are argued, and the Ideas category is open to yours: encrypted and signed mail, antivirus scanning of stored attachments, OAuth for outbound IMAP and SMTP, and skill-based jobs, whose body is an instruction an agent carries out against a slice of your mail rather than a deterministic rule.
Contributing
Contributions are welcome, and the entry point is CONTRIBUTING.md: it gets you from a clone to a passing verification run and states the few rules a pull request has to satisfy. Every change starts from an issue, so open one — or comment on an existing one — before writing code, and wait for a reply on anything larger than a typo.
MailFathom is developed AI-first, and close to zero-touch. Nearly every line here was written by an autonomous coding agent working from an issue and the rules in AGENTS.md, and reviewed before merge. Working the same way is encouraged rather than merely tolerated; a hand-written patch is judged identically. What does not change either way is that you read your diff before submitting it, and that the same gates and licensing obligations apply.
Fork the repository, clone your fork, and point it at this one — every verification gate measures your branch against the base it will actually merge into:
git clone https://github.com/<you>/MailFathom.git
cd MailFathom
git remote add upstream https://github.com/fathomise/MailFathom.git
git fetch upstream main
If you work with a coding agent, hand the rest to get-started-contributors, the workflow skill written for somebody arriving for the first time; in Claude Code it is /get-started-contributors, and any other agent can be pointed at the file. Setting up by hand takes the same steps, written out in From a clone to a green run. Development is on Linux; nothing here is verified against anything else.
Discussions takes questions in Q&A and proposals in Ideas. A defect or a piece of scope belongs in issues — except a vulnerability, which has a private channel below. CODE_OF_CONDUCT.md applies to everyone taking part.
Security
MailFathom holds mailbox credentials, OAuth tokens, certificate material, and a local copy of someone's mail. Report a vulnerability privately through SECURITY.md rather than in a public issue.
Privacy policy. MailFathom transfers no information to other networked systems unless specifically requested by the user or the person installing or operating it. It reaches the mail servers, the database, and the model provider a deployment configures, and nothing else: it collects no telemetry, phones no home, and exports OpenTelemetry data only to an endpoint an operator sets. Where mail is stored, who can reach it, and which model receives a result are deployment decisions.
Verifying what you downloaded. No mfctl binary carries a code signature, on any platform, so Windows warns about an unknown publisher. The checksum file attached beside them is what tells a genuine download from a tampered one:
sha256sum --check --ignore-missing 'mfctl-<version>.sha256'
The container image and the Helm chart each carry a signed build provenance statement instead, so gh attestation verify answers where one came from without your having to trust the registry. The container image records how to check one.
MailFathom MCP questions
Does reading emails via MailFathom affect my mail server?
No, reading is performed against a local copy and never contacts the mail server or changes the remote status.
Can an AI agent send emails automatically?
Sending is strictly controlled; it is disabled by default on every account and requires explicit credentials and permissions to be enabled.
How is the email data stored?
MailFathom synchronizes your IMAP accounts into a PostgreSQL database that you run yourself.