# @klodr/gmail-mcp [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/klodr/gmail-mcp  
**GitHub Stars:** 19  
**npm Downloads (last month):** 2918  
**Views:** 6  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/klodr-gmail-mcp

## Description
Gmail MCP server — scope-gated tools + attachment/download path jails + supply-chain hardening. Fork of GongRzhe/Gmail-MCP-Server via ArtyMcLabin's intermediate fork.

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

```json
"mcpServers": {
  "gmail-mcp": {
    "command": "npx",
    "args": ["-y","@klodr/gmail-mcp"]
  }
}
```

## Documentation

## What @klodr/gmail-mcp does

@klodr/gmail-mcp gives MCP-compatible AI assistants access to selected Gmail operations. Its tool surface covers reading and searching messages, creating and sending drafts, modifying labels, managing filters, working with threads, replying or forwarding, and downloading email or attachments.

The server wraps the Gmail v1 API rather than exposing an unrestricted account connection. OAuth scopes determine which operations are authorized, and the tool list is narrowed to match those grants. This makes it suitable for deployments where read-only access and limited write access should remain distinct.

## How it works

The package runs as an MCP server and can be launched through npx. An assistant invokes Gmail operations as MCP tools, while the server mediates request validation and account actions. Thread-aware operations preserve reply relationships using the relevant mail headers, and replies can use a permitted Gmail send-as alias.

Safety checks run inside the process. They include CRLF and null-byte sanitization, bounds on batch inputs, recipient validation, optional recipient pairing, write limits, and audit logging. Download operations use source and destination path jails, symlink-safe writes, and protections against path traversal. Exported files can be written as JSON, EML, TXT, or HTML; HTML exports block scripts, frames, forms, and remote resources unless explicitly allowed.

## Setup and configuration

Install or run the package with npx and complete Gmail OAuth authorization. The server supports a `--scopes` option so deployments can request only the Gmail permissions they need. OAuth credential files are protected with restrictive file permissions, and the loopback authorization flow checks both state and PKCE with S256.

A `gcp-oauth.keys.json` file in the project directory is used during authentication rather than being imported during an ordinary server start. Recipient pairing can be enabled with `GMAIL_MCP_RECIPIENT_PAIRING`; when enabled, a human must approve additions through the MCP client or the package's pairing command. Paired addresses constrain sends, replies, forwards, and drafts.

## Tools and capabilities

Available Gmail functions include:

- Read and search messages, including visible Cc and Bcc fields.
- Create, inspect, and send drafts.
- Send messages, reply in-thread, reply-all, and forward mail.
- Select a validated send-as alias for outgoing mail.
- Retrieve threads, list inbox threads, and view an inbox grouped by thread.
- Create, list, update, and delete labels and filters.
- Apply batch message changes or deletions with retry handling.
- Download messages as JSON, EML, TXT, or HTML.
- Download one attachment or all attachments, optionally packaged as a ZIP.

Tool annotations identify read-only, destructive, and idempotent behavior for MCP clients that use those hints.

## Limitations and notes

OAuth scope selection affects both authorization and which tools appear. Forwarding filters are rejected to prevent a rule from silently redirecting future matching mail. Recipient pairing is an optional safeguard, but when enabled it cannot be expanded by the model through Gmail tools alone.

The server refuses unrecognized send-as addresses when Gmail exposes a non-empty alias list. It also validates draft recipients before sending and applies write caps over both 24-hour and 30-day periods. Downloaded files receive operating-system internet-origin markers where supported, and path protections are designed to prevent prompt-injected file exfiltration.

_Full upstream README: https://allmcps.com/mcp/klodr-gmail-mcp/readme_

