Enables reading, sending, replying to, and managing Gmail emails, including searching messages, viewing conversation threads, marking read/unread status, and downloading attachments through IMAP/SMTP protocols.
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 Profind emails from my boss about the quarterly report"
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 Pro
A powerful Model Context Protocol (MCP) server for Gmail β Read, send, reply, and manage emails directly from Claude Desktop or any MCP-compatible AI assistant.
β¨ What Makes This Special
Gmail MCP Pro lets AI assistants like Claude interact with your Gmail inbox naturally. No complex OAuth flows, no Google Cloud Console setup β just a simple app password and you're ready to go in under 5 minutes.
π― Key Features
Feature | Description |
π Read Full Emails | Get complete email content, not just snippets |
π€ Send Emails | Compose and send emails with CC/BCC support |
π¬ Threaded Replies | Reply to emails while keeping conversation threads intact |
π§΅ View Conversations | See all messages in an email thread |
β Mark Read/Unread | Manage your inbox state |
π Download Attachments | Extract attachments from emails |
π Search Inbox | Find emails using Gmail search syntax |
π Quick Start (5 Minutes)
Step 1: Get a Gmail App Password
Go to Google Account Security
Enable 2-Step Verification (required)
Go to App Passwords (search "app passwords" in account settings)
Select Mail and your device
Click Generate β Copy the 16-character password
β οΈ Important: You need 2-Step Verification enabled to create app passwords.
Step 2: Clone & Install
git clone https://github.com/GodotH/GMAIL-MCP-PLUS.git
cd GMAIL-MCP-PLUS
npm installStep 3: Configure Environment
Create a .env file in the project root:
EMAIL_ADDRESS=your.email@gmail.com
EMAIL_PASSWORD=xxxx xxxx xxxx xxxx
IMAP_HOST=imap.gmail.com
IMAP_PORT=993
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587Replace
xxxx xxxx xxxx xxxxwith your 16-character app password (spaces optional).
Step 4: Build
npm run buildStep 5: Add to Claude Desktop
Open your Claude Desktop config file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Add this configuration:
{
"mcpServers": {
"gmail": {
"command": "node",
"args": ["C:/path/to/GMAIL-MCP-PLUS/dist/index.js"],
"cwd": "C:/path/to/GMAIL-MCP-PLUS"
}
}
}π Replace
C:/path/to/GMAIL-MCP-PLUSwith your actual path.
Step 6: Restart Claude Desktop
Close and reopen Claude Desktop. You should now be able to interact with your Gmail!
π Available Tools
π listMessages
List recent messages from your inbox.
"Show me my last 10 emails"Parameters:
count(optional): Number of messages (1-100, default: 10)
π findMessage
Search for emails using Gmail search syntax.
"Find emails from john@example.com about the project"Parameters:
query(required): Search query
Supported search operators:
from:sender@example.comto:recipient@example.comsubject:keywordhas:attachmentis:unreadafter:2024/01/01before:2024/12/31
π getMessage
Read the full content of a specific email.
"Read email ID 19"Parameters:
id(required): Message ID (from listMessages or findMessage)
Returns: Complete email with body, attachments info, and threading headers.
βοΈ sendMessage
Send a new email.
"Send an email to jane@example.com with subject 'Meeting Tomorrow' saying 'Hi Jane, can we meet at 3pm?'"Parameters:
to(required): Recipient emailsubject(required): Email subjectbody(required): Message contentcc(optional): CC recipientbcc(optional): BCC recipient
π¬ replyToMessage
Reply to an existing email (maintains thread).
"Reply to email 19 saying 'Thanks for the information!'"Parameters:
id(required): Message ID to reply tobody(required): Reply contentincludeQuote(optional): Include original message (default: true)
π§΅ getThread
Get all messages in a conversation.
"Show me the full conversation for email 19"Parameters:
id(required): Any message ID in the thread
β markAsRead
Mark an email as read or unread.
"Mark email 19 as read"Parameters:
id(required): Message IDread(optional): true for read, false for unread (default: true)
π getAttachment
Download an attachment from an email.
"Download the first attachment from email 19"Parameters:
messageId(required): Message IDattachmentIndex(optional): Which attachment (0-based, default: 0)maxSizeBytes(optional): Size limit (default: 10MB, max: 25MB)
π§ Configuration Options
Environment Variables
Variable | Required | Default | Description |
| Yes | - | Your Gmail address |
| Yes | - | Gmail App Password |
| No |
| IMAP server |
| No |
| IMAP port |
| No |
| SMTP server |
| No |
| SMTP port |
Other Email Providers
Gmail MCP Pro works with any email provider that supports IMAP/SMTP:
Outlook/Hotmail:
IMAP_HOST=outlook.office365.com
IMAP_PORT=993
SMTP_HOST=smtp-mail.outlook.com
SMTP_PORT=587Yahoo:
IMAP_HOST=imap.mail.yahoo.com
IMAP_PORT=993
SMTP_HOST=smtp.mail.yahoo.com
SMTP_PORT=587π³ Docker Usage (Optional)
# Build
docker build -t gmail-mcp-pro .
# Run
docker run --rm -i --env-file .env gmail-mcp-proOr with docker-compose:
docker-compose up -dπ οΈ Development
# Install dependencies
npm install
# Development mode (with tsx)
npm run dev
# Watch for changes
npm run watch
# Build for production
npm run build
# Start production
npm startπ Security Notes
App Passwords are specific to your app and can be revoked anytime
Never share your
.envfile or commit it to gitThe
.gitignorealready excludes.envApp passwords don't give access to your Google account settings
You can delete the app password anytime to revoke access
β Troubleshooting
"Authentication failed"
Ensure 2-Step Verification is enabled on your Google account
Generate a new App Password (they can only be viewed once)
Make sure you're using the App Password, not your regular password
"Connection refused"
Check if your firewall allows ports 993 (IMAP) and 587 (SMTP)
Verify IMAP is enabled in Gmail settings: Settings β See all settings β Forwarding and POP/IMAP β Enable IMAP
"Message not found"
Message IDs change between sessions
Use
listMessagesorfindMessageto get current IDs
Claude Desktop doesn't see the tools
Verify the path in
claude_desktop_config.jsonis correctRestart Claude Desktop completely (not just close the window)
Check the path uses forward slashes or escaped backslashes
π Changelog
v2.0.0 (Current)
β¨ NEW:
getMessage- Read full email content⨠NEW:
replyToMessage- Threaded replies⨠NEW:
getThread- View full conversations⨠NEW:
markAsRead- Mark emails read/unread⨠NEW:
getAttachment- Download attachmentsπ§ Improved email parsing with mailparser
π§ Better error handling
v1.0.0 (Original)
Basic
listMessages,findMessage,sendMessage
π Credits
This project is a fork of Sallytion/Gmail-MCP, extended with additional functionality for full email management.
π License
MIT License β feel free to use, modify, and distribute.
π€ Author
Godot Huard
GitHub: @GodotH
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/AmazingFeature)Commit your changes (
git commit -m 'Add some AmazingFeature')Push to the branch (
git push origin feature/AmazingFeature)Open a Pull Request
β Star History
If you find this useful, please give it a star! It helps others discover the project.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.