Gmail AutoAuth
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
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
Maintainer
Works with
Installation
Manual Installation
npx gmail-autoauth-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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.
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.jsonInstall 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 authComplete 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.
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.
Gmail AutoAuth Alternatives — Similar Communication Servers
Looking for alternatives to Gmail AutoAuth? Here are other popular communication servers you can use with Claude, Cursor, and VS Code.
Slack
★ 86.1kEnables interaction with Slack workspaces through comprehensive channel management, messaging, user management, file uploads, and Block Kit formatting. Features secure credential storage via macOS Keychain and supports all major Slack operations incl
LibreChat
★ 37.3kEnhanced ChatGPT Clone: Features Agents, MCP, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenA
Note Gen
★ 11.9kA cross-platform Markdown AI note-taking software.
DeepChat
★ 5.8k🐬DeepChat - A smart assistant that connects powerful AI to your personal world
WhatsApp MCP
★ 5.7kConnects AI assistants to the official Meta WhatsApp Cloud API for managing conversations and sending various message types through natural language. It provides tools for media management, template messages, and real-time webhook processing without
Apple
★ 3.1kEnables interaction with Apple apps like Messages, Notes, and Contacts through the MCP protocol to send messages, search, and open app content using natural language.
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.
Set Up Gmail AutoAuth in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.