pip install mailcode

Control AI Agents
Via Email

Turn your email inbox into a remote control for AI coding agents. MailCode bridges OpenCode and Claude Code — send tasks, receive results, and inject commands, all through any email account. Zero third-party dependencies.

Why MailCode

Built for developers who need to stay in control of their AI agents, from anywhere.

Scheduled Tasks

Cron-based email scheduling for recurring automation — nightly backups, daily reports, automated code reviews.

0 9 * * * Run daily code review
🔔

Webhook Notifications

Slack, Discord, Feishu, DingTalk, WeCom, Bark (iOS) — choose your channel. Custom webhooks supported.

6 platforms + custom webhooks
💻

TUI Management

Full terminal UI (Textual) with 8 screens: dashboard, sessions, scheduler, channels, config, health, logs, license.

Terminal UI · Real-time monitoring
🛡️

Multi-Layer Security

DKIM/SPF authentication, sender whitelist, command blacklist, 128-bit session keys, auto-expiring sessions.

Enterprise-grade protection

Dual Mode

Reply Mode for active sessions + Cold Start to launch agents remotely. Covers every scenario.

Reply · Cold Start
🌐

Any Email Provider

Gmail, Outlook, QQMail, 126Mail — IMAP IDLE long connection for instant command delivery.

Gmail · Outlook · QQMail · 126Mail

How It Works

MailCode creates a simple bridge between your email inbox and AI agents running in tmux.

✉️

Send an Email

A coding task or command, sent from any email client — phone, tablet, or laptop.

📡

IMAP Listener

MailCode polls your inbox in real time via IMAP IDLE, detecting new messages instantly.

tmux Injection

Commands are injected into your running AI agent's tmux session via send-keys.

📬

Get Notified

Task completes? You receive an email or webhook notification. Reply to continue the loop.

Two Ways to Use It

Whether your AI agent is already running or not, MailCode has you covered.

Reply Mode

Agent Already Running

The bridge plugin detects idle state and sends you an email notification with a unique token. Simply reply with your next instruction — the token routes your command to the right session.

Your email reply: #A3B7KM9Q Continue optimizing the parse_config function
Cold Start Mode

No Agent Running

Send a new email with your session key and task description. MailCode creates a new tmux session, launches the agent, and injects your command. You receive a confirmation with the new token.

Your email (new message): key: a1b2c3d4e5f67890 project: /path/to/your-project Refactor helper.py's parse_config function

Works With Any Email Provider

Configure SMTP and IMAP for your preferred email service.

Real Scenarios

Developers use MailCode to stay connected to their codebase no matter where they are.

🚀

Mobile Development

Send emails from your phone to trigger AI coding tasks while commuting or away from your desk. Review results and iterate — all from your pocket.

🔄

Scheduled Automation

Configure cron-like email triggers for nightly backups, dependency updates, or automated refactoring — without keeping a laptop open.

🔗

Remote Collaboration

Production issue while traveling? Send an email with the hotfix command. MailCode cold-starts your agent, applies the patch, and confirms the result.

Simple, Transparent Pricing

Start free. Upgrade when you need more power.

Basic

$0
Free forever
  • IMAP relay (polling + IDLE)
  • Reply & Cold Start modes
  • Dual agent support
  • Email notifications
  • Command security suite
  • Scheduled tasks
  • Webhook notifications
  • TUI interface
  • Priority support
Get Started
Recommended

Pro

$4.99 / month
Everything in Basic, plus:
  • Scheduled tasks (cron)
  • Webhook notifications (10 sources)
  • TUI management interface
  • Up to 3 email accounts
  • Session analytics
  • Priority email support
  • Unlimited team members
Upgrade to Pro

Enterprise

Contact
Custom pricing
  • Everything in Pro
  • Unlimited email accounts
  • Unlimited webhook sources
  • RBAC & SSO
  • On-premise deployment
  • Dedicated support
  • Custom integrations
Contact Us

Install in One Command

Requires Python 3.9+, tmux, and an AI agent CLI. Choose your platform.

pip install mailcode
mailcode serve --idle

After installation, run mailcode config init to configure your email credentials, then start the relay with mailcode serve --idle.

apt update && apt install python3 tmux -y
pip install mailcode
mailcode serve --idle

After installation, run mailcode config init to configure your email credentials, then start the relay with mailcode serve --idle.

dnf install python3 tmux -y
pip install mailcode
mailcode serve --idle

After installation, run mailcode config init to configure your email credentials, then start the relay with mailcode serve --idle.

pacman -S python tmux --noconfirm
pip install mailcode
mailcode serve --idle

After installation, run mailcode config init to configure your email credentials, then start the relay with mailcode serve --idle.

Ready to Control Your AI Agent From Anywhere?

Install MailCode in one command and bridge your email to AI in minutes. Free to start, no credit card required.

MIT Licensed · Open Source · Python 3.9+