Gmail MCP Server
Provides tools to read, search, analyze threads, draft, send, reply to, organize, label, and batch-modify emails in Gmail mailboxes via the Gmail API.
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 MCP Server
A complete, production-grade Model Context Protocol (MCP) server that empowers an AI assistant to read, search, analyze conversation threads, draft, send, reply to, categorize, and batch-automate Gmail mailboxes.
π Project Structure
gmail-mcp-server/
β
βββ server.py # 20 FastMCP Tools exposed for AI models / agents
βββ auth.py # Google OAuth 2.0 authentication & automatic token refresh
βββ gmail_service.py # Gmail API integration (threads, attachments, drafts, labels)
β
βββ credentials.json # Google OAuth client secrets (configured)
βββ token.json # Generated automatically after login
β
βββ web_app.py # Web dashboard & interactive MCP playground
βββ requirements.txt # Dependencies (mcp, google-api-client, etc.)
βββ .env # Configuration file (custom paths, port)
βββ README.md # DocumentationRelated MCP server: IMAP Email MCP Server
π§° All 20 Registered MCP Tools
1. π Reading & Analysis
get_user_profile: Returns connected Gmail address and total message statistics.list_unread_emails(max_results): Lists recent unread emails from the inbox with sender, subject, date, and snippet.search_emails(query, max_results): Searches emails with standard Gmail filters (from:,to:,subject:,after:,has:attachment).get_email(message_id): Fetches complete email details, decoded plain-text/HTML body, and attachment metadata (filenames, mime types, sizes).get_thread(thread_id): Retrieves entire conversation threads in chronological order for complete back-and-forth context.
2. βοΈ Drafting & Sending
send_email(to, subject, body, cc, bcc): Immediately sends an email from the user's account.reply_email(message_id, body, reply_all): Sends a reply preserving thread context,In-Reply-To, andReferencesheaders.create_draft(to, subject, body, cc, bcc): Creates a draft email in Gmail without sending.list_drafts(max_results): Lists all pending drafts in the mailbox.get_draft(draft_id): Reads the full content of a draft.send_draft(draft_id): Sends an existing draft after review.delete_draft(draft_id): Discards an unwanted draft.
3. ποΈ Organization & Management
archive_email(message_id): Archives an email (removes from Inbox, keeps safely in All Mail).mark_as_read(message_id): Removes theUNREADlabel.mark_as_unread(message_id): Adds theUNREADlabel.trash_email(message_id): Moves an email to Trash.list_labels(): Lists all system labels and user custom folders.apply_label(message_id, label_name): Tags an email (e.g.Urgent,Invoices,Work). Creates the label automatically if missing.remove_label(message_id, label_name): Removes a label from an email.batch_modify_emails(message_ids, add_labels, remove_labels): Modifies labels on up to 1,000 emails in a single fast API call (for bulk mark-as-read, bulk archiving, or bulk labeling).
π Running the Server & Frontend
Start the Interactive Frontend & Tools Playground
cd /home/thirunagarisrimehar/Desktop/3_months_plan/Auto_reader/gmail-mcp-server
./venv/bin/python web_app.pyOpen http://localhost:5000 in your browser.
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 for AI agents: read, search and send from your Gmail, Outlook, Yahoo, iCloud or IMAP inbox.
Email inboxes and calendars for AI agents: send, receive, search, draft and schedule.
Email inboxes and calendars for AI agents: send, receive, search, draft and schedule.
Email inboxes for AI agents: send, receive, search, drafts with owner approval, and webhooks.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to read, search, organize, and draft emails in Gmail inboxes with support for multiple accounts, OAuth authentication, and 26 comprehensive tools for email management.239 npm3MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to read, search, compose, and send emails by connecting to any IMAP/SMTP provider. It supports comprehensive mailbox management, including draft handling and message deletion, directly through natural language.10206 npm11MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to send, read, and manage emails via SMTP and IMAP, with support for attachments, threads, and mailbox organization.1652 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to read, send, organize, and search emails across multiple IMAP/SMTP mailboxes.MIT