Mailctx
БесплатноНе проверен📬 Give your AI agent your inbox. Provider-agnostic IMAP → clean, token-cheap Markdown (60–98% fewer tokens), plus an MCP server so Claude Desktop can search, r
Описание
📬 Give your AI agent your inbox. Provider-agnostic IMAP → clean, token-cheap Markdown (60–98% fewer tokens), plus an MCP server so Claude Desktop can search, read and draft your mail. Reads and drafts — never sends.
README
Give your agent your inbox — clean, token-cheap Markdown from any IMAP account, plus an MCP server so Claude Desktop can read and draft your mail.
LLMs drown in the <style> tags, deeply nested quotes, and tracking pixels of raw email. mailctx is a provider-agnostic IMAP engine that strips the garbage and emits bounded, token-optimized Markdown ready for context windows.
The Token Economy (Actual mailctx demo output)
mailctx Token Economy Demo
┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ File ┃ Orig Size ┃ Clean Size ┃ Tokens (est.) ┃ Reduction ┃
┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ ugly_html.eml │ 1208 c │ 151 c │ ~37 t │ -88% │
│ with_attachment.eml │ 761 c │ 33 c │ ~8 t │ -96% │
│ rich_html.eml │ 2065 c │ 567 c │ ~141 t │ -73% │
│ quoted_thread.eml │ 519 c │ 76 c │ ~19 t │ -85% │
│ tracking.eml │ 659 c │ 17 c │ ~4 t │ -97% │
│ umlaut.eml │ 445 c │ 153 c │ ~38 t │ -66% │
│ plain_text.eml │ 346 c │ 143 c │ ~35 t │ -59% │
│ long_thread.eml │ 1398 c │ 28 c │ ~7 t │ -98% │
└─────────────────────┴───────────┴────────────┴───────────────┴───────────┘
(Run mailctx demo to see this exact output on the bundled corpus.)
Quickstart
# 1. Install (with MCP support)
pip install "mailctx[mcp]"
# 2. See the token savings on bundled samples
mailctx demo
# 3. Connect your inbox
mailctx init
The Missing IMAP MCP Server for Claude Desktop
Connect mailctx via the Model Context Protocol (MCP) and your agent can answer "what did I miss this week?", "find the invoice from Flixbus", or "draft a reply to my landlord".
Safety Boundary: By design, mailctx can read mail and it can draft replies (appending to your Drafts folder). It can never send mail or delete mail. You always retain final send authority in your standard email client. For an agent touching your inbox, this constraint is the feature.
Add this snippet to your claude_desktop_config.json (or run mailctx mcp --print-config):
{
"mcpServers": {
"mailctx": {
"command": "mailctx",
"args": ["mcp"],
"env": {
"PATH": "/usr/local/bin:/usr/bin:/bin"
}
}
}
}
Why not just use...
| mailctx | roll your own imaplib |
himalaya | mail2md scripts | |
|---|---|---|---|---|
| Token-optimized output for LLMs | ✅ 85–97% reduction | ❌ | ❌ | partly |
| MCP server included | ✅ | ❌ | ❌ | ❌ |
| Survives VPN/travel disconnects | ✅ typed retry | ❌ | partly | ❌ |
| Multi-account isolation | ✅ | ❌ | ✅ | ❌ |
| Cannot send (safety boundary) | ✅ by design | — | ❌ sends | — |
Note: If you want a full terminal email client to read your own mail, use himalaya. If you need total control over raw MIME parts for a non-LLM pipeline, rolling your own imaplib wrapper might be better. mailctx is purpose-built for AI agents.
Built for Reality
Agents break when connections drop. mailctx is engineered to survive production:
- Typed transient-vs-auth error handling: Born from real Gmail EOF drops on travel WLAN/VPNs. Uses 3-retry backoff with a fresh connection each attempt.
- Per-account isolation: One broken account (e.g., expired app password) never blocks the others.
- Watermark integrity: The read pointer (
mailctx stream) advances only on success, so mail is never silently skipped during processing failures. - Autodraft safety model: Dry-run by default (requires
--write), capped per run, idempotent, every draft explicitly marked, and structurally incapable of sending.
See it in Action
(To regenerate the demo recording locally, run scripts/record_demo.sh)
Development
Run mailctx doctor to verify your environment. For contribution guidelines and "good first issues", see CONTRIBUTING.md.
License
MIT
Установить Mailctx в Claude Desktop, Claude Code, Cursor
unyly install mailctxСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add mailctx -- uvx --from git+https://github.com/hannokuegler/mailctx mailctxПошаговые гайды: как установить Mailctx
FAQ
Mailctx MCP бесплатный?
Да, Mailctx MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Mailctx?
Нет, Mailctx работает без API-ключей и переменных окружения.
Mailctx — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Mailctx в Claude Desktop, Claude Code или Cursor?
Открой Mailctx на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Gmail
Read, send and search emails from Claude
автор: GoogleSlack
Send, search and summarize Slack messages
автор: SlackRunbear
No-code MCP client for team chat platforms, such as Slack, Microsoft Teams, and Discord.
Discord Server
A community discord server dedicated to MCP by [Frank Fiegel](https://github.com/punkpeye)
Klavis AI
Open Source MCP Infra. Hosted MCP servers and MCP clients on Slack and Discord.
Work90210/APIFold
Turn any REST API into a hosted MCP server. 18 free public servers (GitHub, Stripe, Slack, OpenAI, Notion, and more) — no setup required, bring your own API key
автор: Work90210arikusi/deepseek-mcp-server
MCP server for DeepSeek AI with chat, reasoning, multi-turn sessions, function calling, thinking mode, and cost tracking.
автор: arikusihashgraph-online/hashnet-mcp-js
MCP server for the Registry Broker. Discover, register, and chat with AI agents on the Hashgraph network.
автор: hashgraph-onlineprofullstack/mcp-server
A comprehensive MCP server aggregating 20+ tools including SEO optimization, document conversion, domain lookup, email validation, QR generation, weather data,
автор: profullstackWayStation-ai/mcp
Seamlessly and securely connect Claude Desktop and other MCP hosts to your favorite apps (Notion, Slack, Monday, Airtable, etc.). Takes less than 90 secs.
автор: waystation-aiCompare Mailctx with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории communication
