Skip to content
Back to search

Gmail-MCP-Server

A Model Context Protocol (MCP) server for Gmail integration in Claude Desktop with auto authentication support. This server enables AI assistants to manage Gmail through natural language interactions.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/artymclabin--gmail-mcp-server/badge.svg)](/listings/artymclabin--gmail-mcp-server)

HTML

<a href="/listings/artymclabin--gmail-mcp-server"><img src="/api/listings/artymclabin--gmail-mcp-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Installing from npm (recommended)

npx @artymclabin/gmail-mcp auth

Installing from source

git clone https://github.com/ArtyMcLabin/Gmail-MCP-Server.git
cd Gmail-MCP-Server
npm install
npm run build

> **Note**: The `npx @gongrzhe/server-gmail-autoauth-mcp` commands found in older docs reference the [unmaintained upstream fork](https://github.com/GongRzhe/Gmail-MCP-Server). This fork is published as [`@artymclabin/gmail-mcp`](https://www.npmjs.com/package/@artymclabin/gmail-mcp).

Setting up Google Cloud credentials

1. Create a Google Cloud Project and obtain credentials:

a. Create a Google Cloud Project: - Go to [Google Cloud Console](https://console.cloud.google.com/) - Create a new project or select an existing one - Enable the Gmail API for your project

b. Create OAuth 2.0 Credentials: - Go to "APIs & Services" > "Credentials" - Click "Create Credentials" > "OAuth client ID" - Choose either "Desktop app" or "Web application" as application type - Give it a name and click "Create" - For Web application, add `http://localhost:3000/oauth2callback` to the authorized redirect URIs - Download the JSON file of your client's OAuth keys - Rename the key file to `gcp-oauth.keys.json`

2. Run Authentication:

You can authenticate in two ways:

a. Global Authentication (Recommended):

   # First time: Place gcp-oauth.keys.json in your home directory's .gmail-mcp folder
   mkdir -p ~/.gmail-mcp
   mv gcp-oauth.keys.json ~/.gmail-mcp/

   # Run authentication from anywhere
   node dist/index.js auth

b. Local Authentication:

   # Place gcp-oauth.keys.json in your current directory
   # The file will be automatically copied to global config
   node dist/index.js auth

The authentication process will: - Look for `gcp-oauth.keys.json` in the current directory or `~/.gmail-mcp/` - If found in current directory, copy it to `~/.gmail-mcp/` - Open your default browser for Google authentication - Save credentials as `~/.gmail-mcp/credentials.json`

> **Note**: > - After successful authentication, credentials are stored globally in `~/.gmail-mcp/` and can be used from any directory > - Both Desktop app and Web application credentials are supported > - For Web application credentials, make sure to add `http://localhost:3000/oauth2callback` to your authorized redirect URIs

**Custom callback URL / port:** By default the local OAuth server listens on port `3000` at `/oauth2callback`. If port 3000 is unavailable, or you need a different redirect URI, pass a full callback URL as an argument. The listener automatically binds to the port and path from that URL:

   node dist/index.js auth http://localhost:8080/oauth2callback

The URL you pass must exactly match one of the authorized redirect URIs registered in the Google Cloud Console.

3. Configure in Claude Desktop:

{
  "mcpServers": {
    "gmail": {
      "command": "node",
      "args": [
        "/absolute/path/to/Gmail-MCP-Server/dist/index.js"
      ]
    }
  }
}

Docker Support

If you prefer using Docker:

1. Authentication:

docker run -i --rm \
  --mount type=bind,source=/path/to/gcp-oauth.keys.json,target=/gcp-oauth.keys.json \
  -v mcp-gmail:/gmail-server \
  -e GMAIL_OAUTH_PATH=/gcp-oauth.keys.json \
  -e "GMAIL_CREDENTIALS_PATH=/gmail-server/credentials.json" \
  -p 3000:3000 \
  mcp/gmail auth

2. Usage:

{
  "mcpServers": {
    "gmail": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v",
        "mcp-gmail:/gmail-server",
        "-e",
        "GMAIL_CREDENTIALS_PATH=/gmail-server/credentials.json",
        "mcp/gmail"
      ]
    }
  }
}

Cloud Server Authentication

For cloud server environments (like n8n), you can specify a custom callback URL during authentication:

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 1,094 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ![Gmail MCP Server](assets/banner.jpg)
  2. # Gmail MCP Server (Actively Maintained Fork)
  3. **Installation:** `npx @artymclabin/gmail-mcp auth` - or just tell your Claude to install the MCP from this repo (`https://github.com/ArtyMcLabin/Gmail-MCP-Server`) and let it set up. Prefer manual steps? See [Installation & Authentication](#installation--authentication).
  4. [![CI](https://github.com/ArtyMcLabin/Gmail-MCP-Server/actions/workflows/ci.yml/badge.svg)](https://github.com/ArtyMcLabin/Gmail-MCP-Server/actions/workflows/ci.yml) [![npm](https://img.shields.io/npm/v/@artymclabin/gmail-mcp)](https://www.npmjs.com/package/@artymclabin/gmail-mcp)
  5. Also on the [official MCP Registry](https://registry.modelcontextprotocol.io) (`io.github.ArtyMcLabin/Gmail-MCP-Server`) and [Smithery](https://smithery.ai/servers/rawceo/gmail-mcp).
  6. > **This is an actively maintained fork of [GongRzhe/Gmail-MCP-Server](https://github.com/GongRzhe/Gmail-MCP-Server).**
  7. >
  8. > The original repository has been unmaintained since August 2025 - 7+ months with zero maintainer activity and 72+ unmerged pull requests. I use this MCP server daily as part of my Claude Code workflow and depend on it working correctly, so I picked it up.
  9. >
  10. > **Pull requests are welcome.** If you've been sitting on fixes or features with nowhere to submit them, this is the place.
  11. ## Philosophy
  12. This fork is **lean and pragmatic**. It's a local stdio MCP server - you run it on your own machine, and your LLM client already has shell + filesystem access. So the threat model is "don't leak credentials to third parties, don't break the Gmail surface" - not "defend a hosted multi-tenant service". I keep dependencies minimal. I use this daily in my own Claude Code workflow - if I wouldn't run it or maintain it myself, it doesn't go in.
  13. There's a downstream fork that took this in the **maximalist** direction. I'm not affiliated with its maintainer and I don't track its security or features - use it at your own risk: **[klodr/gmail-mcp](https://github.com/klodr/gmail-mcp)**. If that's the philosophy you want, go check it out. PRs welcome here as always.
  14. ### What this fork adds
  15. - **Fixed reply threading** - auto-resolves `In-Reply-To` and `References` headers so email replies land in the correct thread instead of creating orphaned messages ([upstream PR #91](https://github.com/GongRzhe/Gmail-MCP-Server/pull/91), still pending)
  16. - **Send-as alias support** - optional `from` parameter for multi-identity email management (send from any configured Gmail alias)
  17. - **Reply-all tool** - `reply_all` automatically fetches the original email, builds To/CC recipient lists (excluding yourself), and sets proper threading headers ([PR #3](https://github.com/ArtyMcLabin/Gmail-MCP-Server/pull/3) by [@MaxGhenis](https://github.com/MaxGhenis))
  18. - **Fixed `list_filters`** - was returning empty array due to wrong response property name ([PR #4](https://github.com/ArtyMcLabin/Gmail-MCP-Server/pull/4) by [@nicholas-anthony-ai](https://github.com/nicholas-anthony-ai))
  19. - **Custom OAuth2 scoping** - `--scopes` flag to request only the permissions you need, with automatic tool filtering ([PR #6](https://github.com/ArtyMcLabin/Gmail-MCP-Server/pull/6) by [@tansanDOTeth](https://github.com/tansanDOTeth))
  20. - **CI/CD hardening** - fixed shell injection vector in GitHub Actions workflow, added least-privilege permissions scope ([PR #9](https://github.com/ArtyMcLabin/Gmail-MCP-Server/pull/9) by [@JF10R](https://github.com/JF10R))
  21. - **Security hardening** - fixed path traversal in attachment download, restricted OAuth credential file permissions ([PR #10](https://github.com/ArtyMcLabin/Gmail-MCP-Server/pull/10) by [@JF10R](https://github.com/JF10R))
  22. - **Dependency security** - upgraded MCP SDK to v1.27.1 (3 CVE fixes), upgraded nodemailer (DoS + routing fix), moved dev-only packages out of production deps ([PR #11](https://github.com/ArtyMcLabin/Gmail-MCP-Server/pull/11) by [@JF10R](https://github.com/JF10R))
  23. - **Thread-level tools** - `get_thread`, `list_inbox_threads`, `get_inbox_with_threads`, `modify_thread` for efficient thread-based email operations in a single call
  24. - **CC/BCC visibility** - `read_email` now shows CC and BCC headers when present ([PR #21](https://github.com/ArtyMcLabin/Gmail-MCP-Server/pull/21) by [@panghy](https://github.com/panghy))
  25. - **Phishing report tools** - `report_phishing` and `batch_report_phishing` for marking messages as spam via the Gmail API ([PR #24](https://github.com/ArtyMcLabin/Gmail-MCP-Server/pull/24) by [@ShivamB25](https://github.com/ShivamB25))
  26. - **Draft lifecycle tools** - `send_draft`, `delete_draft`, `update_draft` close the orphan-draft gap: `send_draft` atomically sends an existing draft and removes it from Drafts (no ghost copy); `update_draft` mutates a draft in place preserving its ID (no draft pile-up across iteration loops); `delete_draft` discards an abandoned draft ([PR #30](https://github.com/ArtyMcLabin/Gmail-MCP-Server/pull/30) by [@thisisambros](https://github.com/thisisambros))
  27. - **Tool annotations** - MCP spec annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`) on all tools for safer LLM tool execution ([PR #14](https://github.com/ArtyMcLabin/Gmail-MCP-Server/pull/14) by [@bryankthompson](https://github.com/bryankthompson))
  28. - **Download email tool** - `download_email` saves emails to disk in json/eml/txt/html formats without consuming LLM context ([PR #13](https://github.com/ArtyMcLabin/Gmail-MCP-Server/pull/13) by [@icanhasjonas](https://github.com/icanhasjonas))
  29. - **Durable OAuth sessions** - `refresh_token` is persisted across restarts, ending the hourly re-auth loop ([PR #35](https://github.com/ArtyMcLabin/Gmail-MCP-Server/pull/35) by [@BrentBaccala](https://github.com/BrentBaccala))
  30. - **Custom OAuth callback port** - the auth listener derives port and path from your callback URL instead of hardcoding 3000 ([PR #41](https://github.com/ArtyMcLabin/Gmail-MCP-Server/pull/41) by [@soapergem](https://github.com/soapergem))
  31. - **Safe permanent-delete gating** - `delete_email`/`batch_delete_emails` require the opt-in `gmail.full` scope (which also satisfies all other mail scopes), so default auth stays least-privilege ([PR #39](https://github.com/ArtyMcLabin/Gmail-MCP-Server/pull/39) by [@caioribeiroclw-pixel](https://github.com/caioribeiroclw-pixel))
  32. All features are production-tested in daily use.
  33. [![Star History Chart](https://api.star-history.com/svg?repos=ArtyMcLabin/Gmail-MCP-Server&type=Date)](https://star-history.com/#ArtyMcLabin/Gmail-MCP-Server&Date)
  34. ---
  35. A Model Context Protocol (MCP) server for Gmail integration in Claude Desktop with auto authentication support. This server enables AI assistants to manage Gmail through natural language interactions.
  36. ![](https://badge.mcpx.dev?type=server 'MCP Server')
  37. ## Features
  38. - Send emails with subject, content, **attachments**, and recipients
  39. - **Full attachment support** - send and receive file attachments
  40. - **Download email attachments** to local filesystem
  41. - **Download full emails** to files in json/eml/txt/html formats
  42. - **Thread-level operations** - get full threads, list inbox threads, batch-expand threads
  43. - Support for HTML emails and multipart messages with both HTML and plain text versions
  44. - Full support for international characters in subject lines and email content
  45. - Read email messages by ID with advanced MIME structure handling
  46. - **Enhanced attachment display** showing filenames, types, sizes, and download IDs
  47. - Search emails with various criteria (subject, sender, date range)
  48. - **Comprehensive label management with ability to create, update, delete and list labels**
  49. - List all available Gmail labels (system and user-defined)
  50. - List emails in inbox, sent, or custom labels
  51. - Mark emails as read/unread
  52. - Move emails to different labels/folders
  53. - Delete emails
  54. - **Batch operations for efficiently processing multiple emails at once**
  55. - Full integration with Gmail API
  56. - Simple OAuth2 authentication flow with auto browser launch
  57. - Support for both Desktop and Web application credentials
  58. - Global credential storage for convenience
  59. ## Installation & Authentication
  60. ### Installing from npm (recommended)
  61. ```bash
  62. npx @artymclabin/gmail-mcp auth
  63. ```
  64. ### Installing from source
  65. ```bash
  66. git clone https://github.com/ArtyMcLabin/Gmail-MCP-Server.git
  67. cd Gmail-MCP-Server
  68. npm install
  69. npm run build
  70. ```
  71. > **Note**: The `npx @gongrzhe/server-gmail-autoauth-mcp` commands found in older docs reference the [unmaintained upstream fork](https://github.com/GongRzhe/Gmail-MCP-Server). This fork is published as [`@artymclabin/gmail-mcp`](https://www.npmjs.com/package/@artymclabin/gmail-mcp).
  72. ### Setting up Google Cloud credentials
  73. 1. Create a Google Cloud Project and obtain credentials:
  74. a. Create a Google Cloud Project:
  75. - Go to [Google Cloud Console](https://console.cloud.google.com/)
  76. - Create a new project or select an existing one
  77. - Enable the Gmail API for your project
  78. b. Create OAuth 2.0 Credentials:
  79. - Go to "APIs & Services" > "Credentials"
  80. - Click "Create Credentials" > "OAuth client ID"
  81. - Choose either "Desktop app" or "Web application" as application type
  82. - Give it a name and click "Create"
  83. - For Web application, add `http://localhost:3000/oauth2callback` to the authorized redirect URIs
  84. - Download the JSON file of your client's OAuth keys
  85. - Rename the key file to `gcp-oauth.keys.json`
  86. 2. Run Authentication:
  87. You can authenticate in two ways:
  88. a. Global Authentication (Recommended):
  89. ```bash
  90. # First time: Place gcp-oauth.keys.json in your home directory's .gmail-mcp folder
  91. mkdir -p ~/.gmail-mcp
  92. mv gcp-oauth.keys.json ~/.gmail-mcp/
  93. # Run authentication from anywhere
  94. node dist/index.js auth
  95. ```
  96. b. Local Authentication:
  97. ```bash
  98. # Place gcp-oauth.keys.json in your current directory
  99. # The file will be automatically copied to global config
  100. node dist/index.js auth
  101. ```
  102. The authentication process will:
  103. - Look for `gcp-oauth.keys.json` in the current directory or `~/.gmail-mcp/`
  104. - If found in current directory, copy it to `~/.gmail-mcp/`
  105. - Open your default browser for Google authentication
  106. - Save credentials as `~/.gmail-mcp/credentials.json`
  107. > **Note**:
  108. > - After successful authentication, credentials are stored globally in `~/.gmail-mcp/` and can be used from any directory
  109. > - Both Desktop app and Web application credentials are supported
  110. > - For Web application credentials, make sure to add `http://localhost:3000/oauth2callback` to your authorized redirect URIs
  111. **Custom callback URL / port:** By default the local OAuth server listens on port `3000` at `/oauth2callback`. If port 3000 is unavailable, or you need a different redirect URI, pass a full callback URL as an argument. The listener automatically binds to the port and path from that URL:
  112. ```bash
  113. node dist/index.js auth http://localhost:8080/oauth2callback
  114. ```
  115. The URL you pass must exactly match one of the authorized redirect URIs registered in the Google Cloud Console.
  116. 3. Configure in Claude Desktop:
  117. ```json
  118. {
  119. "mcpServers": {
  120. "gmail": {
  121. "command": "node",
  122. "args": [
  123. "/absolute/path/to/Gmail-MCP-Server/dist/index.js"
  124. ]
  125. }
  126. }
  127. }
  128. ```
  129. ### Docker Support
  130. If you prefer using Docker:
  131. 1. Authentication:
  132. ```bash
  133. docker run -i --rm \
  134. --mount type=bind,source=/path/to/gcp-oauth.keys.json,target=/gcp-oauth.keys.json \
  135. -v mcp-gmail:/gmail-server \
  136. -e GMAIL_OAUTH_PATH=/gcp-oauth.keys.json \
  137. -e "GMAIL_CREDENTIALS_PATH=/gmail-server/credentials.json" \
  138. -p 3000:3000 \
  139. mcp/gmail auth
  140. ```
  141. 2. Usage:
  142. ```json
  143. {
  144. "mcpServers": {
  145. "gmail": {
  146. "command": "docker",
  147. "args": [
  148. "run",
  149. "-i",
  150. "--rm",
  151. "-v",
  152. "mcp-gmail:/gmail-server",
  153. "-e",
  154. "GMAIL_CREDENTIALS_PATH=/gmail-server/credentials.json",
  155. "mcp/gmail"
  156. ]
  157. }
  158. }
  159. }
  160. ```
  161. ### Cloud Server Authentication
  162. For cloud server environments (like n8n), you can specify a custom callback URL during authentication:
  163. ```bash
  164. node dist/index.js auth https://gmail.gongrzhe.com/oauth2callback
  165. ```
  166. #### Setup Instructions for Cloud Environment
  167. 1. **Configure Reverse Proxy:**
  168. - Set up your n8n container to expose a port for authentication
  169. - Configure a reverse proxy to forward traffic from your domain (e.g., `gmail.gongrzhe.com`) to this port
  170. 2. **DNS Configuration:**
  171. - Add an A record in your DNS settings to resolve your domain to your cloud server's IP address
  172. 3. **Google Cloud Platform Setup:**
  173. - In your Google Cloud Console, add your custom domain callback URL (e.g., `https://gmail.gongrzhe.com/oauth2callback`) to the authorized redirect URIs list
  174. 4. **Run Authentication:**
  175. ```bash
  176. node dist/index.js auth https://gmail.gongrzhe.com/oauth2callback
  177. ```
  178. 5. **Configure in your application:**
  179. ```json
  180. {
  181. "mcpServers": {
  182. "gmail": {
  183. "command": "node",
  184. "args": [
  185. "/absolute/path/to/Gmail-MCP-Server/dist/index.js"
  186. ]
  187. }
  188. }
  189. }
  190. ```
  191. This approach allows authentication flows to work properly in environments where localhost isn't accessible, such as containerized applications or cloud servers.
  192. ## OAuth Scopes
  193. You can limit the server's Gmail access by specifying OAuth scopes during authentication. This controls which tools are available to the LLM, reducing the attack surface for sensitive operations.
  194. ### Available Scopes
  195. | Scope | Description |
  196. |-------|-------------|
  197. | `gmail.readonly` | Read-only access to emails (search, read, download attachments) |
  198. | `gmail.modify` | Full read/write access to emails (superset of `readonly` - includes sending, modifying, deleting) |
  199. | `gmail.compose` | Create drafts and send emails only |
  200. | `gmail.send` | Send emails only |
  201. | `gmail.labels` | Manage labels only |
  202. | `gmail.settings.basic` | Manage filters and settings |
  203. > **Note**: `gmail.modify` is a superset that includes all read capabilities. You don't need `gmail.readonly` if you have `gmail.modify`.
  204. ### Authenticating with Specific Scopes
  205. Use the `--scopes` flag to request only the permissions you need:
  206. ```bash
  207. # Read-only access (recommended for safe browsing)
  208. node dist/index.js auth --scopes=gmail.readonly
  209. # Read-only with filter management
  210. node dist/index.js auth --scopes=gmail.readonly,gmail.settings.basic
  211. # Full access (default behavior)
  212. node dist/index.js auth --scopes=gmail.modify,gmail.settings.basic
  213. ```
  214. If no `--scopes` flag is provided, the server defaults to `gmail.modify,gmail.settings.basic` for full functionality.
  215. ### Scope-to-Tool Mapping
  216. The server automatically filters available tools based on your authorized scopes:
  217. | Tools | Required Scope (any) |
  218. |-------|---------------------|
  219. | `read_email`, `search_emails`, `download_attachment` | `gmail.readonly` or `gmail.modify` |
  220. | `list_email_labels` | `gmail.readonly`, `gmail.modify`, or `gmail.labels` |
  221. | `send_email`, `draft_email`, `reply_all`, `send_draft` | `gmail.modify`, `gmail.compose`, or `gmail.send` |
  222. | `delete_draft`, `update_draft` | `gmail.modify` or `gmail.compose` |
  223. | `modify_email`, `batch_modify_emails`, `modify_thread`, `report_phishing`, `batch_report_phishing` | `gmail.modify` |
  224. | `delete_email`, `batch_delete_emails` | `gmail.full` (`https://mail.google.com/`) |
  225. | `create_label`, `update_label`, `delete_label`, `get_or_create_label` | `gmail.modify` or `gmail.labels` |
  226. | `list_filters`, `get_filter`, `create_filter`, `delete_filter`, `create_filter_from_template` | `gmail.settings.basic` |
  227. `gmail.full` is intentionally separate from the default scopes because it grants permanent-delete capability. Prefer `modify_email` / `batch_modify_emails` for archive, mark-read, label, or inbox cleanup flows; re-authenticate with `--scopes=gmail.full,gmail.settings.basic` only when the assistant should be able to permanently delete mail. `gmail.full` is a superset of the other mail scopes, so that combination keeps every read/send/modify/label tool available (settings scopes remain separate - Gmail's filter endpoints only accept `gmail.settings.*`).
  228. ### Re-authenticating
  229. To change your scopes, simply run the auth command again with different scopes. This will replace your existing credentials.
  230. ## Claude Code CLI Configuration
  231. To use this MCP server with [Claude Code](https://docs.anthropic.com/en/docs/claude-code), add it to your MCP settings.
  232. ### Read-Only Configuration (Recommended for Safe Browsing)
  233. First, authenticate with read-only scope:
  234. ```bash
  235. node dist/index.js auth --scopes=gmail.readonly
  236. ```
  237. Then add to your Claude Code MCP settings (`~/.claude/mcp_settings.json` or project-level `.mcp.json`):
  238. ```json
  239. {
  240. "mcpServers": {
  241. "gmail": {
  242. "command": "npx",
  243. "args": ["/absolute/path/to/Gmail-MCP-Server/dist/index.js"]
  244. }
  245. }
  246. }
  247. ```
  248. With read-only scopes, only these 4 tools will be available to Claude:
  249. - `read_email` - Read email content
  250. - `search_emails` - Search your inbox
  251. - `list_email_labels` - List available labels
  252. - `download_attachment` - Download attachments
  253. ### Full Access Configuration
  254. For full Gmail management capabilities:
  255. ```bash
  256. node dist/index.js auth --scopes=gmail.modify,gmail.settings.basic
  257. ```
  258. ```json
  259. {
  260. "mcpServers": {
  261. "gmail": {
  262. "command": "npx",
  263. "args": ["/absolute/path/to/Gmail-MCP-Server/dist/index.js"]
  264. }
  265. }
  266. }
  267. ```
  268. This enables all 23 tools including sending emails, managing labels, creating filters, reply-all, thread operations, phishing reports, and batch operations.
  269. ### Running multiple instances (tool-name prefix)
  270. Some MCP clients dedupe tool entries by their base name across servers, which makes it impossible to run two instances of this server side-by-side (e.g. one for a personal account and one for a shared inbox) - only one instance's tools surface, even though both servers report as connected.
  271. The server accepts an optional `--tool-prefix=<value>` CLI flag (or `GMAIL_MCP_TOOL_PREFIX` env var) that is prepended to every tool name at registration. Default is empty (fully backward-compatible).
  272. Example: register two instances with distinct prefixes in Claude Code:
  273. ```bash
  274. # Personal account
  275. claude mcp add gmail-personal -s user \
  276. -e GMAIL_CREDENTIALS_PATH=$HOME/.gmail-mcp/credentials-personal.json \
  277. -- node /absolute/path/to/Gmail-MCP-Server/dist/index.js --tool-prefix=personal_
  278. # Shared inbox
  279. claude mcp add gmail-info -s user \
  280. -- node /absolute/path/to/Gmail-MCP-Server/dist/index.js --tool-prefix=info_
  281. ```
  282. Tools then surface as `mcp__gmail-personal__personal_search_emails`, `mcp__gmail-info__info_search_emails`, etc. - distinct at every layer. The dispatch handler strips the prefix and looks up the resolved name via `getToolByName`; only strips when the result is a known tool (so a prefix value that overlaps a real tool name cannot cause silent mis-dispatch).
  283. The `auth` subcommand runs before the server starts and is unaffected - invoke it without `--tool-prefix`.
  284. ## Available Tools
  285. The server provides the following tools that can be used through Claude Desktop:
  286. ### 1. Send Email (`send_email`)
  287. Sends a new email immediately. Supports plain text, HTML, or multipart emails **with optional file attachments and inline images**.
  288. Basic Email:
  289. ```json
  290. {
  291. "to": ["recipient@example.com"],
  292. "subject": "Meeting Tomorrow",
  293. "body": "Hi,\n\nJust a reminder about our meeting tomorrow at 10 AM.\n\nBest regards",
  294. "cc": ["cc@example.com"],
  295. "bcc": ["bcc@example.com"],
  296. "mimeType": "text/plain"
  297. }
  298. ```
  299. **Email with Attachments:**
  300. ```json
  301. {
  302. "to": ["recipient@example.com"],
  303. "subject": "Project Files",
  304. "body": "Hi,\n\nPlease find the project files attached.\n\nBest regards",
  305. "attachments": [
  306. "/path/to/document.pdf",
  307. "/path/to/spreadsheet.xlsx",
  308. "/path/to/presentation.pptx"
  309. ]
  310. }
  311. ```
  312. HTML Email Example:
  313. ```json
  314. {
  315. "to": ["recipient@example.com"],
  316. "subject": "Meeting Tomorrow",
  317. "mimeType": "text/html",
  318. "body": "<html><body><h1>Meeting Reminder</h1><p>Just a reminder about our <b>meeting tomorrow</b> at 10 AM.</p><p>Best regards</p></body></html>"
  319. }
  320. ```
  321. Multipart Email Example (HTML + Plain Text):
  322. ```json
  323. {
  324. "to": ["recipient@example.com"],
  325. "subject": "Meeting Tomorrow",
  326. "mimeType": "multipart/alternative",
  327. "body": "Hi,\n\nJust a reminder about our meeting tomorrow at 10 AM.\n\nBest regards",
  328. "htmlBody": "<html><body><h1>Meeting Reminder</h1><p>Just a reminder about our <b>meeting tomorrow</b> at 10 AM.</p><p>Best regards</p></body></html>"
  329. }
  330. ```
  331. **Inline Images (embedded in HTML):**
  332. Embed images inside the HTML body so they render in place, instead of arriving as separate attachments. Reference each image from `htmlBody` by its `cid`, and supply it as a file `path` or base64 `content`. Works the same way on `draft_email`, `update_draft`, and `reply_all`.
  333. ```json
  334. {
  335. "to": ["recipient@example.com"],
  336. "subject": "Quarterly Report",
  337. "body": "Revenue is up. See the chart below.",
  338. "htmlBody": "<p>Revenue is up:</p><img src=\"cid:chart1\">",
  339. "inlineImages": [
  340. { "cid": "chart1", "path": "/path/to/chart.png" }
  341. ]
  342. }
  343. ```
  344. ### 2. Draft Email (`draft_email`)
  345. Creates a draft email without sending it. **Also supports attachments**.
  346. ```json
  347. {
  348. "to": ["recipient@example.com"],
  349. "subject": "Draft Report",
  350. "body": "Here's the draft report for your review.",
  351. "cc": ["manager@example.com"],
  352. "attachments": ["/path/to/draft_report.docx"]
  353. }
  354. ```
  355. ### 3. Read Email (`read_email`)
  356. Retrieves the content of a specific email by its ID. **Now shows enhanced attachment information**.
  357. ```json
  358. {
  359. "messageId": "182ab45cd67ef"
  360. }
  361. ```
  362. **Enhanced Response includes CC/BCC headers (when present) and attachment details:**
  363. ```
  364. Subject: Project Files
  365. From: sender@example.com
  366. To: recipient@example.com
  367. CC: colleague@example.com
  368. Date: Thu, 19 Jun 2025 10:30:00 -0400
  369. Email body content here...
  370. Attachments (2):
  371. - document.pdf (application/pdf, 245 KB, ID: ANGjdJ9fkTs-i3GCQo5o97f_itG...)
  372. - spreadsheet.xlsx (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, 89 KB, ID: BWHkeL8gkUt-j4HDRp6o98g_juI...)
  373. ```
  374. ### 4. **Download Attachment (`download_attachment`)**
  375. **NEW**: Downloads email attachments to your local filesystem.
  376. ```json
  377. {
  378. "messageId": "182ab45cd67ef",
  379. "attachmentId": "ANGjdJ9fkTs-i3GCQo5o97f_itG...",
  380. "savePath": "/path/to/downloads",
  381. "filename": "downloaded_document.pdf"
  382. }
  383. ```
  384. Parameters:
  385. - `messageId`: The ID of the email containing the attachment
  386. - `attachmentId`: The attachment ID (shown in enhanced email display)
  387. - `savePath`: Directory to save the file (optional, defaults to current directory)
  388. - `filename`: Custom filename (optional, uses original filename if not provided)
  389. ### 5. Search Emails (`search_emails`)
  390. Searches for emails using Gmail search syntax.
  391. ```json
  392. {
  393. "query": "from:sender@example.com after:2024/01/01 has:attachment",
  394. "maxResults": 10
  395. }
  396. ```
  397. ### 6. Modify Email (`modify_email`)
  398. Adds or removes labels from emails (move to different folders, archive, etc.).
  399. ```json
  400. {
  401. "messageId": "182ab45cd67ef",
  402. "addLabelIds": ["IMPORTANT"],
  403. "removeLabelIds": ["INBOX"]
  404. }
  405. ```
  406. ### 7. Delete Email (`delete_email`)
  407. Permanently deletes an email. This tool requires `gmail.full` (`https://mail.google.com/`); the default `gmail.modify` scope is not enough for Gmail's permanent-delete endpoint.
  408. ```json
  409. {
  410. "messageId": "182ab45cd67ef"
  411. }
  412. ```
  413. ### 8. List Email Labels (`list_email_labels`)
  414. Retrieves all available Gmail labels.
  415. ```json
  416. {}
  417. ```
  418. ### 9. Create Label (`create_label`)
  419. Creates a new Gmail label.
  420. ```json
  421. {
  422. "name": "Important Projects",
  423. "messageListVisibility": "show",
  424. "labelListVisibility": "labelShow"
  425. }
  426. ```
  427. ### 10. Update Label (`update_label`)
  428. Updates an existing Gmail label.
  429. ```json
  430. {
  431. "id": "Label_1234567890",
  432. "name": "Urgent Projects",
  433. "messageListVisibility": "show",
  434. "labelListVisibility": "labelShow"
  435. }
  436. ```
  437. ### 11. Delete Label (`delete_label`)
  438. Deletes a Gmail label.
  439. ```json
  440. {
  441. "id": "Label_1234567890"
  442. }
  443. ```
  444. ### 12. Get or Create Label (`get_or_create_label`)
  445. Gets an existing label by name or creates it if it doesn't exist.
  446. ```json
  447. {
  448. "name": "Project XYZ",
  449. "messageListVisibility": "show",
  450. "labelListVisibility": "labelShow"
  451. }
  452. ```
  453. ### 13. Batch Modify Emails (`batch_modify_emails`)
  454. Modifies labels for multiple emails in efficient batches.
  455. ```json
  456. {
  457. "messageIds": ["182ab45cd67ef", "182ab45cd67eg", "182ab45cd67eh"],
  458. "addLabelIds": ["IMPORTANT"],
  459. "removeLabelIds": ["INBOX"],
  460. "batchSize": 50
  461. }
  462. ```
  463. ### 14. Batch Delete Emails (`batch_delete_emails`)
  464. Permanently deletes multiple emails in efficient batches. This tool requires `gmail.full` (`https://mail.google.com/`); the default `gmail.modify` scope is not enough for Gmail's permanent-delete endpoint.
  465. ```json
  466. {
  467. "messageIds": ["182ab45cd67ef", "182ab45cd67eg", "182ab45cd67eh"],
  468. "batchSize": 50
  469. }
  470. ```
  471. ### 15. Create Filter (`create_filter`)
  472. Creates a new Gmail filter with custom criteria and actions.
  473. ```json
  474. {
  475. "criteria": {
  476. "from": "newsletter@company.com",
  477. "hasAttachment": false
  478. },
  479. "action": {
  480. "addLabelIds": ["Label_Newsletter"],
  481. "removeLabelIds": ["INBOX"]
  482. }
  483. }
  484. ```
  485. ### 16. List Filters (`list_filters`)
  486. Retrieves all Gmail filters.
  487. ```json
  488. {}
  489. ```
  490. ### 17. Get Filter (`get_filter`)
  491. Gets details of a specific Gmail filter.
  492. ```json
  493. {
  494. "filterId": "ANe1Bmj1234567890"
  495. }
  496. ```
  497. ### 18. Delete Filter (`delete_filter`)
  498. Deletes a Gmail filter.
  499. ```json
  500. {
  501. "filterId": "ANe1Bmj1234567890"
  502. }
  503. ```
  504. ### 19. Create Filter from Template (`create_filter_from_template`)
  505. Creates a filter using pre-defined templates for common scenarios.
  506. ```json
  507. {
  508. "template": "fromSender",
  509. "parameters": {
  510. "senderEmail": "notifications@github.com",
  511. "labelIds": ["Label_GitHub"],
  512. "archive": true
  513. }
  514. }
  515. ```
  516. ### 20. Reply All (`reply_all`)
  517. Replies to all recipients of an email. Automatically fetches the original email to build the recipient list and sets proper threading headers (`In-Reply-To`, `References`, `threadId`).
  518. **How it works:**
  519. 1. Fetches the original email by `messageId`
  520. 2. Builds **To** from the original sender (From header)
  521. 3. Builds **CC** from original To + CC, excluding your own email
  522. 4. Sets threading headers so the reply lands in the correct thread
  523. 5. Sends via the existing `send_email` pipeline (supports attachments, HTML, multipart)
  524. ```json
  525. {
  526. "messageId": "182ab45cd67ef",
  527. "body": "Thanks for the update, everyone. I'll review and get back to you.",
  528. "mimeType": "text/plain"
  529. }
  530. ```
  531. **With HTML and attachments:**
  532. ```json
  533. {
  534. "messageId": "182ab45cd67ef",
  535. "body": "Plain text fallback",
  536. "htmlBody": "<p>Thanks for the update. See attached notes.</p>",
  537. "mimeType": "multipart/alternative",
  538. "attachments": ["/path/to/notes.pdf"]
  539. }
  540. ```
  541. Parameters:
  542. - `messageId` (required): ID of the email to reply to
  543. - `body` (required): Reply body (plain text, or fallback when using multipart)
  544. - `htmlBody` (optional): HTML version of the reply body
  545. - `mimeType` (optional): `text/plain` (default), `text/html`, or `multipart/alternative`
  546. - `attachments` (optional): Array of file paths to attach
  547. ### 21. Modify Thread (`modify_thread`)
  548. Atomically modifies labels on an entire thread (all messages at once). Solves the problem where archiving only the latest message leaves older messages in the inbox.
  549. ```json
  550. {
  551. "threadId": "182ab45cd67ef",
  552. "addLabelIds": ["IMPORTANT"],
  553. "removeLabelIds": ["INBOX"]
  554. }
  555. ```
  556. ### 22. Report Phishing (`report_phishing`)
  557. Reports a message as phishing using the closest public Gmail API behavior by applying the SPAM label.
  558. ```json
  559. {
  560. "messageId": "182ab45cd67ef"
  561. }
  562. ```
  563. > **Note**: The Gmail API does not expose the full native "Report phishing" workflow. This tool applies the SPAM label as the closest available approximation.
  564. ### 23. Batch Report Phishing (`batch_report_phishing`)
  565. Reports multiple messages as phishing in efficient batches.
  566. ```json
  567. {
  568. "messageIds": ["182ab45cd67ef", "182ab45cd67eg", "182ab45cd67eh"],
  569. "batchSize": 50
  570. }
  571. ```
  572. ### 24. Send Draft (`send_draft`)
  573. Atomically sends an existing draft via `users.drafts.send` and removes it from the Drafts folder in the same operation - no orphan/ghost draft left behind. Use after a `draft_email` (or `update_draft`) once the content is confirmed.
  574. ```json
  575. {
  576. "draftId": "r-1234567890123456789"
  577. }
  578. ```
  579. ### 25. Update Draft (`update_draft`)
  580. Replaces a draft's content in place via `users.drafts.update`, **preserving the draft ID**. Critical for iteration loops (draft → user requests changes → re-draft) so Drafts doesn't accumulate N copies. Reuses the same MIME builder as `draft_email`, so attachment and threading semantics match.
  581. ```json
  582. {
  583. "draftId": "r-1234567890123456789",
  584. "to": ["recipient@example.com"],
  585. "subject": "Revised Report",
  586. "body": "Updated draft content.",
  587. "cc": ["manager@example.com"],
  588. "attachments": ["/path/to/report.docx"]
  589. }
  590. ```
  591. ### 26. Delete Draft (`delete_draft`)
  592. Discards an abandoned draft via `users.drafts.delete`.
  593. ```json
  594. {
  595. "draftId": "r-1234567890123456789"
  596. }
  597. ```
  598. #### Canonical draft lifecycle
  599. ```
  600. draft_email(...) → draftId
  601. ↓ (user wants changes)
  602. update_draft(draftId, ...) // mutate in place, same ID
  603. ↓ (user confirms)
  604. send_draft(draftId) // atomic send + draft removal
  605. ```
  606. Or abort: `delete_draft(draftId)`.
  607. ## Filter Management Features
  608. ### Filter Criteria
  609. You can create filters based on various criteria:
  610. | Criteria | Example | Description |
  611. |----------|---------|-------------|
  612. | `from` | `"sender@example.com"` | Emails from a specific sender |
  613. | `to` | `"recipient@example.com"` | Emails sent to a specific recipient |
  614. | `subject` | `"Meeting"` | Emails with specific text in subject |
  615. | `query` | `"has:attachment"` | Gmail search query syntax |
  616. | `negatedQuery` | `"spam"` | Text that must NOT be present |
  617. | `hasAttachment` | `true` | Emails with attachments |
  618. | `size` | `10485760` | Email size in bytes |
  619. | `sizeComparison` | `"larger"` | Size comparison (`larger`, `smaller`) |
  620. ### Filter Actions
  621. Filters can perform the following actions:
  622. | Action | Example | Description |
  623. |--------|---------|-------------|
  624. | `addLabelIds` | `["IMPORTANT", "Label_Work"]` | Add labels to matching emails |
  625. | `removeLabelIds` | `["INBOX", "UNREAD"]` | Remove labels from matching emails |
  626. | `forward` | `"backup@example.com"` | Forward emails to another address |
  627. ### Filter Templates
  628. The server includes pre-built templates for common filtering scenarios:
  629. #### 1. From Sender Template (`fromSender`)
  630. Filters emails from a specific sender and optionally archives them.
  631. ```json
  632. {
  633. "template": "fromSender",
  634. "parameters": {
  635. "senderEmail": "newsletter@company.com",
  636. "labelIds": ["Label_Newsletter"],
  637. "archive": true
  638. }
  639. }
  640. ```
  641. #### 2. Subject Filter Template (`withSubject`)
  642. Filters emails with specific subject text and optionally marks as read.
  643. ```json
  644. {
  645. "template": "withSubject",
  646. "parameters": {
  647. "subjectText": "[URGENT]",
  648. "labelIds": ["Label_Urgent"],
  649. "markAsRead": false
  650. }
  651. }
  652. ```
  653. #### 3. Attachment Filter Template (`withAttachments`)
  654. Filters all emails with attachments.
  655. ```json
  656. {
  657. "template": "withAttachments",
  658. "parameters": {
  659. "labelIds": ["Label_Attachments"]
  660. }
  661. }
  662. ```
  663. #### 4. Large Email Template (`largeEmails`)
  664. Filters emails larger than a specified size.
  665. ```json
  666. {
  667. "template": "largeEmails",
  668. "parameters": {
  669. "sizeInBytes": 10485760,
  670. "labelIds": ["Label_Large"]
  671. }
  672. }
  673. ```
  674. #### 5. Content Filter Template (`containingText`)
  675. Filters emails containing specific text and optionally marks as important.
  676. ```json
  677. {
  678. "template": "containingText",
  679. "parameters": {
  680. "searchText": "invoice",
  681. "labelIds": ["Label_Finance"],
  682. "markImportant": true
  683. }
  684. }
  685. ```
  686. #### 6. Mailing List Template (`mailingList`)
  687. Filters mailing list emails and optionally archives them.
  688. ```json
  689. {
  690. "template": "mailingList",
  691. "parameters": {
  692. "listIdentifier": "dev-team",
  693. "labelIds": ["Label_DevTeam"],
  694. "archive": true
  695. }
  696. }
  697. ```
  698. ### Common Filter Examples
  699. Here are some practical filter examples:
  700. **Auto-organize newsletters:**
  701. ```json
  702. {
  703. "criteria": {
  704. "from": "newsletter@company.com"
  705. },
  706. "action": {
  707. "addLabelIds": ["Label_Newsletter"],
  708. "removeLabelIds": ["INBOX"]
  709. }
  710. }
  711. ```
  712. **Handle promotional emails:**
  713. ```json
  714. {
  715. "criteria": {
  716. "query": "unsubscribe OR promotional"
  717. },
  718. "action": {
  719. "addLabelIds": ["Label_Promotions"],
  720. "removeLabelIds": ["INBOX", "UNREAD"]
  721. }
  722. }
  723. ```
  724. **Priority emails from boss:**
  725. ```json
  726. {
  727. "criteria": {
  728. "from": "boss@company.com"
  729. },
  730. "action": {
  731. "addLabelIds": ["IMPORTANT", "Label_Boss"]
  732. }
  733. }
  734. ```
  735. **Large attachments:**
  736. ```json
  737. {
  738. "criteria": {
  739. "size": 10485760,
  740. "sizeComparison": "larger",
  741. "hasAttachment": true
  742. },
  743. "action": {
  744. "addLabelIds": ["Label_LargeFiles"]
  745. }
  746. }
  747. ```
  748. ## Advanced Search Syntax
  749. The `search_emails` tool supports Gmail's powerful search operators:
  750. | Operator | Example | Description |
  751. |----------|---------|-------------|
  752. | `from:` | `from:john@example.com` | Emails from a specific sender |
  753. | `to:` | `to:mary@example.com` | Emails sent to a specific recipient |
  754. | `subject:` | `subject:"meeting notes"` | Emails with specific text in the subject |
  755. | `has:attachment` | `has:attachment` | Emails with attachments |
  756. | `after:` | `after:2024/01/01` | Emails received after a date |
  757. | `before:` | `before:2024/02/01` | Emails received before a date |
  758. | `is:` | `is:unread` | Emails with a specific state |
  759. | `label:` | `label:work` | Emails with a specific label |
  760. You can combine multiple operators: `from:john@example.com after:2024/01/01 has:attachment`
  761. ## Advanced Features
  762. ### **Email Attachment Support**
  763. The server provides comprehensive attachment functionality:
  764. - **Sending Attachments**: Include file paths in the `attachments` array when sending or drafting emails
  765. - **Attachment Detection**: Automatically detects MIME types and file sizes
  766. - **Download Capability**: Download any email attachment to your local filesystem
  767. - **Enhanced Display**: View detailed attachment information including filenames, types, sizes, and download IDs
  768. - **Multiple Formats**: Support for all common file types (documents, images, archives, etc.)
  769. - **RFC822 Compliance**: Uses Nodemailer for proper MIME message formatting
  770. **Supported File Types**: All standard file types including PDF, DOCX, XLSX, PPTX, images (PNG, JPG, GIF), archives (ZIP, RAR), and more.
  771. ### Email Content Extraction
  772. The server intelligently extracts email content from complex MIME structures:
  773. - Prioritizes plain text content when available
  774. - Falls back to HTML content if plain text is not available
  775. - Handles multi-part MIME messages with nested parts
  776. - **Processes attachments information (filename, type, size, download ID)**
  777. - Preserves original email headers (From, To, Subject, Date)
  778. ### International Character Support
  779. The server fully supports non-ASCII characters in email subjects and content, including:
  780. - Turkish, Chinese, Japanese, Korean, and other non-Latin alphabets
  781. - Special characters and symbols
  782. - Proper encoding ensures correct display in email clients
  783. ### Comprehensive Label Management
  784. The server provides a complete set of tools for managing Gmail labels:
  785. - **Create Labels**: Create new labels with customizable visibility settings
  786. - **Update Labels**: Rename labels or change their visibility settings
  787. - **Delete Labels**: Remove user-created labels (system labels are protected)
  788. - **Find or Create**: Get a label by name or automatically create it if not found
  789. - **List All Labels**: View all system and user labels with detailed information
  790. - **Label Visibility Options**: Control how labels appear in message and label lists
  791. Label visibility settings include:
  792. - `messageListVisibility`: Controls whether the label appears in the message list (`show` or `hide`)
  793. - `labelListVisibility`: Controls how the label appears in the label list (`labelShow`, `labelShowIfUnread`, or `labelHide`)
  794. These label management features enable sophisticated organization of emails directly through Claude, without needing to switch to the Gmail interface.
  795. ### Batch Operations
  796. The server includes efficient batch processing capabilities:
  797. - Process up to 50 emails at once (configurable batch size)
  798. - Automatic chunking of large email sets to avoid API limits
  799. - Detailed success/failure reporting for each operation
  800. - Graceful error handling with individual retries
  801. - Perfect for bulk inbox management and organization tasks
  802. ## Security Notes
  803. - OAuth credentials are stored securely in your local environment (`~/.gmail-mcp/`)
  804. - The server uses offline access to maintain persistent authentication
  805. - Never share or commit your credentials to version control
  806. - Regularly review and revoke unused access in your Google Account settings
  807. - Credentials are stored globally but are only accessible by the current user
  808. - **Attachment files are processed locally and never stored permanently by the server**
  809. ## Troubleshooting
  810. 1. **OAuth Keys Not Found**
  811. - Make sure `gcp-oauth.keys.json` is in either your current directory or `~/.gmail-mcp/`
  812. - Check file permissions
  813. 2. **Invalid Credentials Format**
  814. - Ensure your OAuth keys file contains either `web` or `installed` credentials
  815. - For web applications, verify the redirect URI is correctly configured
  816. 3. **Port Already in Use**
  817. - By default authentication uses port 3000; either free it up before running authentication, or run on a different port by passing a custom callback URL (e.g. `node dist/index.js auth http://localhost:8080/oauth2callback`)
  818. - If freeing port 3000, you can find and stop the process using that port
  819. - A custom callback URL must match one of the authorized redirect URIs registered in the Google Cloud Console
  820. 4. **Batch Operation Failures**
  821. - If batch operations fail, they automatically retry individual items
  822. - Check the detailed error messages for specific failures
  823. - Consider reducing the batch size if you encounter rate limiting
  824. 5. **Attachment Issues**
  825. - **File Not Found**: Ensure attachment file paths are correct and accessible
  826. - **Permission Errors**: Check that the server has read access to attachment files
  827. - **Size Limits**: Gmail has a 25MB attachment size limit per email
  828. - **Download Failures**: Verify you have write permissions to the download directory
  829. ## Contributing
  830. Contributions are welcome! Please feel free to submit a Pull Request.
  831. ### Branch workflow
  832. This repo uses a **two-branch model**:
  833. - **`main`** - stable. Only receives changes promoted from `experimental` after they're confirmed working. PRs are **never** merged directly into `main`.
  834. - **`experimental`** - staging / active development. All PRs are retargeted here and merged into `experimental` first.
  835. Lifecycle of a contribution:
  836. ```
  837. PR opened (any base)
  838. → retargeted to `experimental`
  839. → security audit + review + CI
  840. → merged into `experimental`
  841. → soak / verify on experimental
  842. → `experimental` promoted to `main` (maintainer confirms)
  843. ```
  844. Open your PR against `experimental` when possible. If you target `main`, a maintainer will retarget it to `experimental` before merge.
  845. **CI requires README updates** - every push to `main` and every PR must include a README.md change (even a version bump or changelog entry). This ensures documentation stays current as the codebase evolves.
  846. To bypass for commits that genuinely don't need a docs update (dependency bumps, CI config changes), include `[skip-readme]` or `[no-readme]` in your commit message or PR title.
  847. ## Running evals
  848. The evals package loads an mcp client that then runs the index.ts file, so there is no need to rebuild between tests. You can load environment variables by prefixing the npx command. Full documentation can be found [here](https://www.mcpevals.io/docs).
  849. ```bash
  850. OPENAI_API_KEY=your-key npx mcp-eval src/evals/evals.ts src/index.ts
  851. ```
  852. ## License
  853. MIT
  854. ## Support
  855. If you encounter any issues or have questions, please [file an issue](https://github.com/ArtyMcLabin/Gmail-MCP-Server/issues).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.