MCP Directory

How to add Gmail MCP Server (GongRzhe) to Windsurf

Gmail MCP with auto OAuth: send, search, label and manage email Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.

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

Windsurf 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 Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
  2. 2Paste the Gmail MCP Server (GongRzhe) config below.
  3. 3Fill in placeholder secrets, then save.
  4. 4Click Refresh in the MCP panel.
  5. 5Gmail MCP Server (GongRzhe)'s tools become available to Cascade.

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 Windsurf

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) + Windsurf FAQ

Where is the Windsurf config file?

Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_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 Windsurf?

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