# MailFathom

Syncs IMAP mailboxes into a local PostgreSQL database for AI agents. Searches messages, provides cited answers, and handles drafting or sending.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 19
- Author: fathomise
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/fathomise/MailFathom
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/mailfathom

## What it does

The server pulls messages from IMAP accounts into a self-hosted PostgreSQL database. AI agents query this local archive directly instead of communicating with mail servers. Incoming messages stay unread at the source. Write actions remain disabled until granted per account, preventing unexpected drafts or flags.

Mail reading tools include lexical search and `ask_mail`, which provides answers alongside cited messages. Tools like `reply_to_email` automatically extract threads and recipients from stored data. Sensitive values pass without redaction unless you enable `SensitiveContent`.

Until version 1.0.0 arrives, schema updates can break compatibility, making manual backups necessary before upgrades. Initial evaluation uses `scripts/quick-start-compose.sh` to launch PostgreSQL and the service over Docker Compose on loopback ports.

## Requirements
- Remote server: `https://{mailfathom_host}/mcp`

## Install

### Claude Code (native platform)

1. **Template address**
- The server address is a template: replace {…} or […] with your own values

2. **Platform CLI: remote server**
```bash
claude mcp add --transport http mailfathom https://{mailfathom_host}/mcp
```

### Codex

1. **Template address**
- The server address is a template: replace {…} or […] with your own values

2. **Platform CLI: remote server**
```bash
codex mcp add mailfathom --url https://{mailfathom_host}/mcp
```

### Cursor

1. **Template address**
- The server address is a template: replace {…} or […] with your own values

2. **Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mailfathom": {
            "url": "https://{mailfathom_host}/mcp"
        }
    }
}
```

### GitHub Copilot

1. **Template address**
- The server address is a template: replace {…} or […] with your own values

2. **Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mailfathom": {
            "type": "http",
            "url": "https://{mailfathom_host}/mcp"
        }
    }
}
```

### Gemini CLI

1. **Template address**
- The server address is a template: replace {…} or […] with your own values

2. **Platform CLI: remote server**
```bash
gemini mcp add -t http mailfathom https://{mailfathom_host}/mcp
```

## When to use it
- mirror IMAP mailboxes into a local PostgreSQL database
- search email archives using text and semantic embedding queries
- answer user questions with citations from specific emails
- draft and send threaded email replies using stored conversation context
- update message flags and tags without modifying unread states on the mail server

## Example prompts
- Use `ask_mail` to check recent vendor correspondence and summarize invoices with citations.
- Find unread messages from last week using `list_emails` and summarize the key threads.
- Draft a response to the latest contract inquiry using `reply_to_email`.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
