Gmail MCP Server
Read, search, and send email from Claude Desktop via the Gmail API
The Gmail MCP server gives Claude and MCP-compatible agents access to your Google inbox. Claude can search for emails using Gmail query syntax, read full message threads, draft and send replies, and manage labels — turning your AI assistant into an email co-pilot.
Prerequisites
- Node.js 18+
- Google Cloud Project with the Gmail API enabled
- OAuth 2.0 credentials (Desktop App type) — download the
credentials.jsonfile - First run will open a browser for you to grant access; a
token.jsonfile is saved locally - Required OAuth scope:
https://www.googleapis.com/auth/gmail.modify
Installation & Configuration
Add this block to your claude_desktop_config.json:
{
"mcpServers": {
"gmail": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-gmail"],
"env": {
"GMAIL_CREDENTIALS_PATH": "/path/to/your/credentials.json",
"GMAIL_TOKEN_PATH": "/path/to/your/token.json"
}
}
}
}
Config file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/claude/claude_desktop_config.json
Available Tools (5)
search_emails
Query inbox with Gmail syntaxget_email
Read a full message threadsend_email
Compose and send a messagereply_to_email
Reply within a threadmodify_labels
Add/remove labels (archive, etc.)
Use Cases
- Summarise all unread emails from a specific sender
- Draft a professional reply to a support request and send it
- Find and archive all newsletter emails older than 30 days
Tips & Gotchas
Gotcha: Google requires OAuth consent screen verification for apps with sensitive scopes. While in development/testing mode you can add yourself as a test user and skip the full review.
Gotcha: The
token.json file contains a refresh token — keep it out of version control. Add it to your .gitignore.Tip: Use the
gmail.readonly scope first to test without send permissions, then upgrade to gmail.modify when ready. You'll need to delete token.json and re-authenticate after changing scopes.Source & Documentation
GitHub Repository: https://github.com/modelcontextprotocol/servers/tree/main/src/gmail
Gmail API Setup: Google Cloud Console — Gmail API
Protocol: Model Context Protocol (MCP) — modelcontextprotocol.io
MCP Setup Pack — $15
20 ready-to-paste server configs + installer + doctor script
Get the Pack →
20 ready-to-paste server configs + installer + doctor script