A local, agent-queryable mail intelligence layer — progressive mailbox index + MCP server that gives AI agents recall over your email without handing them the keys.
- ✓Open-source license (MIT)
- ✓Actively maintained (<30d)
- ✓Clear description
- ✓Topics declared
- ✓Documented (README)
claude mcp add mail-index -- npx -y -p{
"mcpServers": {
"mail-index": {
"command": "npx",
"args": ["-y", "-p"]
}
}
}MCP Servers overview
# mail-index
[](https://www.npmjs.com/package/mail-index)
[](https://www.npmjs.com/package/mail-index)
[](https://github.com/unsoldgroup/mail-index/stargazers)
[](https://github.com/unsoldgroup/mail-index/network/members)
[](https://github.com/unsoldgroup/mail-index/actions/workflows/ci.yml)
[](LICENSE)


mail-index downloads a **preview of your whole inbox** to your machine, then
smartly fetches the full text of the messages that matter as you use it. That
local index lets your AI agent run **true summarization and recall over your
entire mailbox** — instead of being trapped behind Gmail's search bar.
It works through a **local MCP server**, so any agent (Claude, Codex, any MCP
client) can query it. Local-first — the default index never leaves your machine.
Operators who need an always-on connector can instead deploy the optional,
single-tenant [remote Worker Deployment](docs/INSTALL-worker.md) in their own
Cloudflare account; mail-index operates no hosting service.
Read-only by default — it never sends or mutates your mail unless you
explicitly opt into archive + label edits (a least-privilege `gmail.modify`
re-auth; never send or delete). See [ADR-0007](docs/adr/0007-opt-in-mailbox-writes.md).
<p align="center">
<a href="docs/demo/mcp-demo.html">
<img src="docs/demo/mcp-demo.gif" width="720"
alt="Claude answering a vague inbox question through the mail-index MCP server, locally, with zero network calls" />
</a>
<br />
<sub>Ask a vague question → one local MCP call → ranked, snippet-first answer.
<a href="docs/demo/mcp-demo.html">Interactive version →</a></sub>
</p>
> **Status: v1.5 — published.** Progressive sync, the correspondence graph, the
> interest engine, curation, the full 23-tool MCP surface, and the write-back
> loops are built and tested — and `mail-index` is live on
> **[npm](https://www.npmjs.com/package/mail-index)** with a
> **[`.mcpb` bundle](https://github.com/unsoldgroup/mail-index/releases/latest)**.
> Still in progress: the bundled Option A OAuth client and signed one-click
> installers. Architecture lives in
> **[docs/PLAN.md](docs/PLAN.md)**; start with **[docs/INSTALL.md](docs/INSTALL.md)**;
> every release is recorded in **[CHANGELOG.md](CHANGELOG.md)**.
> [!TIP]
> **New in v1.5 — the optional remote Deployment.** mail-index can now also run
> as a **single-tenant Cloudflare Worker in your own account**: always-on, synced
> on a cron, and reachable by remote agents over authenticated MCP (plus a small
> A2A surface). It serves the _same_ tool registry as the local server, backed by
> a **D1** storage driver that passes the same FTS ranking conformance suite, and
> it can **push** — Trigger rules match new mail as it lands and fire signed
> webhooks. Long O(N) work becomes a queued **Job** instead of a command
> handback. You can seed a fresh Deployment straight from your existing local
> index with `mail-index export` → D1 import, so it starts with your history
> already indexed. **The local CLI + stdio path is unchanged and stays the
> default**, and mail-index still operates no hosting service — the Worker is
> code you deploy to infrastructure you own.
> See **[docs/INSTALL-worker.md](docs/INSTALL-worker.md)**,
> **[docs/WORKER-SEED.md](docs/WORKER-SEED.md)**,
> **[ADR-0008](docs/adr/0008-self-hosted-remote-deployment.md)**.
>
> Also new locally: every MCP response carries a **freshness block** and any
> stale read now auto-triggers a background sync (previously only the digest
> composites did).
> [!TIP]
> **From v1.4 — opt-in mailbox writes + human-readable labels.**
> mail-index can **archive** a message and **edit its labels** directly on
> Gmail — via the `archive` / `label` CLI commands and the `archive_message` /
> `modify_labels` MCP tools, on both the gog and gws adapters. It stays
> **read-only by default**: writes are unreachable until you opt in with a
> _least-privilege_ `gmail.modify` grant (**never** send or delete) — enable per
> account with `mail-index setup --account <email> --enable-writes` or the
> bundled `scripts/enable-writes.sh`. Labels render as their **human names**
> everywhere (the index caches Gmail's label catalogue and resolves
> `Label_3546…` → _"Expedition Insure"_ in both directions), and you can pass a
> friendly label name to `label --add/--remove`.
> See **[ADR-0007](docs/adr/0007-opt-in-mailbox-writes.md)**.
---
## How it works
1. **Progressive sync** — metadata for the whole mailbox in minutes; bodies
fetched selectively.
2. **Graph** — contacts, domains, threads; centrality + communities over your
_human_ (non-bulk) mail.
3. **Interest** — an engagement score per contact from read/reply/star/importance
signals. A _seed for your curation_, not an autonomous decision.
4. **Curate** — you (via your agent, or a CLI wizard) confirm who/what matters;
that profile drives which bodies get fetched.
5. **Query** — your agent searches, traverses the graph, and reads the messages
that matter, all locally via MCP.
<p align="center">
<a href="docs/demo/sync-flow.html">
<img src="docs/demo/sync-flow.gif" width="720"
alt="mail-index prewarms a local SQLite index with the important messages, then the MCP server serves the agent from it, fetching from Gmail again only on a miss" />
</a>
<br />
<sub>Important messages prewarm a local index; the MCP reads from it, touching
Gmail again only when a needed body isn't there yet.
<a href="docs/demo/sync-flow.html">Interactive version →</a></sub>
</p>
## Quick start
Requires **Node 24+** and a Gmail `MailSource` adapter — **`gog`** (recommended)
or **`gws`**. Reading Gmail needs a Google OAuth client, and you get one **two
ways**: use the **mail-index beta client** (skip Google Cloud entirely;
[request access](https://github.com/unsoldgroup/mail-index/issues/new?template=beta_access.yml)
to join the ~100-user test list) or **bring your own** Google Cloud client (no
cap, no request — we walk you through it). See
[docs/INSTALL.md §2](docs/INSTALL.md#2-connect-a-mailbox-pick-an-oauth-path)
and [docs/oauth-and-verification.md](docs/oauth-and-verification.md).
```sh
npm install -g mail-index # or: pnpm add -g mail-index
mail-index init # scaffold the config
# …connect a mailbox (own OAuth client, read-only) — see docs/INSTALL.md §2 / agent-install.md…
mail-index sync --account personal --since 6mo
mail-index graph build --account personal
mail-index search "that contract we discussed"
```
_(Prefer source? `git clone …`, `pnpm install && pnpm build`, then run the bins
as `node dist/cli/index.js …`.)_
### Add to Claude
The MCP server registers in one step, but it still needs a mailbox connected
first (see the walkthrough). A `.mcpb`/`claude mcp add` only **adds the server** —
it doesn't install the adapter, sign you in, or sync.
- **Claude Code:** `claude mcp add --transport stdio mail-index -- npx -y -p mail-index mail-index-mcp`
(on **Windows**, prefix with `cmd /c`: `… -- cmd /c npx -y -p mail-index mail-index-mcp` —
bare `npx`/`.cmd` won't spawn. See [docs/INSTALL.md §7](docs/INSTALL.md).)
- **Any MCP client (manual):**
```jsonc
{ "mcpServers": { "mail-index": { "command": "mail-index-mcp" } } }
```
- **Claude Desktop:** download the **[`.mcpb` bundle](https://github.com/unsoldgroup/mail-index/releases/latest/download/mail-index.mcpb)**
and double-click it (unsigned during beta — you may need to allow it in System
Settings / Windows SmartScreen). The bundle is **self-contained** (ships its own
dependencies, run by Claude Desktop's bundled Node — no npx, network, or system
Node needed) so it installs identically on Windows/macOS/Linux. A signed
all-in-one installer that _also_ installs the adapter, signs you in, and syncs is
still in progress; there is no `claude://` install link.
**Teach your agent the common moves.** The MCP server already tells the agent
_when_ to reach for it (purchases, receipts, bookings, "who said what", "catch me
up"), and the repo ships a Claude **[Agent Skill](skills/mail-index/SKILL.md)**
with the typical recipes (find purchases, catch up, find a contact's mail,
summarize a sender). Drop it in for Claude Code/Desktop:
```sh
mkdir -p ~/.claude/skills && cp -R skills/mail-index ~/.claude/skills/
```
Full walkthrough (auth, curation, enrichment, scheduled sync, desktop-app
gotchas) → **[docs/INSTALL.md](docs/INSTALL.md)**. Driving setup with an agent →
**[docs/agent-install.md](docs/agent-install.md)**.
## What to expect — time & storage
The index keeps metadata for every message and full text only where it earns it,
so it grows with message _count_, not mailbox size — about **1.5% of your Gmail**.
First sync runs ~50 messages/min (one-time, incremental after); search is instant.
Start with `--since 1mo` for value in minutes, then expand. Sizing table & growth
path → **[docs/INSTALL.md §9](docs/INSTALL.md#9-grow-your-index-intelligently)**.
## Why it's lighter than Gmail search
Stock Gmail-API MCPs are query-based **lookup** tools — exact query, a network
round-trip per call, raw payloads dumped into the model's context. mail-index
answers _vague_ questions from a local **recall** index. Across a 100-question
suite on a real mailbox it answered every question for **15× fewer tokens** — and
the gap widens exactly where a query-based MCP haWhat people ask about mail-index
What is unsoldgroup/mail-index?
+
unsoldgroup/mail-index is mcp servers for the Claude AI ecosystem. A local, agent-queryable mail intelligence layer — progressive mailbox index + MCP server that gives AI agents recall over your email without handing them the keys. It has 4 GitHub stars and its last recorded update is dated 2026-08-05.
How do I install mail-index?
+
You can install mail-index by cloning the repository (https://github.com/unsoldgroup/mail-index) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is unsoldgroup/mail-index safe to use?
+
Our security agent has analyzed unsoldgroup/mail-index and assigned a Trust Score of 95/100 (tier: Verified). See the full breakdown of passed checks and flags on this page.
Who maintains unsoldgroup/mail-index?
+
unsoldgroup/mail-index is maintained by unsoldgroup. The last recorded GitHub activity is dated 2026-08-05, with 13 open issues.
Are there alternatives to mail-index?
+
Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.
Deploy mail-index to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/unsoldgroup-mail-index)<a href="https://claudewave.com/repo/unsoldgroup-mail-index"><img src="https://claudewave.com/api/badge/unsoldgroup-mail-index" alt="Featured on ClaudeWave: unsoldgroup/mail-index" width="320" height="64" /></a>More MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
The fastest path to AI-powered full stack observability, even for lean teams.
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!