Email Management MCP Server
Connects to Gmail via IMAP to search and retrieve emails with filtering capabilities by subject, date range, sender, and mailbox, plus the ability to mark emails as read
Click on "Deploy 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., "@Email Management MCP Server search for emails from my boss in the last week and summarize them"
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.
Email Management
This project is designed to summarize emails using a custom IMAP client to connect to the user's email inbox and retrieve relevant messages based on specified criteria.
Features
Connects to an IMAP server to fetch emails.
Can filter emails by:
Subject
Date range
Sender email address
Mailbox (default is 'INBOX')
Related MCP server: mcp-imap-server
Debug
Stdio: If you run this server in STDIO mode, all logs are saved in
server.logfile, in the location where you run the command. You can change this, setting theDEBUG_LOG_FILEenvironment variable to a custom path (absolute path).Docker: this mode use STDIO mode, so all logs are saved in
server.logfile, in the location where you run the command. You can change this, setting theDEBUG_LOG_FILEenvironment variable to a custom path (absolute path).Stream: If you run this server in stream mode, all logs are printed to the console.
Available Tools
search-emails: Get emails from the user's inbox.mark-emails-as-read: Mark specified emails as read.
Usage
Command (NPM)
Install dependencies
pnpm install -g @cardor/email-summarizerAdd the configuration to your app client.
"email-summarizer": {
"type": "stdio", // Maybe your client MCP require specific type, like 'stdio'
"command": "cardor-email-summarizer",
"env": {
// Your email address.
"EMAIL_USERNAME": "<your-email>",
// Your email app password.
"EMAIL_PASSWORD": "<your-app-password>",
// The port for the IMAP server (default is 993).
"EMAIL_PORT": "993",
// The type of email client: gmail, outlook, yahoo, etc (default is 'gmail').
"EMAIL_CLIENT_TYPE": "gmail",
// Custom prompt for summarization. Must include `{{emails}}` to insert the email content.
"EMAIL_PROMPT": "Summarize the following emails: {{emails}}",
// You can also use a file path to load the prompt content. You must use absolute path.
// The file types supported are: .txt, .md, .json or .pdf.
// "EMAIL_PROMPT": "file://Absolute/Path/To/Prompt.txt"
// Also you can define a URL to load the prompt content. The URL must return a text content.
// The file types supported are: .txt, .md, .json or .pdf.
// "EMAIL_PROMPT": "https://example.com/path/to/prompt.txt"
}
}Command (With Docker)
Clone the repository
git clone <repository-url>Build the Docker image
pnpm run docker:buildAdd the configuration to your app client.
"email-dock": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"EMAIL_USERNAME=<your-email>",
"-e",
"EMAIL_PASSWORD=<your-app-password>",
"-e",
"EMAIL_PORT=993",
"-e",
"EMAIL_CLIENT_TYPE=gmail",
"-e",
// Custom prompt for summarization. Must include `{{emails}}` to insert the email content.
// As above, you can use a file path or a URL.
"EMAIL_PROMPT=Summarize the following emails: {{emails}}",
"email-summarizer",
]
}Stream HTTP requests
You can also use the HTTP API to interact with the email summarizer. The API expects the following headers:
Clone the repository
git clone <repository-url>Install dependencies
pnpm installBuild the MCP
pnpm run buildStart the MCP
pnpm run startUse the MCP serve to
http://localhost:5555/mcp
Send in headers:
email-username: Your email address.email-password: Your email app password.email-port: The port for the IMAP server (default is 993).email-client-type: The type of email client (default is 'gmail').email-prompt: Custom prompt for summarization (default is 'Summarize the following emails: {{emails}}'). Must include{{emails}}to insert the email content. As above, you can use a file path or a URL.
Future work
I'll be working on:
Allow execute action as marking emails as read, deleting, etc.
Allow override default prompt for the summarization.
Adding more filters and options for email retrieval.
Allow fetch whole body information of the email (text, HTML, attachments, etc.).
Available Tools
2 toolsfetch-emailsFetch EmailsC
Get emails from the user's inbox. Can specify the mailbox (INBOX by default), a subject (string), date range (ISO format: YYYY-MM-DDTHH:mm:ss), and sender emails (list of strings) to filter emails.
Inputs: dateRange (required), mailbox, subject, senders. Returns: error, emails
send-emailSend EmailB
Send Email with subject, destination and body
Inputs: to (required), subject (required), body (required). Returns: error, success
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: fetch-emails retrieves emails from an inbox with filtering options, while send-email sends emails out. There is no overlap in functionality, making it easy for an agent to choose the correct tool for reading versus sending.
Both tools follow a consistent verb-noun pattern with hyphen separation (fetch-emails, send-email). The naming is predictable and readable, with no deviations in style or convention across the set.
With only 2 tools, the server feels thin for an email management domain. Key operations like replying to emails, deleting emails, managing folders, or marking emails as read are missing, which limits the server's utility and scope.
The toolset is severely incomplete for email management. It covers basic fetch and send but lacks essential CRUD/lifecycle operations such as update (e.g., reply, forward), delete, or organizational functions (e.g., move to folder). This will cause agent failures in common email workflows.
Related MCP Connectors
Connect any IMAP/SMTP mailbox to Claude & ChatGPT: search, read, sort, draft. Sends only with OK.
Connect Gmail, iCloud Mail, Outlook, Yahoo Mail, Fastmail and other IMAP inboxes to ChatGPT, Claude and compatible AI assistants. Find emails by meaning across languages with semantic search. Ask AI to find customer conversations, summarize deadlines and draft follow-ups. Give a sales rep access to a shared outreach inbox or bring email into a compatible CRM. Share an iCloud custom-domain inbox with teammates without their own Apple ID or iCloud+ plan. Search results may be incomplete or stale; separate permissions control mail actions.
Email for AI agents: read, search and send from your Gmail, Outlook, Yahoo, iCloud or IMAP inbox.
Your mailboxes in ChatGPT and Claude: Gmail, iCloud, Fastmail, any IMAP. Passwords stay yours.
Related MCP Servers
- 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.10233 npm11MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to read, search, and manage emails via IMAP with secure, read-only access to email accounts.6MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to read recent emails and fetch full email content from an IMAP inbox, allowing natural language queries about email summaries.3ISC
- AlicenseAqualityDmaintenanceEnables AI assistants to read and interact with a user's email inbox via IMAP, fetching recent emails and reading their full content.8ISC