Mail MCP Server logo

Mail MCP Server

by @snackbyte

Manage Gmail mailboxes through MCP with search, message actions, filters, settings, drafts, and approval-gated changes.

Install Mail MCP Server

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": {
    "snackbyte-mail-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@snackbyte/mail-mcp-server"
      ],
      "env": {
        "MAIL_OWNER_ID": "YOUR_VALUE_HERE",
        "MAIL_OAUTH_CLIENT": "YOUR_VALUE_HERE",
        "MAIL_TOKENS": "YOUR_VALUE_HERE"
      }
    }
  }
}

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

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y @snackbyte/mail-mcp-server

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

@snackbyte/mail-mcp-server connects AI assistants to Gmail using one OAuth refresh token per mailbox and exposes tools for reading mail, managing messages, handling drafts, and configuring mailbox settings. Changes such as archiving, trashing, unsubscribing, sending, and filter updates first produce a dry-run plan that must be executed separately. It runs on Node.js 24 or newer with no runtime dependencies and is a fit for Gmail workflows that need explicit approval before mutations.

Use cases

  • Search Gmail and inspect matching threads
  • Count messages by sender before cleanup
  • Plan bulk archive, label, or trash operations
  • Create filters for senders without automated unsubscribe support
  • Manage Gmail drafts, forwarding, and vacation settings

Key features

  • OAuth access to multiple Gmail mailboxes
  • Dry-run plans for mailbox mutations
  • Search, message reading, threads, and attachments
  • Draft, label, filter, and mailbox-settings management
  • One-click and mailto unsubscribe handling
  • Node.js implementation with no runtime dependencies

Tools1

What Mail MCP Server lets your agent do. Expand a tool for its parameters.

Self-reported~18 tokens of context

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.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 2d ago via OSV.dev · @snackbyte/mail-mcp-server (npm)

Adoption & maintenance

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

npm downloads582Package downloads in the last 30 days.
Last commit8d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Tools exposed1Callable tools this server registers over MCP.

How Mail MCP Server works

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.

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 MCP Server

@snackbyte/mail-mcp-server is an MCP server that connects AI assistants to Gmail through Google OAuth. Its main tools search and read messages, inspect senders, manage drafts, labels, filters, and settings, and plan or execute actions such as archiving, trashing, unsubscribing, and sending.

Install it through npx with `npx -y @snackbyte/mail-mcp-server` and provide the required `MAIL_OWNER_ID` value. You must also create a Google OAuth Desktop client, enable the Gmail API, configure the OAuth client storage, and connect each mailbox.

It requires a plan before most changes are applied. A planning tool returns the affected items and a single-use plan ID, while `execute_plan` applies only that exact plan. Plans expire after 10 minutes, so archiving, trashing, unsubscribing, and sending require a separate execution step.

Yes, Claude Code is supported through its MCP registration command. The recommended permission rule asks for approval on `mcp__mail__execute_plan`, allowing searches and proposals without approval while requiring confirmation before planned mail changes are executed.

Inbox type and tabs, snooze, mute, and delegation are not supported. Delegation requires a service account, which the Gmail API access used by this server does not provide. The server also does not perform general sending outside its planned send workflow.

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