Gmail MCP Server
An MCP server that lets AI agents search Gmail threads, understand your email writing style, and create draft emails.
1. Get Google Authentication
Step 1: Create a Google Cloud Project
- Go to
Potencialize seu agente
Instalação do publicador. Não é um endpoint do PlugMCP.
Host a copy with our keys and logs.
Ainda não há uma versão empacotada no registro. Siga o README do repositório.
URL remota ou um comando na sua máquina? Como as duas instalações diferem
Rodar no PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
AbrirDo publicador
An MCP server that lets AI agents search Gmail threads, understand your email writing style, and create draft emails.
A single-file MCP-server for interacting with Gmail. Works with Claude Desktop and Cursor.
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 protected]" 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-guideIf 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 single-file MCP-server for interacting with Gmail. Works with Claude Desktop and Cursor.
Ferramentas
Ainda não há lista de ferramentas. Servidores remotos recebem uma após a primeira verificação de saúde.
Perguntas frequentes
Copie nesta página a configuração stdio para Cursor, Claude Desktop, Claude Code ou VS Code. Ela usa a instalação do publicador, não um proxy do PlugMCP.
Este registro não lista nenhuma variável de ambiente obrigatória.
Gmail roda localmente via stdio.
Última verificação: 2026-10-28. A single-file MCP-server for interacting with Gmail. Works with Claude Desktop and Cursor.