The first tagged release. Version 2 reflects a major overhaul: MailGrab went from a single-threaded scraper to a concurrent, robots.txt-aware crawler with a new MCP server, structured output formats, and dozens of correctness/robustness fixes — all covered by a 43-test suite.
Highlights
New: MCP server for AI coding agents
mailgrab_mcp_server.py exposes MailGrab as a crawl_website tool over the Model Context Protocol, so Claude Code, Claude Desktop, Cursor, GitHub Copilot (VS Code and CLI), and Codex CLI can crawl a site and harvest emails directly instead of shelling out to the CLI by hand. Each call runs in an isolated subprocess/temp directory so concurrent tool calls can't corrupt the agent's stdio stream or clobber each other's output. See the wiki's MCP Server page for setup instructions per client.
Performance & concurrency
- Concurrent fetching via
ThreadPoolExecutor(--concurrency/MAILGRAB_MAX_WORKERS) - Shared
requests.Session()with connection pooling and per-request timeouts (--timeout) - Configurable, per-domain rate limiting (
--delay) that also respectsrobots.txt'sCrawl-delay
Crawl correctness
--same-domainscoping androbots.txtcompliance (--ignore-robotsto opt out)mailto:parsing as a direct email source;tel:/javascript:/anchor-only links skipped before fetching- De-obfuscation:
name [at] domain [dot] com-style text and Cloudflare'sdata-cfemailspans - Real per-seed hop-limiting (
--max-hops), independent of the total-page--depthcap - Sitemap-seeded discovery (
--use-sitemap), including one level of<sitemapindex>resolution
Output
_emails.csvand_results.json(structured, with per-email source URLs and social/contact links) alongside the classic_emails.txt/_scrappedUrls.txtfiles--append/--resumeto build on a previous run instead of starting over--quietfor a single JSON summary line, suitable for piping into other tools
Email quality
- Case-insensitive dedup, placeholder-address filtering, and opt-in MX-record validation (
--verify-mx)
Robustness
- Custom
--user-agent, proxy support (--proxy, including SOCKS), 5xx retry with backoff - Startup validation for
--proxy/--depthwith clear, non-zero-exit failures - Two catastrophic-backtracking (ReDoS) regexes found and fixed during adversarial testing
Documentation
- Full GitHub Wiki rewrite: every feature, flag, and environment variable explained, plus an MCP Server setup guide verified against each client's current docs
- README overhaul; dead documentation image links replaced
Testing
43 tests total: test_mailgrab.py (35, end-to-end against a local mock HTTP server) and test_mailgrab_mcp.py (8, driving the real MCP server through the official MCP client SDK).
For the complete, itemized rundown — including accepted edge cases and known limitations — see TODO.md and CLAUDE.md.