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.A server for interacting with LinkedIn, including authentication and posting capabilities.
Send notifications to Slack using OAuth bot tokens.
Interact with Africa's Talking airtime service and store transaction data in a local SQLite database.
A Text-to-Speech server that integrates with an external VOICEVOX engine.
An MCP server for seamless integration with the Kick.com API.
An MCP server application that sends various types of messages to the WeCom group robot.
An MCP server for integrating with the NATS messaging system.
An MCP server for sending emails via the Postmark service, configured through environment variables.
Access market data, manage accounts, and execute trades on the Upbit Cryptocurrency Exchange via its OpenAPI.
Send HTTP requests to webhooks with dynamic parameters.