Skip to main content
Glama
sendless-mcp

sendless-mcp

by SirMacke

sendless-mcp

An IMAP MCP server where agents read mail and write drafts but can never send. You review each draft in your own mail client and send it yourself.

Linux with systemd only. Python 3.11+, standard library only.

Why

  • It can't send, by design. There is no SMTP code and no send tool. The broker runs only a fixed list of operations: no move, no raw IMAP, no general delete.

  • The password stays in a separate broker that runs under its own systemd user. The agent's process never holds it.

  • Draft revisions are safe. The old version is copied to Trash, and the copy confirmed, before it is removed.

  • Attachments come only from a locked outbox: a private 0700 folder that refuses symlinks, hard links and hidden files.

Related MCP server: imap-mcp

How it works

agent ── stdio ──> MCP client ── Unix socket ──> broker ── TLS ──> IMAP server
                   agent's user,                 own uid,
                   no password                   holds the password

The client relays calls and reads attachments from the outbox. The broker checks every request against its allowlist before it logs in.

Quick start

You need root on the Linux machine where the agent runs, and an IMAP server with UIDPLUS and SPECIAL-USE folders (most hosted providers have both). Prefer an app password that can use IMAP but not SMTP. Replace work with your mailbox key and agent with the agent's user.

# 1. Install root-owned, so the agent can't change the code that holds the password.
git clone --branch v1.6.0 https://github.com/SirMacke/sendless-mcp.git
cd sendless-mcp
sudo python3 -m venv /opt/sendless-mcp
sudo /opt/sendless-mcp/bin/pip install .

# 2. Write the config (no secrets): set address and imap_host (username is
#    optional); delete the example reply_aliases line and [mailboxes.personal] table.
sudo install -d -m 0755 /etc/sendless-mcp
sudo install -m 0644 examples/config.toml /etc/sendless-mcp/config.toml
sudoedit /etc/sendless-mcp/config.toml

# 3. Store the password, alone on one line, in a root-only file.
sudo install -d -m 0700 /etc/sendless-mcp/work
sudo sh -c 'umask 077; cat > /etc/sendless-mcp/work/imap-password'   # paste, Enter, Ctrl-D

# 4. Install the systemd units and let the agent's user connect.
sudo install -m 0644 examples/systemd/sendless-mcp@.socket examples/systemd/sendless-mcp@.service /etc/systemd/system/
sudo groupadd --system sendless-mcp
sudo usermod -aG sendless-mcp agent        # takes effect at the agent's next login
sudo systemctl daemon-reload
sudo systemctl enable --now sendless-mcp@work.socket

# 5. As the agent's user: create the outbox and check the config.
install -d -m 0700 ~/mail-outbox
/opt/sendless-mcp/bin/sendless-mcp work --check

# 6. Register it with Claude Code, then ask a new session to list the inbox.
claude mcp add --scope user work-mail -- /opt/sendless-mcp/bin/sendless-mcp work

Before you trust it with real mail, save and revise one test draft. Check in your mail client that it has the right From address and that the old version is in Trash. For Codex, .mcp.json and more mailboxes, see Configuration.

Tools

Tool

What it does

list_inbox

Lists recent Inbox headers without marking them read.

read_message

Reads one Inbox, Sent or Drafts message (text body only).

search_sent

Searches Sent by recipient, text, Message-ID or thread.

search_drafts

Searches Drafts by recipient, Message-ID or thread.

save_draft

Saves a new plain-text draft, optionally a reply with attachments.

update_draft

Replaces a draft; the old version goes to Trash.

set_read

Sets or clears \Seen.

set_junk

Sets or clears $Junk without moving the message.

Arguments, message references and result codes are in docs/tools.md.

Learn more

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI clients to search and read IMAP email, extract bounded attachments, and prepare and safely send SMTP messages with local previews and confirmation. It also generates client configurations and optional background-service files while keeping credentials on the host.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables an AI agent to search and read a single IMAP mailbox through a local, read-only index and write Markdown drafts without ever sending mail.
      31 PyPI
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to search and read IMAP messages across accounts and create new messages, replies, or forwards as drafts, without sending, moving, or deleting mail.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to read and search IMAP mailboxes, inspect sanitized messages, create drafts, and request sending or forwarding email only after explicit user approval.
      1
      MIT