Skip to main content
Glama
itu-mail-mcp

itu-mail-mcp

by alperkz

itu-mail-mcp

A small MCP server that lets Claude (or any MCP client) read and organise my İTÜ mail.

I wrote it because I wanted to ask Claude things like "anything new from my instructors this week?" without copy-pasting from webmail. It talks plain IMAP to imap.itu.edu.tr, so it should work for any İTÜ account.

What it can do

  • mail_status: login check and INBOX counts

  • list_folders, list_messages, search_messages: browse and search (Turkish text works)

  • get_message: read a message as text, with its attachment list. Doesn't mark it as read.

  • download_attachment: saves to ~/.itu_mail_state/attachments/<uid>/

  • create_folder, move_message, rename_folder, delete_folder, flag_message: organise mail

  • mark_as_read, save_draft: only when ITU_MAIL_ENABLE_WRITE=1 is set

Related MCP server: InboxTether MCP

Security

  • The host is hardcoded (imap.itu.edu.tr:993, TLS), so your password can't be sent anywhere else.

  • The password lives in the macOS Keychain, not in a config file. ITU_MAIL_PASSWORD works as a fallback, but then it sits in plain text in your MCP config.

  • There is no send tool. save_draft puts a draft in Drafts and you send it yourself from webmail.

  • delete_folder only deletes empty folders. INBOX and system folders (Sent, Drafts, Trash, Junk) can't be renamed or deleted.

  • Attachments are always saved under the state dir with 0600 permissions; file names from the mail can't escape that folder.

  • The server tells the model to treat mail content as untrusted and not to follow instructions inside e-mails.

Setup

macOS, Python 3.10+.

pip install --user -e .
security add-generic-password -s itu-mail-mcp -a <your-itu-username> -w
claude mcp add itu-mail -s user -e ITU_MAIL_USERNAME=<your-itu-username> -- itu-mail-mcp

The second command asks for your İTÜ password and stores it in the Keychain. If itu-mail-mcp isn't on your PATH, use the full path (e.g. ~/Library/Python/3.11/bin/itu-mail-mcp).

Extra: mail-sorter

examples/mail-sorter uses the same IMAP client to move mail into folders by simple rules, either once or continuously with IMAP IDLE.

Tests

The tests use a fake IMAP connection, so they don't need an account or network.

PYTHONPATH=src python3 -m pytest -q tests

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
      A
      quality
      A
      maintenance
      Enables MCP clients to read, search, organise, and manage IMAP mailbox messages, including saving attachments and drafting replies, while treating mail content as untrusted and keeping write capabilities opt-in.
      6
      496 npm
      4
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients and AI assistants to search and read email through read-only IMAP access, including bounded message reads and explicitly selected attachment retrieval.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to work with ordinary email accounts over IMAP and SMTP — listing mailboxes, searching and reading messages, managing flags, folders, attachments and drafts, and sending, replying or forwarding mail. Supports multiple accounts and providers with per-account safety controls such as read-only mode, send/delete restrictions, recipient allow-lists and rate limits.
      25 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to access and manage email over IMAP, POP3, and SMTP, including listing, searching, reading, sending, downloading attachments, and managing flags, moves, and deletions using environment-based credentials and TLS.
      1
      MIT