Gmail MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Gmail MCP ServerShow me my unread emails from the past 3 days"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Gmail MCP Server
A comprehensive Gmail integration for Cursor IDE that provides email management, collaborative drafting, and intelligent email crafting capabilities.
Features
Email Management: Read, reply, archive, delete emails
Collaborative Drafting: Create, review, and edit drafts before sending
Smart Email Crafting: AI-powered email composition with your personal style
Bulk Operations: Efficiently manage multiple emails
Web UI: Clean, modern interface for email management
Search & Filter: Advanced Gmail search capabilities
Related MCP server: Gmail AutoAuth MCP Server
Setup
1. Google OAuth Credentials
Create Google OAuth Desktop credentials in Google Cloud Console
Add redirect URI:
http://127.0.0.1:53682/oauth2callbackProvide credentials via environment variables or config file
2. Cursor Configuration
Register in ~/.cursor/mcp.json:
{
"mcpServers": {
"gmail": {
"command": "node",
"args": ["/Users/danny/development/mcp-servers/mcp-gmail/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "<your_client_id>",
"GOOGLE_CLIENT_SECRET": "<your_client_secret>"
}
}
}
}Configuration
Auto-Labeling Rules
Auto-labeling rules are stored in auto-labeling-rules.json within the project directory. This file contains:
Rule definitions with search criteria
Enable/disable status for each rule
Creation and last-run timestamps
Version control metadata
Tools
Authentication
start_oauth({ port? })- Start OAuth flow, returns authorization URLauth_status()- Check current authentication status
Email Reading
list_unread({ max? })- List recent unread emailslist_recent_unread({ days?, max? })- List recent unread emails in table format (default: 7 days)get_message({ id })- Get full message contentsearch_emails({ query, max? })- Search emails with Gmail syntax
list_recent_unread Method
This new method provides a clean table format for viewing recent unread emails:
Parameters:
days(string, optional): Number of days to look back. Supports multiple formats:"2"- 2 days"3d"- 3 days"2 days"- 2 days"--2"- 2 daysDefault:
"7"(7 days)
max(number, optional): Maximum emails to return (default: 50, max: 100)
Output Format:
| ID | Date | Sender | Subject |
|---|---|---|---|
| 1 | 18/09 16:56 | Dumith Salinda (GitHub) | Re: [pixeltoplanet/carbonfooter-plugin] feat(cache) |
| 2 | 18/09 21:40 | Ivan at Notion | Notion 3.0: Agents |
**Total: 2 unread emails**Examples:
list_recent_unread()- Last 7 days, max 50 emailslist_recent_unread({days: "2"})- Last 2 dayslist_recent_unread({days: "3d", max: 20})- Last 3 days, max 20 emails
Email Management
mark_as_read({ id })- Mark message as readbatch_archive({ ids[] })- Archive multiple messagesbatch_delete({ ids[], permanent? })- Delete multiple messagesdelete_email({ id, permanent? })- Delete single emaildelete_emails_by_query({ query, max?, permanent?, dry_run? })- Delete emails by search querybulk_delete_emails({ query, batch_size?, permanent?, dry_run? })- High-performance bulk delete
Email Composition
reply_to_message({ message_id, body })- Send immediate replycreate_draft({ to, subject, body, html?, reply_to_message_id? })- Create draft emailget_draft({ draft_id })- Review draft contentlist_drafts({ max? })- List all draftsupdate_draft({ draft_id, to?, subject?, body?, html? })- Update existing draftsend_draft({ draft_id })- Send draft emaildelete_draft({ draft_id })- Delete draft
User Interface
start_ui({ port?, query?, max? })- Launch web UI at http://127.0.0.1:53750/stop_ui()- Stop the web UI server
Auto-Labeling Rules Management
list_auto_labeling_rules()- List all stored auto-labeling rulesadd_auto_labeling_rule({ label_name, sender_pattern?, subject_pattern?, query?, enabled? })- Add new auto-labeling ruleremove_auto_labeling_rule({ rule_index })- Remove rule by indexupdate_auto_labeling_rule({ rule_index, label_name?, sender_pattern?, subject_pattern?, query?, enabled? })- Update existing rulerun_auto_labeling_rules({ dry_run?, max_per_rule? })- Execute all enabled rulesexport_auto_labeling_rules({ file_path? })- Export rules to JSON fileimport_auto_labeling_rules({ file_path, merge? })- Import rules from JSON file
Automated Scheduler
start_scheduler({ recent_unread_interval?, auto_labeling_interval? })- Start automated schedulerstop_scheduler()- Stop the automated schedulerget_scheduler_status()- Get current scheduler status and configuration
Scheduler Features
The scheduler automatically runs two key functions at configurable intervals while the server is running:
Recent Unread Check: Runs
list_recent_unreadto monitor new emailsAuto-Labeling: Runs
run_auto_labeling_rulesto apply labeling rules
Default Intervals:
Recent Unread: 5 minutes (300,000ms)
Auto-Labeling: 15 minutes (900,000ms)
Usage Examples:
// Start with default intervals
start_scheduler()
// Start with custom intervals (1 minute and 5 minutes)
start_scheduler({
recent_unread_interval: 60000, // 1 minute
auto_labeling_interval: 300000 // 5 minutes
})
// Check status
get_scheduler_status()
// Stop scheduler
stop_scheduler()Scheduler Benefits:
Continuous Monitoring: Automatically checks for new emails
Automatic Organization: Applies labeling rules without manual intervention
Server-Only: Only runs while the MCP server is active
Configurable: Adjust intervals based on your needs
Error Handling: Continues running even if individual operations fail
Logging: All scheduler activity is logged to stderr for monitoring
Usage
Basic Workflow
Call
start_oauthand authorize in browserUse
list_unreadorsearch_emailsto find emailsUse
get_messageto read full contentUse
reply_to_messagefor quick replies orcreate_draftfor collaborative writing
Collaborative Email Crafting
create_draft- Start with basic contentget_draft- Review the draftupdate_draft- Refine the content togethersend_draft- Send when perfect
Web Interface
Call
start_uito open the modern web interfaceBrowse emails, select multiple items, perform bulk actions
Rich text editor for composing replies
Danny's Email Writing Style & Templates
Based on analysis of 30 recent sent emails
Writing Style Preferences
Tone: Conversational yet professional, direct and honest
Language: Dutch (80% of emails) for personal/business relationships, English for international/technical contexts
Structure: Clear problem-solution format, bullet points for achievements, short paragraphs
Sign-off: "Met vriendelijke groet, Danny Moons" (standard)
Signature: Always includes email (danny@moonsio.nl) and phone (0628509910)
Actual Email Patterns
Opening Styles
Dutch Personal: "Hoi [Name]," (most common)
English: "Hi [Name]," (international/technical)
Casual: "Hey [Name]," (close business relationships)
Content Structure
Problem Identification: Clear explanation of issues
Solution-Oriented: Always provides actionable next steps
Educational Approach: Explains what went wrong and how to prevent it
Collaborative Tone: "Laten we samen bepalen wat prioriteit heeft"
Timeline Management: Clear expectations ("na mijn vakantie", "begin oktober")
Closing Patterns
Standard: "Met vriendelijke groet, Danny Moons"
Contact Info: Always includes email and phone
Personal Touch: "Ik hoor het graag" / "Ik hoor graag wat je ervan vind"
Confirmation Requests: "Kun je controleren of het zo goed staat?"
Email Templates
Dutch Personal Template (Based on Actual Usage)
Hoi {name},
{personal greeting and context}
{main content with bullet points for achievements}
Wat we hebben bereikt:
• {achievement 1}
• {achievement 2}
• {achievement 3}
Ik hoor graag wat je ervan vind.
Met vriendelijke groet,
Danny Moons
E: danny@moonsio.nl
T: 0628509910Dutch Business Template (Based on Actual Usage)
Hoi {name},
{problem identification and context}
{clear solution or next steps}
{timeline or expectations}
Ik hoor het graag. Voor nu alvast een fijn weekend en ik spreek je ongetwijfeld na mijn korte vakantie.
Met vriendelijke groet,
Danny Moons
E: danny@moonsio.nl
T: 0628509910Technical Support Template
Hi {name},
Waarschijnlijk heb je {issue} per ongeluk {cause}, waardoor {symptom}. Ik heb het nu {solution} door {action}. Kun je controleren of het zo goed staat?
Wil je dat ik nog andere {items} aanpas of is dit voldoende voor nu?
Met vriendelijke groet,
Danny Moons
E: danny@moonsio.nl
T: 0628509910Out of Office Template (Actual Template Used)
Hoi hoi,
Bedankt voor je bericht. Op dit moment ben ik met vakantie en vanaf 30 september ben ik weer bereikbaar en pak ik mijn werkzaamheden op.
Tot snel!
Met vriendelijke groet,
Danny Moons
E: danny@moonsio.nl
T: 0628509910Communication Guidelines for AI Assistant
When helping Danny craft emails:
Language Selection: Use Dutch for 80% of communications, English only for international/technical contexts
Tone Matching: Match Danny's conversational yet professional, direct and honest style
Structure: Use bullet points for achievements, problem-solution format, short paragraphs
Personalization: Include personal context ("na mijn vakantie"), acknowledge challenges ("Helemaal soepel ging het niet")
Signature: Always include full contact details (email + phone)
Proactivity: Offer solutions before being asked, be solution-oriented
Confirmation: Ask for confirmation ("Kun je controleren of het zo goed staat?")
Timeline Management: Set clear expectations about availability and deadlines
Email Formatting Rules
IMPORTANT: When creating emails or drafts:
{signature} Placeholder: When user mentions
{signature}, always replace with the complete signature:Met vriendelijke groet, Danny Moons E: danny@moonsio.nl T: 0628509910Proper Email Structure: Always create complete, professional emails with:
Appropriate greeting (Hoi/Hi + name)
Clear, well-formatted body content
Complete signature with contact details
Proper line breaks and spacing
Language Corrections: fix typos and make sure to use correct sentences.
Draft Quality: Ensure drafts are ready to send without additional editing
Email Categories & Approaches (Based on Actual Usage)
Technical Support: Problem identification → Solution explanation → Confirmation request
Business Communication: Transparent pricing, clear timelines, professional boundaries
Personal Updates: Achievement sharing with bullet points, storytelling elements
Project Management: Collaborative decision-making, priority setting
Client Relations: Educational approach, proactive problem-solving
Vacation Management: Clear out-of-office with return dates
Key Writing Characteristics Observed
Efficiency: Gets to the point quickly without unnecessary fluff
Empathy: Acknowledges challenges and difficulties honestly
Proactivity: Offers solutions and next steps before being asked
Personalization: Adapts tone based on relationship (formal vs casual)
Professionalism: Maintains business standards while being approachable
Educational: Explains technical issues in understandable terms
Collaborative: Uses inclusive language ("laten we samen", "ik hoor het graag")
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-quality-maintenanceEnables AI agents to interact with Gmail for classifying messages, extracting action items, and performing batch inbox triage. It supports automated labeling, smart replies, and task creation for external platforms like Linear, Jira, and Todoist.Last updated
- Alicense-qualityDmaintenanceEnables AI assistants to manage Gmail through natural language interactions, including sending, reading, searching emails, and managing labels with auto authentication support.Last updated31,4161MIT
- Alicense-qualityDmaintenanceIntegrates with Gmail APIs to manage emails and labels, including sending, deleting, summarizing, and semantic search via RAG.Last updated2006MIT
- Flicense-qualityDmaintenanceEnables AI-powered email management through Gmail, including search, send, drafts, labels, and an intelligent agent with human approval workflow and optional customer database integration.Last updated
Related MCP Connectors
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
AI email inbox and sending tools with attachments, search, live events, and webhooks.
Manage Gmail messages, threads, labels, drafts, and settings from your workflows. Send and organiz…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dannymoons/mcp-gmail'
If you have feedback or need assistance with the MCP directory API, please join our Discord server