Gmail AutoAuth

v1.0.0Communicationstable

Enables AI assistants to manage Gmail through natural language interactions, supporting email operations (send, read, search, draft), comprehensive attachment handling (send, receive, download), label management, filters, and batch operations with au

gmail-autoauth-mcp-servermcpai-integration
Share:
1,118
Stars
0
Downloads
0
Weekly
0/5

What is Gmail AutoAuth?

Gmail AutoAuth is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables ai assistants to manage gmail through natural language interactions, supporting email operations (send, read, search, draft), comprehensive attachment handling (send, receive, download), label...

Enables AI assistants to manage Gmail through natural language interactions, supporting email operations (send, read, search, draft), comprehensive attachment handling (send, receive, download), label management, filters, and batch operations with au

This server falls under the Communication category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Enables AI assistants to manage Gmail through natural langua

Use Cases

Send, read, and search emails using natural language.
Manage attachments, labels, and email filters.
Perform batch email operations with AI assistance.
GongRzhe

Maintainer

LicenseMIT License
Languagejavascript
Versionv1.0.0
UpdatedMay 20, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx gmail-autoauth-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Gmail AutoAuth

Gmail AutoAuth MCP Server enables AI assistants to manage Gmail through natural language, supporting the full range of email operations including sending, reading, searching, drafting, and deleting messages, as well as attachment handling (send, receive, download), label and filter management, and efficient batch operations. Authentication uses Google OAuth 2.0's offline flow — credentials are stored locally in ~/.gmail-mcp/ — so the AI never holds a static API key and access tokens refresh automatically. It is ideal for workflows where an AI assistant needs to monitor inboxes, triage messages, automate email organization, or send notifications without manual user intervention.

Prerequisites

  • Node.js 16+ installed
  • A Google Cloud project with the Gmail API enabled
  • OAuth 2.0 Client ID credentials (Desktop application type) downloaded as gcp-oauth.keys.json
  • An MCP-capable client such as Claude Desktop
1

Enable the Gmail API and create OAuth credentials

In the Google Cloud Console, create or select a project, enable the Gmail API, and create an OAuth 2.0 Client ID of type 'Desktop application'. Download the credentials JSON file.

2

Place the credentials file in the expected location

The server looks for Google OAuth credentials at ~/.gmail-mcp/gcp-oauth.keys.json by default. Create the directory and copy your downloaded credentials file there.

mkdir -p ~/.gmail-mcp
cp ~/Downloads/gcp-oauth.keys.json ~/.gmail-mcp/gcp-oauth.keys.json
3

Install the MCP server via Smithery

The recommended installation method is via Smithery, which handles the MCP client registration automatically. Alternatively, run the auth command manually to complete the OAuth flow.

# Install via Smithery (registers with Claude automatically)
npx -y @smithery/cli install @gongrzhe/server-gmail-autoauth-mcp --client claude

# Or authenticate manually
npx @gongrzhe/server-gmail-autoauth-mcp auth
4

Complete the OAuth browser flow

Running the auth command opens your browser to Google's OAuth consent screen. Log in with the Gmail account you want to manage and grant the requested permissions. The refresh token is saved to ~/.gmail-mcp/ for future use.

5

Add the server to your claude_desktop_config.json

If you did not use Smithery, manually add the server entry to your Claude Desktop config file. The server requires no environment variables beyond the credentials files already in ~/.gmail-mcp/.

{
  "mcpServers": {
    "gmail": {
      "command": "npx",
      "args": ["@gongrzhe/server-gmail-autoauth-mcp"]
    }
  }
}

Gmail AutoAuth Examples

Client configuration

Claude Desktop config entry for the Gmail AutoAuth MCP Server.

{
  "mcpServers": {
    "gmail": {
      "command": "npx",
      "args": ["@gongrzhe/server-gmail-autoauth-mcp"]
    }
  }
}

Prompts to try

Example prompts covering email operations, attachment handling, label management, and batch actions.

- "Send an email to [email protected] with subject 'Meeting Notes' and attach the file at ~/Desktop/notes.pdf"
- "Find all unread emails from my manager received in the last 7 days and summarize them"
- "Create a label called 'Project Alpha' and apply it to all emails with 'Alpha' in the subject"
- "Create a filter to automatically archive all newsletters from [email protected]"
- "Download all PDF attachments from the last 10 emails in my inbox to ~/Downloads/"

Troubleshooting Gmail AutoAuth

OAuth flow fails with 'redirect_uri_mismatch' error

In the Google Cloud Console, check your OAuth 2.0 client's authorized redirect URIs. For the auth command, add http://localhost:3000/oauth2callback as an allowed redirect URI. Ensure you are using a 'Desktop application' credential type, not 'Web application'.

Server starts but returns 'credentials not found' error

Verify that gcp-oauth.keys.json is present at ~/.gmail-mcp/gcp-oauth.keys.json. Run 'npx @gongrzhe/server-gmail-autoauth-mcp auth' again to complete the OAuth flow and regenerate the token files. Check GMAIL_OAUTH_PATH if you store credentials in a non-default location.

Token expires and email operations start failing

The server uses offline OAuth with refresh tokens, which should auto-renew. If tokens become invalid (e.g., after a password change or OAuth revocation), re-run 'npx @gongrzhe/server-gmail-autoauth-mcp auth' to get a fresh token. Ensure your Google Cloud project's OAuth consent screen is published or your account is added as a test user.

Frequently Asked Questions about Gmail AutoAuth

What is Gmail AutoAuth?

Gmail AutoAuth is a Model Context Protocol (MCP) server that enables ai assistants to manage gmail through natural language interactions, supporting email operations (send, read, search, draft), comprehensive attachment handling (send, receive, download), label management, filters, and batch operations with au It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Gmail AutoAuth?

Follow the installation instructions on the Gmail AutoAuth GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Gmail AutoAuth?

Gmail AutoAuth works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Gmail AutoAuth free to use?

Yes, Gmail AutoAuth is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Communication MCP Servers

Explore all communication servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "gmail-autoauth-mcp-server": { "command": "npx", "args": ["-y", "gmail-autoauth-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Gmail AutoAuth?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides