IMAP MCP Server
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., "@IMAP MCP Server search for unread emails from 'GitHub' and show me their subjects"
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.
IMAP MCP Server
Status: Getestet
MCP (Model Context Protocol) Server für IMAP Email-Operationen.
Installation
cd IMAP-MCP
pip install -e .Related MCP server: thunderbird-mcp-server
Konfiguration
Kopiere
config.json.examplezuconfig.jsonTrage deine IMAP-Zugangsdaten ein:
{
"imap": {
"host": "imap.example.com",
"port": 993,
"secure": true
},
"credentials": {
"username": "deine-email@example.com",
"password": "dein-app-passwort"
}
}Verwendung
Als MCP Server starten
imap-mcpIn Claude Code einbinden
In ~/.claude/settings.json:
{
"mcpServers": {
"imap": {
"command": "python",
"args": ["-m", "imap_mcp.server"],
"cwd": "/pfad/zu/IMAP-MCP/src"
}
}
}Funktionen (38 Tools)
Verbindung
Funktion | Beschreibung |
connect | IMAP-Verbindung aufbauen |
authenticate | Login mit Username/Passwort |
disconnect | Verbindung schliessen |
auto_connect | Mit config.json Credentials verbinden |
Mailboxen
Funktion | Beschreibung |
list_mailboxes | Alle Ordner auflisten |
select_mailbox | Ordner oeffnen |
create_mailbox | Neuen Ordner erstellen |
get_mailbox_status | Status (Anzahl, Ungelesen, etc.) |
Emails lesen
Funktion | Beschreibung |
fetch_emails | Emails abrufen mit Filtern |
get_email | Komplette Email per UID |
get_email_headers | Nur Header (schneller) |
get_email_body | Body (text/html) |
get_attachments | Anhaenge auflisten |
download_attachment | Anhang herunterladen (base64) |
get_thread | Email-Thread/Konversation |
Suche
Funktion | Beschreibung |
search_emails | Freie Suche (IMAP SEARCH) |
search_by_sender | Nach Absender |
search_by_subject | Nach Betreff |
search_by_date | Nach Datum |
search_unread | Alle ungelesenen |
search_flagged | Alle markierten |
Aktionen
Funktion | Beschreibung |
mark_read | Als gelesen markieren |
mark_unread | Als ungelesen markieren |
flag_email | Flag hinzufuegen |
unflag_email | Flag entfernen |
move_email | In anderen Ordner verschieben |
copy_email | In anderen Ordner kopieren |
archive_email | Archivieren |
save_draft | Entwurf speichern |
Statistiken
Funktion | Beschreibung |
get_unread_count | Anzahl ungelesener Emails |
get_total_count | Gesamtanzahl |
Cache & Watch
Funktion | Beschreibung |
get_cached_overview | Gecachte Uebersicht |
refresh_cache | Cache aktualisieren |
start_watch | IDLE Watch starten |
stop_watch | IDLE Watch stoppen |
idle_watch | Einzelne Mailbox beobachten |
Auto-Archive
Funktion | Beschreibung |
get_auto_archive_list | Auto-Archive Sender auflisten |
add_auto_archive_sender | Sender hinzufuegen |
remove_auto_archive_sender | Sender entfernen |
reload_auto_archive | Config neu laden |
Lizenz
MIT
Available Tools
41 toolsadd_auto_archive_senderC
Add sender to auto-archive list
Inputs: email (required), comment.
archive_emailC
Archive emails (move to Archive folder)
Inputs: uids (required), mailbox, archiveFolder.
authenticateC
Login with username and password
Inputs: username (required), password (required), smtpHost, smtpPort.
auto_connectB
Connect using config.json credentials (no parameters needed)
Inputs: no named parameters.
connectC
Establish IMAP connection to mail server
Inputs: host (required), port, secure.
copy_emailC
Copy emails to another mailbox
Inputs: uids (required), destination (required), mailbox.
create_mailboxC
Create a new mailbox folder
Inputs: mailbox (required).
disconnectB
Close IMAP connection
Inputs: no named parameters.
download_attachmentC
Download attachment content (base64)
Inputs: uid (required), attachmentIndex (required), mailbox.
fetch_emailsC
Fetch emails from mailbox with optional filters
Inputs: mailbox, limit, offset, since, +1 more.
flag_emailC
Add flag to emails
Inputs: uids (required), flag (required), mailbox.
get_attachmentsC
List attachments of an email
Inputs: uid (required), mailbox.
get_auto_archive_listB
Get list of senders that are auto-archived
Inputs: no named parameters.
get_cached_overviewB
Get cached email overview for INBOX, next, waiting, someday (from in-memory cache)
Inputs: mailbox, limit.
get_emailC
Get complete email by UID
Inputs: uid (required), mailbox.
get_email_bodyC
Get email body content
Inputs: uid (required), mailbox, format.
get_email_headersB
Get only email headers (faster)
Inputs: uid (required), mailbox.
get_mailbox_statusC
Get mailbox status (message count, unseen, etc.)
Inputs: mailbox (required).
get_threadC
Get email thread/conversation
Inputs: uid (required), mailbox.
get_total_countC
Get total email count in mailbox
Inputs: mailbox.
get_unread_countC
Get count of unread emails
Inputs: mailbox.
idle_watchC
Start watching mailbox for new emails (IMAP IDLE) - single mailbox, temporary
Inputs: mailbox, timeout.
list_mailboxesC
List all mailbox folders
Inputs: pattern.
mark_readC
Mark emails as read
Inputs: uids (required), mailbox.
mark_unreadC
Mark emails as unread
Inputs: uids (required), mailbox.
move_emailC
Move emails to another mailbox
Inputs: uids (required), destination (required), mailbox.
process_auto_archiveA
Process INBOX and archive emails from listed senders. Use dry_run=true to preview without moving.
Inputs: dry_run.
refresh_cacheB
Force refresh of email cache for all watched mailboxes
Inputs: no named parameters.
reload_auto_archiveB
Reload auto-archive config from file (after manual edit)
Inputs: no named parameters.
remove_auto_archive_senderC
Remove sender from auto-archive list
Inputs: email (required).
save_draftB
Save email as draft (automatically includes user signature from config)
Inputs: to (required), subject (required), body (required), cc, +4 more.
search_by_dateC
Search emails by date range
Inputs: since, before, mailbox, limit.
search_by_senderC
Search emails by sender address
Inputs: sender (required), mailbox, limit.
search_by_subjectC
Search emails by subject
Inputs: subject (required), mailbox, limit.
search_emailsC
Search emails with query
Inputs: query (required), mailbox, limit.
search_flaggedB
Get all flagged/starred emails
Inputs: mailbox, limit.
search_unreadC
Get all unread emails
Inputs: mailbox, limit.
select_mailboxC
Select/open a mailbox folder
Inputs: mailbox (required).
start_watchC
Start permanent IDLE watch on INBOX, next, waiting, someday
Inputs: no named parameters.
stop_watchC
Stop the permanent IDLE watch
Inputs: no named parameters.
unflag_emailC
Remove flag from emails
Inputs: uids (required), flag (required), mailbox.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 41 tools
The tools have clear purposes for core IMAP operations like fetch_emails, move_email, and create_mailbox, but there is notable overlap in search functionality (search_emails, search_by_date, search_by_sender, search_by_subject, search_unread, search_flagged) and in email status retrieval (get_unread_count, get_total_count, get_mailbox_status, get_cached_overview), which could cause confusion or redundancy in agent selection.
Tool names follow a consistent snake_case pattern with clear verb_noun structures, such as fetch_emails, create_mailbox, and download_attachment. Minor deviations exist, like auto_connect (which lacks an object) and idle_watch (which is less descriptive), but overall the naming is predictable and readable.
With 41 tools, the count is excessive for an IMAP server, leading to a bloated interface. Many tools could be consolidated (e.g., multiple search variants into parameters of a single search tool), making it heavy and potentially overwhelming for agents to navigate efficiently.
The tool set provides comprehensive coverage for IMAP email management, including connection handling (connect, authenticate, disconnect), mailbox operations (list_mailboxes, create_mailbox), email retrieval (fetch_emails, get_email), actions (move_email, archive_email, flag_email), search capabilities, and advanced features like auto-archiving and IDLE watching, leaving no obvious gaps for the domain.
Related MCP Connectors
Email for AI agents: read, search and send from your Gmail, Outlook, Yahoo, iCloud or IMAP inbox.
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Bring Gmail, Outlook, iCloud Mail, Yahoo Mail, Fastmail and other IMAP mailboxes together. Search connected email, including semantic search; cached or indexed results may be incomplete or stale. Read messages and attachments, create drafts, send or reply when requested, and manage rules for new mail. Separate permissions control reading, attachments, drafts, sending and mailbox changes.
Connect any IMAP/SMTP mailbox to Claude & ChatGPT: search, read, sort, draft. Sends only with OK.
Related MCP Servers
- AlicenseBqualityDmaintenanceUniversal email integration for AI assistants, supporting any IMAP provider with 18 tools for reading, sending, managing, and automating emails.28MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to send, read, search, and manage emails directly through structured IMAP/SMTP tools, without UI automation.-
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to search, read, send, reply, forward, organize, and bulk-delete emails across multiple IMAP and SMTP mailboxes with AES-256-encrypted credential storage and connection pooling. Supports 15+ pre-configured providers including Gmail, Outlook, Yahoo, and iCloud through a web-based setup wizard.931 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to read, search, send, manage, schedule, and analyze email across multiple IMAP/SMTP accounts, with OAuth2, drafts, labels, real-time IDLE watching, and calendar extraction.31 npmISC