MCP Directory

How to add Gmail MCP Server (GongRzhe) to Cursor

Gmail MCP with auto OAuth: send, search, label and manage email Paste the config into ~/.cursor/mcp.json and restart Cursor.

Last updated June 15, 2026 · 1.1k · stdio · oauth

Cursor 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

  1. 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
  2. 2Paste the Gmail MCP Server (GongRzhe) config below into the "mcpServers" object.
  3. 3Fill in placeholder secrets, then save.
  4. 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
  5. 5Ask Cursor to use one of Gmail MCP Server (GongRzhe)'s tools to confirm it's connected.

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 Cursor

send_email

Send an email, with HTML/multipart and attachment support

draft_email

Create a draft message without sending it

read_email

Read the full content of a specific message by ID

search_emails

Search the mailbox using native Gmail query syntax

modify_email

Add or remove labels / change the state of a message

delete_email

Permanently delete a message

download_attachment

Download an attachment from a message

batch_modify_emails

Apply 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) + Cursor FAQ

Where is the Cursor config file?

Cursor reads MCP servers from ~/.cursor/mcp.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 Cursor?

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.

View repo Full Gmail MCP Server (GongRzhe) page