# yybd/multi-mail-mcp [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/yybd/multi-mail-mcp  
**GitHub Stars:** 0  
**npm Downloads (last month):** 1306  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/yybd-multi-mail-mcp

## Description
Several Gmail accounts in one server for Claude Desktop, Claude Code and ChatGPT: search one or all mailboxes, read threads, draft and send in-thread replies. Runs on your machine with your own OAuth client, read and compose scopes only (no delete), over stdio or token-protected Streamable HTTP.

## Tools
Capabilities this server exposes over MCP:

- **list_accounts** — List the Gmail accounts this server can use. Call it first when the user has not said which mailbox, or to learn the aliases to pass as "account" to every other tool. Returns each account's email, alias, and whether labels and calendar are enabled for it, the default account if one is set, and whether sending is enabled or the server is in drafts-only mode. Takes no input and changes nothing.
- **search_emails** — Search one mailbox, or all of them with account="all", using Gmail search syntax. Returns id, thread id, date, from, to, subject and snippet — use read_email for the full body. An empty query lists the newest mail.
- **read_email** — Read one message in full: from, to, cc, reply-to, date, subject, labels, the body as plain text (HTML is converted to text), and the list of attachments with part_id, name, type and size. Use it after search_emails when you need what a single message says; use read_thread instead for the whole conversation. The body is cut at max_chars and marked "[truncated]" with truncated=true; attachment contents are not included (fetch one with get_attachment). An unknown message_id returns an error saying the message was not found. Read-only; does not mark the message as read.
- **read_thread** — Read a whole conversation: every message in the thread, oldest first, each with the same fields as read_email (headers, plain-text body, attachment list). Use it when the reply history matters, such as before answering or summarising a back-and-forth; use read_email for a single message. max_chars is shared across the thread: each message gets an equal part of it (at least 2,000 characters), and longer bodies are cut and marked "[truncated]". An unknown thread_id returns an error. Read-only.
- **list_labels** — List every label of one mailbox: system labels such as INBOX, UNREAD, STARRED, SENT, and the user's own labels (Gmail's folders), each with its id, name and type, sorted by name. Use it to find the exact name for a "label:" search in search_emails, or the name or id to pass to modify_labels. Works on every account, with or without --labels. Read-only.
- **create_draft** — Save a message (new or reply) in Gmail Drafts without sending it. The safe default for writing.
- **send_email** — Send a message (new or reply) immediately. Only when the user explicitly asked to send; confirm recipients, subject and body with them first.
- **list_drafts** — List the drafts saved in one mailbox: for each, the draftId (needed by send_draft), the message id, thread id, date, recipients, subject and a short snippet. Use it to check what is waiting to be sent, or to find a draft made earlier with create_draft. To read a draft's full text, pass its message id to read_email. Read-only.
- **send_draft** — Send an existing draft. Only when the user explicitly asked to send it.
- **get_attachment** — Download one attachment of a message and return its contents. Text files and PDFs with a text layer come back as text, PNG/JPEG/GIF/WebP images (up to 5 MB) as an image you can see; any other file, and a scanned PDF, is saved under ~/.multi-mail/attachments and its path is returned with a note. Use it after read_email when the user needs what an attached invoice, report or photo says. Pick the file by part_id from read_email's attachment list, or by filename; a message with a single attachment needs neither. Returns an error listing the attachments if none matches. Does not change the mailbox.
- **modify_labels** — Add or remove labels on specific messages, or on every message of a thread. This is how to mark read (remove UNREAD), mark unread (add UNREAD), archive (remove INBOX), star (add STARRED), or file mail under a label. Labels are names in any case, or ids from list_labels; unknown names return an error, and create_label makes new ones. Returns the account and the label ids that were added and removed. Only for accounts connected with --labels (otherwise the error says how to enable it). TRASH and SPAM are refused, so nothing can be deleted or marked as spam.
- **create_label** — Create a new user label in one mailbox and return its id and name, ready for modify_labels. Use it when the user wants mail filed under a label that list_labels does not show yet. A "/" makes a nested label, e.g. "Projects/Acme". Fails if a label with that name already exists. Only for accounts connected with --labels.
- **search** — Search every connected Gmail account (Gmail query syntax). Returns result ids for the fetch tool.
- **fetch** — Full text of a message returned by the search tool (id is "account:messageId").

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

```json
"mcpServers": {
  "multi-mail-mcp": {
    "command": "npx",
    "args": ["-y","@yybd/multi-mail-mcp"]
  }
}
```

## Documentation

## What yybd/multi-mail-mcp does

yybd/multi-mail-mcp exposes Gmail and optional Google Calendar operations through the Model Context Protocol. Multiple accounts can be connected to one server and addressed by full email address, alias, or the portion before the `@`; searches can also target every connected mailbox with `account="all"`.

Mail capabilities include Gmail-syntax searches, complete message retrieval, conversation reading, label and folder listing, draft creation, immediate sending, and draft listing or sending. Replies can preserve the original thread and recipient details, with an option to reply to all original recipients. Attachments are returned according to type: text and PDF content is extracted as text, images are returned as images, and other files are saved under `~/.multi-mail/attachments`.

Optional label access supports adding and removing labels, marking messages read or unread, archiving, and starring. Nested labels such as `Projects/Acme` can be created. Calendar-enabled accounts add event listing, free-time searches across visible calendars, and creation of events on the user's own calendar without invitations or outgoing email.

## How it works

The package uses the Gmail API and each user supplies their own Google OAuth client. Mail traffic goes between the local machine and Google. Default Gmail permissions are `gmail.readonly` and `gmail.compose`, so the server can read mail and compose messages but cannot delete mail, move it to trash, or change account settings.

Each account can independently enable labels with `--labels` or Calendar access with `--calendar`. Calendar access adds read-only calendar and event permissions; the server does not edit or delete existing events. Calendar times use each calendar's configured time zone, with `MULTI_MAIL_TZ` or a tool-level `time_zone` available when correction is needed.

The `--drafts-only` option, or `MULTI_MAIL_SEND=off`, removes sending tools entirely. Agents can still search, read, and create drafts, while a person sends them from Gmail. This mode is suited to automated triage and other workflows where messages should not be sent without approval.

## Setup and configuration

Node.js 20 or newer is required. The published package can be run with `npx`, so a separate installation is not needed. Use the stdio entry point for local clients such as Claude Desktop and Claude Code. Streamable HTTP is available for clients that connect by URL, including ChatGPT; HTTP requires a token before the server starts.

A default mailbox can be selected with `MULTI_MAIL_DEFAULT`. Use an account address, alias, or local-part when selecting a mailbox in a tool. Start with `--drafts-only` when outbound sending should be unavailable.

## Tools and capabilities

- Inspect connected accounts, aliases, labels, drafts, messages, threads, and attachments.
- Search one mailbox or all connected mailboxes using Gmail query syntax.
- Create new drafts, prepare threaded replies, send messages, and send selected drafts.
- Apply or remove labels, archive or star messages, and mark them read or unread when label access is enabled.
- List events and find free periods across enabled calendars.
- Create personal calendar events without inviting attendees.
- Use the `search` capability to search across mailboxes and fetch one message in the format expected by ChatGPT connectors and deep research.

## Limitations and notes

The server has no delete, trash, spam, mailbox-settings, or event-editing tools. Label-enabled accounts receive a broader Google scope, but the server refuses `TRASH` and `SPAM` labels. Calendar tools appear only when at least one account has Calendar enabled. Scanned PDFs and unsupported attachment types are stored on disk rather than returned as extracted text. Tokens are kept on the local machine with `600` permissions, and the HTTP transport will not run without a token.

_Full upstream README: https://allmcps.com/mcp/yybd-multi-mail-mcp/readme_

