gmail-mcp-imap
Provides email management for Gmail via IMAP/SMTP, including fetching emails by category, searching, reading, sending, replying, starring, deleting, labeling, and handling attachments.
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-imapShow me my primary emails from the last week"
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-imap
A Gmail MCP (Model Context Protocol) server that provides email management capabilities through IMAP/SMTP. Works with Claude Desktop, Claude Code, and any MCP-compatible client.
Features
Gmail Categories: Fetch emails by Gmail's smart categories (Primary, Social, Promotions, Updates, Forums)
Full Email Management: Read, send, reply, star, delete, and label emails
Attachment Handling: List, download, and save attachments to disk
No Google API Required: Uses IMAP/SMTP directly with App Password authentication
Date Filtering: Filter emails by date range
Related MCP server: IMAP MCP Server
Installation
npm install gmail-mcp-imapOr run directly with npx:
npx gmail-mcp-imapPrerequisites
A Gmail account
App Password (not your regular password):
Go to Google Account Security
Enable 2-Step Verification if not already enabled
Go to App Passwords (search for "App Passwords" in account settings)
Generate a new app password for "Mail"
Copy the 16-character password
Configuration
Environment Variables
Set these environment variables before running:
export GMAIL_EMAIL="your-email@gmail.com"
export GMAIL_APP_PASSWORD="your-16-char-app-password"Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"gmail": {
"command": "npx",
"args": ["gmail-mcp-imap"],
"env": {
"GMAIL_EMAIL": "your-email@gmail.com",
"GMAIL_APP_PASSWORD": "your-app-password"
}
}
}
}Claude Code Configuration
Add to your .mcp.json:
{
"mcpServers": {
"gmail": {
"command": "npx",
"args": ["gmail-mcp-imap"],
"env": {
"GMAIL_EMAIL": "your-email@gmail.com",
"GMAIL_APP_PASSWORD": "your-app-password"
}
}
}
}Available Tools
Category Tools
Tool | Description |
| Important conversations from real people |
| Social network notifications |
| Marketing emails, deals, offers |
| Receipts, bills, statements |
| Mailing lists, discussion groups |
Search & Read Tools
Tool | Description |
| Search emails by keywords |
| Get full email content by UID (pass |
| Get emails from a specific label/folder, with |
| List all Gmail labels/folders |
Action Tools
Tool | Description |
| Send a new email |
| Reply to an existing email |
| Mark email as read |
| Mark email as unread |
| Star or unstar an email |
| Move email to trash |
| Apply a label to an email |
Attachment Tools
Tool | Description |
| List attachments in an email |
| Download attachment as Base64 |
| Save attachment to disk |
Usage Examples
Once configured, you can ask Claude:
"Show me my primary emails from the last week"
"Search for emails from Amazon"
"Read the email with UID 12345"
"Send an email to john@example.com about the meeting"
"Download the PDF attachment from email 12345"
"Star the important emails about invoices"
Why IMAP/SMTP?
This MCP server uses IMAP/SMTP instead of the Google API because:
Simpler Setup: No OAuth consent screen or API credentials needed
App Passwords: More secure than storing your main password
No Rate Limits: Google API has strict quotas; IMAP doesn't
Works Offline: No dependency on Google's API servers
Privacy: Your emails aren't processed through additional Google services
Development
# Clone the repository
git clone https://github.com/suhail-ak-2/gmail-mcp-imap.git
cd gmail-mcp
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build for production
npm run build
# Run production build
npm startLicense
MIT
Author
Suhail (@ansuhail.ak@gmail.com)
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
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered inbox management with natural language commands through Claude Desktop. Supports sending, reading, searching, organizing emails, and managing labels using Gmail API with automatic authentication.8MIT
- AlicenseAqualityAmaintenanceEnables Claude to interact with email accounts via IMAP and SMTP, providing tools for searching, reading, sending, and managing emails across multiple providers.4041776MIT
- FlicenseNot gradedqualityBmaintenanceEnables Claude to read, search, draft, send, flag, and move email across multiple IMAP/SMTP mailboxes while keeping credentials local.
- FlicenseNot gradedqualityDmaintenanceEnables Claude Code to manage email inboxes via IMAP, including reading, categorizing, phishing detection, archiving, junking, and sending emails with user permission.
Related MCP Connectors
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Hosted email MCP for AI agents with inboxes, send/receive, memory, recovery, and credits.
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/suhail-ak-2/gmail-mcp-imap'
If you have feedback or need assistance with the MCP directory API, please join our Discord server