gmail-personal-mcp
Connects directly to the Gmail API from the user's machine to run a daily triage brief (priority topics, deadlines/VIPs, read-but-unreplied threads, unread primary mail), search threads with Gmail query syntax, read full thread histories, list labels with total/unread counts, list existing drafts, and create or update properly threaded reply drafts (Re:, In-Reply-To, References) in Gmail Drafts using read-only + compose scopes — never sending, deleting, or trashing mail.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
gmail-personal-mcp
A privacy-first, local Stdio MCP server and daily triage assistant for personal Gmail accounts (@gmail.com, including university or work emails forwarded to Gmail).
Built for busy people—especially university faculty, researchers, and conference chairs—who want a systematic way to:
Review their inbox every morning without noise;
Catch important or "read-but-unreplied" emails before deadlines slip;
Automatically prepare threaded reply drafts in Gmail Drafts, so you simply review and click Send;
Organize cluttered Gmail labels & filters using ready-made presets.
Safety & Privacy First
100% Local: Connects directly from your machine to Google's Gmail API (
gmail.googleapis.com). Zero third-party cloud middleman.Draft-Only, Never Auto-Send: Only uses
gmail.readonly+gmail.compose. There is no code to send, delete, or trash emails.Zero Extra MCP SDK Bloat: Pure Python standard-library JSON-RPC 2.0 Stdio MCP server (
requirements.txthas only 3 lightweight packages).Works on Personal
@gmail.comAccounts: Avoids the403 ForbiddenGoogle Workspace Developer Preview gate on hosted remote MCP endpoints, and automatically detects system HTTP proxies.
What You Need (Prerequisites)
Python 3.10+
A Gmail account (
@gmail.com) — if your university/company uses Outlook/Exchange, simply enable auto-forwarding to Gmail.A free Google Cloud (GCP) OAuth Desktop
credentials.json(~3 minutes to create, no credit card needed; see docs/GCP_SETUP.md).Any MCP-compatible AI client:
Google Antigravity (
agyCLI / App)Claude Desktop / Claude Code
Cursor
(Tip: Even without setting up GCP or MCP, you can run setup_wizard.py to generate a ready-to-import gmail_filters.xml for your role preset and clean up your Gmail in 1 minute!)
Related MCP server: gmail-mcp
Quick Start (5 Minutes)
1. Clone and run the interactive setup wizard
git clone https://github.com/llcao/gmail-personal-mcp.git
cd gmail-personal-mcp
python3 setup_wizard.pyThe wizard automatically:
Creates
.venvand installs the 3 lightweight dependencies;Lets you pick a preset (
personal,university_faculty, orconference_chair);Generates your local
config.json(gitignored) andgmail_filters.xml(gitignored);Prints the exact
mcp_config.jsonsnippet for your machine.
2. (Optional) Import your personalized Gmail Filters
In Gmail web UI: Settings → See all settings → Filters and Blocked Addresses → Import filters → select the generated gmail_filters.xml.
Recommended Gmail UI settings for maximum clarity:
Keep only Primary (and optionally Promotions as an ad quarantine); turn off Updates, Forums, and Social.
Hide Important markers (AI auto-markers are noisy); use Starred ⭐ for active to-dos and Snoozed ⏰ for future deadlines.
3. Add Google OAuth credentials.json & authorize once
Follow docs/GCP_SETUP.md (3 minutes) to download credentials.json into this folder, then run:
chmod 600 credentials.json
./.venv/bin/python gmail_triage.py auth4. Register the MCP Server in your AI client
Add the snippet printed by setup_wizard.py to your client's MCP config:
Antigravity CLI / App:
~/.gemini/config/mcp_config.jsonClaude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"gmail": {
"command": "/absolute/path/to/gmail-personal-mcp/.venv/bin/python",
"args": [
"/absolute/path/to/gmail-personal-mcp/gmail_mcp_server.py"
]
}
}
}Restart your AI client, and you can immediately ask:
"Check my inbox for missed urgent or read-but-unreplied emails over the last 3 days."
"Search my emails for reimbursement follow-ups and draft replies in Gmail Drafts."
"Audit my Gmail labels and suggest a cleanup plan."
Built-In MCP Tools (7)
Tool | Purpose | Safety |
| Scans recent threads using | Read-only |
| Searches Gmail using standard query syntax; strips forwarded | Read-only |
| Reads full plain-text conversation history for a thread | Read-only |
| Lists Gmail labels with total & unread counts | Read-only |
| Lists current drafts (prevents duplicate drafts) | Read-only |
| Saves a properly threaded reply draft ( | Draft-only (never sends) |
| Updates an existing draft in-place by | Draft-only (never sends) |
Included Role Presets (presets/)
Preset | Designed For | Highlights |
| Everyday personal Gmail | Clean urgency detection, finance/receipt labeling, silent newsletter archiving |
| University professors / PIs | Separates |
| Conference Program / Area Chairs | Top-priority tracking for desk-reject appeals, ethics/anonymity alerts, and internal PC lists; ignores |
Optional: Daily 07:00 macOS Auto-Check (Wake-on-Sleep)
On macOS, launchd automatically runs missed jobs immediately after your Mac wakes from sleep:
chmod +x scripts/run_daily_check.sh scripts/install_launchagent.sh
./scripts/install_launchagent.sh 7 0Each morning at 07:00 (or right after wake-up), it waits for Wi-Fi/proxy, runs gmail_triage.py fetch, writes reports/YYYY-MM-DD_digest.md, and shows a macOS Notification Center summary.
Project Structure
gmail-personal-mcp/
├── gmail_triage.py # Core Gmail REST client, triage engine, label auditor & filter XML exporter
├── gmail_mcp_server.py # Zero-dependency Stdio MCP server (7 tools)
├── setup_wizard.py # Interactive setup & filter generator
├── presets/ # Ready-to-use JSON presets (personal, university_faculty, conference_chair)
├── scripts/ # Optional macOS launchd 07:00 wake-on-sleep runner
├── docs/
│ ├── GCP_SETUP.md # Step-by-step Google Cloud OAuth setup & troubleshooting
│ └── mcp_guide_zh.html # Interactive Chinese visual guide (Setup, Remote MCP caveats, MCP 101)
└── requirements.txtSecurity Reminder Before Pushing Forks
Never commit credentials.json, token.json, config.json, gmail_filters.xml, or reports/ — all of them are ignored by .gitignore by default.
License
MIT (see LICENSE).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Search and triage all your mailboxes; draft replies and campaigns; send only as you allow.
The judgment layer for email. Connect Gmail, Outlook, iCloud, Yahoo and IMAP to AI apps in one MCP connection. Nothing sends until you approve it.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceFull Gmail control for any MCP-compatible AI agent. Exposes ~40 tools for reading, composing, labeling, filtering, threading, and account management.-
- AlicenseNot gradedqualityNot gradedmaintenanceEnables interaction with Gmail through MCP, supporting search, read, send, reply, forward, draft management, labels, and multiple accounts, deployed on Cloudflare Workers.MIT
- AlicenseBqualityBmaintenanceConnects any number of Gmail accounts to Claude or another MCP client, enabling search, reading, sending, drafting, labeling, and trashing mail across one account or all of them at once. Runs entirely locally, so OAuth tokens never leave the user's machine.9MIT
- AlicenseNot gradedqualityBmaintenanceConnects several Gmail and Google Workspace accounts to MCP-capable AI apps so they can search, read, draft, send, reply, and label mail across one account or all of them at once. Runs locally on Windows with encrypted on-disk credentials, no delete tools, and approval-gated sending.MIT