Skip to main content

Composite mail driver for the Model Context Standard -- read, organise, and send e-mail.

Project description

mcs-driver-mail

Composite mail driver for the Model Context Standard (MCS).

Combines mcs-driver-mailread and mcs-driver-mailsend into a single driver that exposes all 9 tools (7 read + 2 send). This demonstrates the MCS driver stacking / composition pattern -- build focused drivers, then combine them.

Installation

pip install mcs-driver-mail

# With IMAP + SMTP adapters
pip install mcs-driver-mail[imap,smtp]

# Everything including inspector
pip install mcs-driver-mail[all]

Quick start

from mcs.driver.mail import MailToolDriver

td = MailToolDriver(
    read_adapter="imap",
    send_adapter="smtp",
    read_kwargs=dict(host="imap.example.com", user="alice@example.com", password="..."),
    send_kwargs=dict(host="smtp.example.com", user="alice@example.com", password="...",
                     sender_name="Alice Smith"),
)

tools = td.list_tools()       # 9 tools (7 read + 2 send)
td.execute_tool("list_folders", {})
td.execute_tool("send_message", {"to": "bob@example.com", "subject": "Hi", "body": "Hello"})

Tools

Tool Source Description
list_folders mailread List all mailbox folders
list_messages mailread List message summaries in a folder
fetch_message mailread Fetch a full message by UID
search_messages mailread Search messages by criteria
move_message mailread Move a message to another folder
set_flags mailread Add or remove flags on a message
create_folder mailread Create a new mailbox folder
send_message mailsend Send a plain-text e-mail
send_html_message mailsend Send an HTML e-mail with text fallback

Architecture

mcs-driver-mail (composite)
  ├── mcs-driver-mailread  ←  mcs-adapter-imap (or Gmail, Graph, ...)
  └── mcs-driver-mailsend  ←  mcs-adapter-smtp (or Gmail, Graph, ...)

Each sub-driver is protocol-agnostic -- swap adapters without changing driver code.

Links

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcs_driver_mail-0.1.3.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcs_driver_mail-0.1.3-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file mcs_driver_mail-0.1.3.tar.gz.

File metadata

  • Download URL: mcs_driver_mail-0.1.3.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for mcs_driver_mail-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8b36920ecea5ca576582ef904fa235dc2bb32d8f19504be30876303287d454a8
MD5 a43289ac7cf56f36eed31bb67a584237
BLAKE2b-256 9a8e849874ed03b8f9e95cc34eda21de6355ad077944e2c0231704924dbe0595

See more details on using hashes here.

File details

Details for the file mcs_driver_mail-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for mcs_driver_mail-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ddb3def0e117b68e7c4cb1e342bc70b4a273947a84aca5b2649aaa172d11650e
MD5 066eee839b20d87d4960f9e00368fd39
BLAKE2b-256 3a1009b223a133452c7202fce6683ceac7ebaf3bf9d13bc3d2a9b8f0ee28c6b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page