# @snackbyte/mail-mcp-server [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/jeff-fichtner/mail-mcp-server  
**GitHub Stars:** 0  
**npm Downloads (last month):** 582  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/snackbyte-mail-mcp-server

## Description
Zero-dependency MCP server for Gmail: one OAuth token per mailbox, search, sender counts, unsubscribe, bulk label/archive/trash, filters. Every change is a dry-run plan first.

## Tools
Capabilities this server exposes over MCP:

- **mailto** — a plain-text message from the mailbox to the header's address only.

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

```json
"mcpServers": {
  "mail-mcp-server": {
    "command": "npx",
    "args": ["-y","@snackbyte/mail-mcp-server"],
    "env": {
      "MAIL_OWNER_ID": "",
      "MAIL_OAUTH_CLIENT": "",
      "MAIL_TOKENS": ""
    }
  }
}
```

**Requires environment variables:** `MAIL_OWNER_ID`, `MAIL_OAUTH_CLIENT`, `MAIL_TOKENS` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What @snackbyte/mail-mcp-server does

@snackbyte/mail-mcp-server gives an MCP client access to connected Gmail mailboxes. It can search and read messages and threads, inspect sender activity, save attachments, create and update drafts, and manage message state such as labels, stars, read status, spam status, archiving, and trash.

Mailbox administration is covered as well. Available operations include creating and renaming labels, listing or deleting filters, configuring vacation responses, managing send-as addresses, and controlling forwarding. The server can also unsubscribe by sender when the newest matching message provides a supported `List-Unsubscribe` mechanism.

## How it works

Each mailbox is connected through Google OAuth. One server instance can reach every mailbox associated with the configured owner, with a separate refresh token for each address. The server uses Gmail API scopes for mailbox changes, drafts, sending, filters, vacation settings, signatures, send-as addresses, and forwarding; it does not request the scope that permits permanent deletion.

Mutating operations use a plan-and-execute workflow. A `plan_*` call examines the requested messages or settings and returns a summary plus a single-use plan ID. `execute_plan` then applies exactly what the plan identified, rather than rerunning the query. Plans expire after 10 minutes. Reads, draft operations, label creation or renaming, and filter deletion run directly.

Unsubscribe handling supports RFC 8058 one-click POST requests and plain-text mailto messages sent from the mailbox. Link-only and unsupported unsubscribe methods are reported for manual action; the server does not fetch unsubscribe links with GET.

## Setup and configuration

Use Node.js 24 or newer. Create a Google Cloud OAuth client for a Desktop app, enable the Gmail API, configure the consent screen, and add test users if the application remains in Testing mode. On macOS, the OAuth client JSON can be stored in the Keychain under `mail_oauth_client`. Other systems use `MAIL_OAUTH_CLIENT` with the same JSON value.

`MAIL_OWNER_ID` is required and identifies the owner whose mailbox tokens the server can access. Tokens are stored in the Keychain under `mail_tokens`, or can be supplied through `MAIL_TOKENS`, which prevents token writes. Register the server with Claude Code through `npx -y @snackbyte/mail-mcp-server`, then call `connect` for each mailbox.

An OAuth application left in Testing mode produces refresh tokens that expire after seven days. Revoked or expired tokens require reconnecting the mailbox. The package includes compiled JavaScript for npm use, while a cloned checkout can run the TypeScript entry point directly.

## Tools and capabilities

- Discover and connect mailboxes with `list_mailboxes`, `connect`, and `mailbox_overview`.
- Search, read, inspect threads, save attachments, and calculate sender statistics.
- Create, update, and list drafts, with planned sending and draft deletion.
- Plan message changes including archive, trash, restore, labels, stars, read state, importance, and spam state.
- Manage labels, filters, vacation settings, send-as addresses, and forwarding.
- Execute approved plans through `execute_plan`.

## Limitations and notes

Gmail API limitations leave inbox type and tabs, snooze, mute, and delegation outside the server. Delegation would require a service account. Gmail throttling can make large reads slow: sender statistics over a busy month may take several minutes, and message-header reads run at roughly 300 messages per minute per mailbox under measured conditions. The server paces requests and retries transient quota and server errors with backoff.

_Full upstream README: https://allmcps.com/mcp/snackbyte-mail-mcp-server/readme_

