Automate Gmail management with OAuth authentication, email actions, search, and integration in Claude Desktop.
The Gmail AutoAuth MCP Server is an advanced Model Context Protocol (MCP) server specifically designed for integrating Gmail functionality into various AI applications, particularly Claude Desktop. This server leverages the Google Mail API and OAuth2 authentication to provide a comprehensive suite of email management capabilities directly from natural language interactions with AI assistants.
The Gmail AutoAuth MCP Server offers several key features that expand the utility and efficiency of integrating Gmail into AI applications:
These features make it easier for AI applications to manage Gmail accounts directly, enhancing user experience and streamlining email-related tasks within AI workflow integrations.
The architecture of the Gmail AutoAuth MCP Server is designed to seamlessly integrate with various MCP clients through a standardized protocol. The server leverages Model Context Protocol (MCP) to define clear interaction patterns and data exchange mechanisms, ensuring compatibility across different AI applications.
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
To install Gmail AutoAuth for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @gongrzhe/server-gmail-autoauth-mcp --client claude
Create a Google Cloud Project and Obtain Credentials
Create a Google Cloud Project:
Create OAuth 2.0 Credentials
http://localhost:3000/oauth2callback
to the authorized redirect URIsgcp-oauth.keys.json
Run Authentication You can authenticate in two ways:
Global Authentication (Recommended)
# First time: Place gcp-oauth.keys.json in your home directory's .gmail-mcp folder
mkdir -p ~/.gmail-mcp
mv gcp-oauth.keys.json ~/.gmail-mcp/
# Run authentication from anywhere
npx @gongrzhe/server-gmail-autoauth-mcp auth
Local Authentication
# Place gcp-oauth.keys.json in your current directory
# The file will be automatically copied to global config
npx @gongrzhe/server-gmail-autoauth-mcp auth
The authentication process will:
gcp-oauth.keys.json
in the current directory or ~/.gmail-mcp/
~/.gmail-mcp/
~/.gmail-mcp/credentials.json
Note: After successful authentication, credentials are stored globally in
~/.gmail-mcp/
and can be used from any directory.
If you prefer using Docker:
Authentication
docker run -i --rm \
--mount type=bind,source=/path/to/gcp-oauth.keys.json,target=/gcp-oauth.keys.json \
-v mcp-gmail:/gmail-server \
-e GMAIL_OAUTH_PATH=/gcp-oauth.keys.json \
-e "GMAIL_CREDENTIALS_PATH=/gmail-server/credentials.json" \
-p 3000:3000 \
mcp/gmail auth
Usage
{
"mcpServers": {
"gmail": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"mcp-gmail:/gmail-server",
"-e",
"GMAIL_CREDENTIALS_PATH=/gmail-server/credentials.json",
"mcp/gmail"
]
}
}
}
Imagine a scenario where an AI assistant handles customer support queries by generating automated email responses. Using the Gmail AutoAuth MCP Server, the AI can send personalized, pre-approved templates to customers without manual intervention.
Implementation Steps:
sendEmail
).AI assistants can be used to manage meeting reminders by sending out invitations with detailed information and automatically follow up on deadlines. This server ensures that meetings are easily scheduled, reminders sent, and actions taken without manual effort.
Implementation Steps:
createEvent
, sendInvitation
) to manage calendar activities.To integrate Claude Desktop with the Gmail AutoAuth MCP Server, follow these steps:
{
"mcpServers": {
"gmail": {
"command": "npx",
"args": [
"@gongrzhe/server-gmail-autoauth-mcp"
]
}
}
}
This configuration ensures that Claude Desktop can communicate with the server for email management tasks.
The Gmail AutoAuth MCP Server has been tested and is compatible with various AI applications:
For optimal performance, ensure that the server runs at least version 1.24 of the software.
{
"mcpServers": {
"gmail-autoauth": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-gmail-autoauth"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
This sample configuration demonstrates how to set up the server with environmental variables for API key authentication.
The Gmail AutoAuth MCP Server is a powerful tool for integrating Gmail functionality into AI applications, providing automated email management capabilities and ensuring seamless integration across different client platforms. By leveraging Model Context Protocol, this server enhances the efficiency and productivity of developers building comprehensive AI applications with seamless email management features.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods