Allows AI agents to search Gmail threads, learn your writing style, and draft emails.
An MCP server that lets AI agents search Gmail threads, understand your email writing style, and create draft emails.
When you first run the server, it will open your browser for authorization. The server requests only these minimal permissions:
✅ Gmail Readonly Access (gmail.readonly
)
✅ Gmail Compose Access (gmail.compose
)
Build the server first: go build .
You'll want to add this to your agent's configuration file:
{
"mcpServers": {
"gmail": {
"command": "C:/path/to/your/auto-gmail.exe",
"env": {
"GMAIL_CLIENT_ID": "your_client_id_here.apps.googleusercontent.com",
"GMAIL_CLIENT_SECRET": "your_client_secret_here",
"OPENAI_API_KEY": "your_openai_api_key_here"
}
}
}
}
Problem: In stdio mode, Cursor starts a fresh server process each time (and for each tab), causing OAuth popup spam.
Solution: Run the server as a persistent HTTP daemon that authenticates once and stays running.
# Build the server
go build -o gmail-mcp-server
# Start persistent server (OAuth only once!)
./gmail-mcp-server --http
# Or with custom port
./gmail-mcp-server --http 3000
{
"mcpServers": {
"gmail": {
"command": "C:/path/to/your/gmail-mcp-server",
"env": {
"GMAIL_CLIENT_ID": "your_client_id_here.apps.googleusercontent.com",
"GMAIL_CLIENT_SECRET": "your_client_secret_here",
"OPENAI_API_KEY": "your_openai_api_key_here"
}
}
}
}
The difference: You start the server manually once instead of letting Cursor start it fresh each time.
Ctrl+Shift+P
(Windows/Linux) or Cmd+Shift+P
(Mac)You can edit these config files directly if you know where to find them:
C:\Users\[User]\.cursor\mcp.json
%APPDATA%\Claude\claude_desktop_config.json
(Windows)Tools:
search_threads
- Search Gmail with queries like "from:email@example.com" or "subject:meeting" (includes draft info)create_draft
- Create email drafts or update existing drafts (AI will request style guide first)extract_attachment_by_filename
- Safely extract text from PDF, DOCX, and TXT attachments using filenameget_personal_email_style_guide
- Get your email writing style guide (this is a temporary tool, created because most agents do not yet support fetching resources--once agents implement MCP resources better, then thsi tool can be removed)Resources:
file://personal-email-style-guide
- Your personal email writing style (auto-generated or manual)Prompts:
/generate-email-tone
- Analyze your sent emails to create personalized writing style/server-status
- Show file locations and server statusThe server will create a style-guide file based on the last 25 emails you've sent, so that newly drafted emails will hopefully sound like you. Honestly, so far LLM-written emails still don't sound very authentic.
Manual Generation:
/generate-email-tone
prompt in your MCP client anytime to regenerateAI Integration:
get_personal_email_style_guide
tool before writing emailsfile://personal-email-style-guide
If you want to run this MCP server outside of an agent, you can create a .env file based on the .env.example file and supply the environment variables that way, or export them into your environment prior to running:
export GMAIL_CLIENT_ID=your_client_id_here.apps.googleusercontent.com
export GMAIL_CLIENT_SECRET=your_client_secret_here
export OPENAI_API_KEY=your_openai_api_key_here
The server stores authentication and configuration files in standard application directories:
C:\Users\[YourUsername]\AppData\Roaming\auto-gmail\
~/.auto-gmail/
~/.auto-gmail/
token.json
- OAuth authentication token (auto-generated)personal-email-style-guide.md
- Your email writing style guide (auto-generated or manual)/server-status
in your MCP client to see exact file pathstoken.json
to force re-authentication with updated permissions./gmail-mcp-server --http
) to avoid OAuth popups. Server authenticates once and stays running.Simple MCP Server to enable a human-in-the-loop workflow in tools like Cline and Cursor.
Connect to any function, any language, across network boundaries using AgentRPC.
Schedule and manage Zoom meetings with AI assistance. Requires Zoom API credentials for configuration.
Wassenger MCP server to chat, send messages and automate WhatsApp from any AI model client (free trial available).
A server for interacting with DingTalk workspaces using the Model Context Protocol.
Integrates with Mailtrap Email API.
Enhanced MCP server for Twitter/X with OAuth 2.0 support, v2 API media uploads, smart v1.1 fallbacks, and comprehensive rate limiting. Post tweets with text/media, search, and delete tweets programmatically.
Interact with any other SaaS applications on behalf of your customers.
AI personal assistant for email Inbox Zero
Interact with Slack workspaces to read and send messages directly through your AI assistant.