ImapCAUTION
IMAP Model Context Protocol server for interactive email processing
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
A Model Context Protocol (MCP) server that enables AI assistants to check email, process messages, and learn user preferences through interaction.
Overview
This project implements an MCP server that interfaces with IMAP email servers to provide the following capabilities:
- Email browsing and searching
- Email organization (moving, tagging, marking)
- Email composition and replies
- Interactive email processing and learning user preferences
- Automated email summarization and categorization
- Support for multiple IMAP providers
The IMAP MCP server is designed to work with Claude or any other MCP-compatible assistant, allowing them to act as intelligent email assistants that learn your preferences over time.
Features
- Email Authentication: Secure access to IMAP servers with various authentication methods
- Email Browsing: List folders and messages with filtering options
- Email Content: Read message contents including text, HTML, and attachments
- Email Actions: Move, delete, mark as read/unread, flag messages
- Email Composition: Draft and save replies to messages with proper formatting
- Support for plain text and HTML replies
- Reply-all functionality with CC support
- Proper threading with In-Reply-To and References headers
- Save drafts to appropriate folders
- Search: Basic search capabilities across folders
- Interaction Patterns: Structured patterns for processing emails and learning preferences (planned)
- Learning Layer: Record and analyze user decisions to predict future actions (planned)
Current Project Structure
The project is currently organized as follows:
. ├── examples/ # Example configurations │ └── config.yaml.example ├── imap_mcp/ # Source code │ ├── __init__.py │ ├── config.py # Configuration handling │ ├── imap_client.py # IMAP client implementation │ ├── models.py # Data models │ ├── resources.py
edff266c7580OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add imap-mcp --env GMAIL_APP_PASSWORD=${GMAIL_APP_PASSWORD} --env GMAIL_CLIENT_SECRET=${GMAIL_CLIENT_SECRET} --env GMAIL_REFRESH_TOKEN=${GMAIL_REFRESH_TOKEN} --env IMAP_PASSWORD=${IMAP_PASSWORD} -- uvx imap-mcp{
"mcpServers": {
"imap-mcp": {
"command": "uvx",
"args": [
"imap-mcp"
],
"env": {
"GMAIL_APP_PASSWORD": "${GMAIL_APP_PASSWORD}",
"GMAIL_CLIENT_SECRET": "${GMAIL_CLIENT_SECRET}",
"GMAIL_REFRESH_TOKEN": "${GMAIL_REFRESH_TOKEN}",
"IMAP_PASSWORD": "${IMAP_PASSWORD}"
}
}
}
}Exposed tools (16)
12 read · 3 write · 1 destructive. Blast radius: 1 tool can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.
| Tool | Risk | Description |
|---|---|---|
check_calendar_availability_tool | read | Checks calendar availability for a given time slot. |
create_task | write | Creates a new task and saves it to a local file. |
delete_email | destructive | Delete email. |
draft_meeting_reply_tool | read | Drafts a meeting reply (accept/decline) based on calendar invite details and availability. |
draft_reply_tool | read | Creates a draft reply to an email and saves it to the drafts folder. |
email_search | read | Search for emails using a query string. |
flag_email | read | Flag or unflag email. |
identify_meeting_invite_tool | read | Identifies if an email is a meeting invite and extracts relevant details. |
mark_as_read | read | Mark email as read. |
mark_as_unread | read | Mark email as unread. |
move_email | write | Move email to another folder. |
process_email | read | Process an email with specified action. |
process_invite_email_tool | read | Processes a meeting invitation email: identifies invite, checks availability, drafts reply, saves draft. |
process_meeting_invite | write | Process a meeting invite email and create a draft reply. |
search_emails | read | Search for emails. |
server_status | read | Get server status and configuration info. |
Trust audit
CAUTIONgrade B · trust 86/100 Install with care. The audit found things worth knowing before you trust its output.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | WARN |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | WARN |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (2 observation(s))
- Network
- declared (5 observation(s))
- Shell
- declared (1 observation(s))
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (7)
print(f" IMAP_PASSWORD={password}")Path("/etc/imap-mcp/config.yaml"),delete_email
.windsurfrules
Integration tests verify that the IMAP MCP server works correctly with real email services. These tests require valid credentials and network connectivity to external services.
curl -LsSf https://astral.sh/uv/install.sh | sh
Gates applied: no_behavioural_pass, no_license.
edff266c7580full audit observations/trust-audit/mcp-server/non-dirty__imap.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | edff266c7580 | CAUTION | B | 86 | first audit |
Questions
What is the Imap MCP server?
IMAP Model Context Protocol server for interactive email processing
What tools does Imap expose?
16 in total: 12 read-only, 3 that write, and 1 that can delete or overwrite (delete_email). Every one is listed on this page with its risk.
Is Imap safe to connect to an agent?
With care. The audit graded it B (86/100) and found 7 things worth knowing before you trust this server, listed below with the exact line each was found on. Separately from the audit: 1 of its tools can destroy data, so scope the token you give it to what you actually need.
What credentials does Imap need?
It reads GMAIL_APP_PASSWORD, GMAIL_CLIENT_SECRET, GMAIL_REFRESH_TOKEN and IMAP_PASSWORD from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How current is this page?
The grade is for one exact copy of the source (edff266c7580), read on 2026-10-08. The repository is watched and re-audited when it changes.