# mail-index [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/unsoldgroup/mail-index  
**GitHub Stars:** 5  
**npm Downloads (last month):** 395  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mail-index-2

## Description
Local-first, read-only MCP server for recall over your Gmail: search, contacts, threads, digests.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "mail-index": {
    "command": "npx",
    "args": ["-y","-p","mail-index","mail-index-mcp"]
  }
}
```

## Documentation

## 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:

```sh
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.

_Full upstream README: https://allmcps.com/mcp/mail-index-2/readme_

