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
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-summarizerAdd the configuration to your app client.
Command (With Docker)
Clone the repository
git clone <repository-url>Build the Docker image
pnpm run docker:buildAdd the configuration to your app client.
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.).
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
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.