Email Management MCP Server
Enables users to connect to their email inbox via IMAP to search, filter, and summarize emails based on criteria like subject, date, and sender. Supports marking emails as read and provides customizable email summarization with various prompt options.
README
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')
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-summarizer - Add 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:build - Add 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 install - Build the MCP
pnpm run build - Start the MCP
pnpm run start - Use 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:
- [x] Allow execute action as marking emails as read, deleting, etc.
- [x] 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.).
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.