
How to add Gmail MCP Server (GongRzhe) to Claude Desktop
Gmail MCP with auto OAuth: send, search, label and manage email Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.
Last updated June 15, 2026 ยท 1.1kโ ยท stdio ยท oauth
Claude Desktop config for Gmail MCP Server (GongRzhe)
npx -y @gongrzhe/server-gmail-autoauth-mcp{
"mcpServers": {
"gmail-mcp-server-gongrzhe": {
"command": "npx",
"args": [
"-y",
"@gongrzhe/server-gmail-autoauth-mcp"
]
}
}
}Setup steps
- 1Open Claude Desktop โ Settings โ Developer โ Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
- 2Paste the Gmail MCP Server (GongRzhe) config below under the top-level "mcpServers" key.
- 3Fill in any placeholder secrets (API keys, paths) in the snippet.
- 4Save the file, then fully quit and reopen Claude Desktop.
- 5Open a chat and confirm Gmail MCP Server (GongRzhe)'s tools appear under the ๐ tools menu.
Before you start
- Node.js installed (run via npx, no global install required)
- A Google Cloud project with the Gmail API enabled
- OAuth 2.0 client credentials (Desktop app type recommended) downloaded as gcp-oauth.keys.json from Google Cloud Console > APIs & Services > Credentials
- For Web-app credential type: add the redirect URI http://localhost:3000/oauth2callback
- The OAuth keys file placed in the working directory or in ~/.gmail-mcp/
What Gmail MCP Server (GongRzhe) can do in Claude Desktop
send_emailSend an email, with HTML/multipart and attachment support
draft_emailCreate a draft message without sending it
read_emailRead the full content of a specific message by ID
search_emailsSearch the mailbox using native Gmail query syntax
modify_emailAdd or remove labels / change the state of a message
delete_emailPermanently delete a message
download_attachmentDownload an attachment from a message
batch_modify_emailsApply label/state changes to many messages at once
Security
Requires Google OAuth client credentials and stores access/refresh tokens in plaintext under ~/.gmail-mcp/ โ protect that directory. The upstream repo is archived (read-only since March 2026), so evaluate a maintained fork if you need security updates.
Gmail MCP Server (GongRzhe) + Claude Desktop FAQ
Where is the Claude Desktop config file?
Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the Gmail MCP Server (GongRzhe) config there under the "mcpServers" key and restart the client.
Is Gmail MCP Server (GongRzhe) safe to use with Claude Desktop?
Requires Google OAuth client credentials and stores access/refresh tokens in plaintext under ~/.gmail-mcp/ โ protect that directory. The upstream repo is archived (read-only since March 2026), so evaluate a maintained fork if you need security updates.
Do I have to set up OAuth manually?
You provide the Google OAuth client credentials file, but the server handles the token exchange automatically โ running the `auth` command opens a browser, you sign in once, and the token is cached for reuse.
Does it work outside Claude Desktop?
Yes. It speaks MCP over stdio, so any MCP-compatible client (Cursor, etc.) works; the README also documents a Smithery one-line install for Claude.
Where do I get the credentials and is it free?
Create OAuth 2.0 credentials in Google Cloud Console with the Gmail API enabled. Google Cloud and the Gmail API are free within normal personal usage quotas; this server itself is free and MIT-licensed.