Mail Index logo

Mail Index

Local-first Gmail recall through MCP, with mailbox search, graph analysis, digests, and opt-in archive and label changes.

Install Mail Index

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "mail-index-2": {
      "command": "npx",
      "args": [
        "-y",
        "-p",
        "mail-index",
        "mail-index-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

mail-index builds a local SQLite index of Gmail metadata, fetching message bodies selectively as an agent needs them. Its MCP interface supports mailbox search, contact and thread recall, graph traversal, digests, and freshness-aware reads. The default stdio deployment is local and read-only; an optional self-hosted Cloudflare Worker supports authenticated remote access, scheduled sync, jobs, and webhooks. Reach for it when agents need context across an entire mailbox rather than a single Gmail search result.

Use cases

  • Search an entire Gmail history for a vague reference
  • Summarize recent correspondence with a contact
  • Trace relationships across contacts, domains, and threads
  • Build a local mailbox digest
  • Archive messages or change labels with explicit opt-in

Key features

  • Progressive Gmail synchronization
  • Local SQLite indexing with selective body retrieval
  • MCP search, recall, graph, and digest tools
  • Contact interest scoring and curation
  • Opt-in archive and label changes
  • Optional self-hosted Cloudflare Worker deployment

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.

16/16 checks healthy over the last 82d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 9d ago via OSV.dev · mail-index (npm)

Adoption & maintenance

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

GitHub stars5Stargazers on the source repository.
npm downloads395Package downloads in the last 30 days.
Last commit3d agoMost recent push to the default branch.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How Mail Index works

What mail-index does

mail-index gives MCP-compatible agents a local index for recalling information from Gmail. It downloads mailbox metadata first, then retrieves full message text selectively, allowing searches and summaries to cover a broader history without keeping every message body in the initial sync. The index supports mailbox search, contacts, domains, threads, digests, and graph-based exploration.

The local MCP server is read-only by default. Optional Gmail writes can archive messages or change labels after a separate gmail.modify authorization is enabled. Mail-index never sends or deletes mail. Labels can be addressed by human-readable names, with the index resolving those names against Gmail's label catalogue.

How it works

Progressive synchronization starts by indexing metadata for the mailbox. A graph builder relates contacts, domains, and threads, while an interest score uses signals such as reads, replies, stars, and importance. That score is intended as a starting point for user-controlled curation, not as an autonomous decision system.

Curation determines which messages should be prewarmed locally. When an agent queries the MCP server, mail-index searches the local index and reads relevant bodies; it contacts Gmail again when a required body is not yet available. Responses include freshness information, and stale reads can trigger a background sync.

The standard deployment runs locally over stdio. An optional single-tenant Cloudflare Worker can run in infrastructure owned by the operator, use D1 storage, sync on a cron schedule, expose authenticated remote MCP access, and queue longer operations as jobs. Existing local indexes can be exported and imported into D1 to seed a deployment.

Setup and configuration

Mail-index requires Node.js 24 or later and a Gmail MailSource adapter. The supported adapters are gog, which is recommended, and gws. Reading Gmail also requires a Google OAuth client. Operators can use the mail-index beta client by requesting access, or provide their own Google Cloud OAuth client.

Install the package globally with npm or pnpm, then scaffold configuration with mail-index init. Connect a mailbox, run an account-specific sync, and optionally build its graph before searching. For example:

Terminal
npm install -g mail-index
mail-index init
mail-index sync --account personal --since 6mo
mail-index graph build --account personal

Register the stdio process with an MCP client using the mail-index-mcp executable. Claude Code supports claude mcp add --transport stdio; Claude Desktop can install the published .mcpb bundle. Connecting an MCP server does not itself install an adapter, authenticate a mailbox, or perform the initial sync.

Tools and capabilities

  • Search indexed Gmail using natural-language queries.
  • Recall contacts, domains, conversations, and threads.
  • Build and traverse a correspondence graph.
  • Produce mailbox digests and summaries from indexed messages.
  • Curate which contacts or content should be prioritized for body fetching.
  • Archive messages with archive_message after enabling writes.
  • Add or remove Gmail labels with modify_labels after enabling writes.
  • Run trigger rules in the remote deployment and deliver signed webhooks.

Limitations and notes

The default local index stays on the machine, but the optional Worker deployment runs in infrastructure managed by the operator. Remote deployment is self-hosted; mail-index does not operate a hosting service.

Write access is opt-in and requires a renewed gmail.modify grant. Even with that scope, the implementation blocks sending and deleting mail. Remote drafts require a separate gmail.compose authorization and are also prevented from being sent.

The Claude Desktop bundle is unsigned during beta, and the all-in-one installer that also installs an adapter, signs in, and syncs is still in development. On Windows, Claude Code's stdio command needs cmd /c before the npx invocation.

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 Mail Index

mail-index is an MCP server that connects AI agents to a local index of Gmail. Its main tools support mailbox search, contact and thread recall, graph traversal, and digests, while selectively fetching message bodies when needed. It is read-only by default, with optional archive and label-edit tools requiring explicit authorization.

Install it globally with `npm install -g mail-index`, run `mail-index init`, connect a Gmail mailbox, and sync it before registering the MCP process. Claude Code can use `claude mcp add --transport stdio`; Claude Desktop can install the published `.mcpb` bundle.

Yes, mail-index works with Claude Desktop through its `.mcpb` bundle. The bundle includes its dependencies and runs with Claude Desktop's bundled Node, but you still need to connect a Gmail adapter, authenticate a mailbox, and complete an initial sync separately.

Yes, mail-index can be registered with any MCP client that supports its local stdio transport, including Codex and Claude Code. The manual configuration uses the `mail-index-mcp` command, while Claude Code provides a dedicated `claude mcp add` command.

Yes, it can archive messages and add or remove labels after you explicitly enable writes with a renewed `gmail.modify` grant. Mail-index never sends or deletes mail. Remote drafts require a separate compose authorization and cannot be sent.

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 PreviewMail Index AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mail-index-2?style=directory)](https://allmcps.com/mcp/mail-index-2)
HTML Embed
<a href="https://allmcps.com/mcp/mail-index-2"><img src="https://allmcps.com/api/badge/mail-index-2?style=directory" alt="Mail Index on AllMCPs" /></a>