Skip to main content
Glama
metu-webmail-mcp

metu-webmail-mcp

by atesahmet0

METU Webmail MCP Server ๐Ÿ“จ

A Model Context Protocol (MCP) server for Middle East Technical University (METU / ODTรœ) Webmail (https://webmail.metu.edu.tr).

Connect your AI assistants (Claude Desktop, Cursor, Antigravity, OpenCode, etc.) to your METU email account to list, search, read, send, reply to, flag, and organize emails securely using METU's official IMAP and SMTP servers.


โœจ Features

  • ๐Ÿ“ฅ Inbox & Folder Management: List all mailboxes (INBOX, Sent, Drafts, Trash, custom folders) and check unread message counts.

  • ๐Ÿ” Advanced Email Search: Filter messages by keyword query, sender, recipient, subject, date ranges (SINCE, BEFORE), and read/flagged status.

  • ๐Ÿ“– Clean Content Reading: Robust RFC2047 decoding for Turkish characters (UTF-8, ISO-8859-9, windows-1254), automatic HTML to clean Markdown conversion, and message threading metadata.

  • ๐Ÿ“Ž Attachment Support: Inspect attachment metadata and download/extract file attachments.

  • โœ‰๏ธ Send, Reply & Forward: Send new emails via SMTP (with automatic save to Sent), reply with automatic threading headers (In-Reply-To, References, Re: prefix), and forward messages.

  • ๐Ÿท๏ธ Flag & Organize: Mark emails as read/unread or starred/flagged, and move or delete messages.

  • ๐Ÿš€ Dual Transport: Supports standard MCP stdio mode and sse HTTP streaming mode.


Related MCP server: Mail MCP Server

๐Ÿ› ๏ธ Installation & Setup

Prerequisites

  • Python 3.11+

  • uv (recommended) or pip

1. Clone & Install Dependencies

cd /Users/ates/Documents/projects/metu-webmail-mcp
uv sync

2. Configure Credentials

Create a .env file in the project root:

METU_USERNAME=e123456@metu.edu.tr
METU_PASSWORD=your_metu_password

# Optional configurations (defaults shown)
METU_IMAP_SERVER=imap.metu.edu.tr
METU_IMAP_PORT=993
METU_SMTP_SERVER=smtp.metu.edu.tr
METU_SMTP_PORT=587

Note: Both METU_USERNAME / METU_PASSWORD and SAIS_USERNAME / SAIS_PASSWORD are automatically supported.


๐Ÿค– MCP Client Configuration

Claude Desktop / Antigravity / Cursor

Add the following to your MCP client configuration (claude_desktop_config.json or equivalent):

{
  "mcpServers": {
    "metu-webmail": {
      "command": "uv",
      "args": [
        "--directory",
        "/Users/ates/Documents/projects/metu-webmail-mcp",
        "run",
        "metu-webmail-mcp"
      ],
      "env": {
        "METU_USERNAME": "e123456@metu.edu.tr",
        "METU_PASSWORD": "your_password"
      }
    }
  }
}

๐Ÿงฐ Available Tools

Tool

Description

get_mailbox_status

Returns overall account summary, email address, all folder metrics, and total unread count.

list_folders

Lists all mailbox folders with total and unread email counts.

list_emails

Lists recent emails from a folder (e.g. INBOX, Sent) with pagination (limit, offset) and preview snippets.

search_emails

Searches emails by text query, sender, recipient, subject, date ranges, unread only, or flagged only.

read_email

Reads full email content, decoded headers, markdown/html body, attachments list, and optionally marks as read.

get_attachment

Downloads/extracts attachment base64 content by filename or index.

send_email

Sends an email via METU SMTP with optional HTML body, CC, BCC, and file attachments.

reply_email

Replies to an existing email with automatic message threading and quoting.

forward_email

Forwards an existing email with optional comments to new recipients.

mark_email

Updates flags (read/unread, flagged/starred).

move_email

Moves an email from one folder to another.

delete_email

Moves an email to Trash or permanently deletes it.


๐Ÿงช Testing

Run unit and integration tests:

uv run pytest -v

๐Ÿ“„ License

MIT License.

Available Tools

12 tools
delete_emailC

Delete an email message.

Inputs: message_id (required), folder, permanent. Returns: result

forward_emailC

Forward an existing email to new recipient(s).

Inputs: to (required), message_id (required), folder, attachments, +1 more. Returns: Result of sending or replying to an email.

get_attachmentB

Download/extract an attachment from an email message.

Inputs: message_id (required), attachment_name_or_index (required), folder. Returns: Metadata about an email attachment.

get_mailbox_statusA

Get the overall status of your METU Webmail account.

Returns the user's email address, list of all mailbox folders (Inbox, Sent, Drafts, Trash), message counts, and the total number of unread emails.

Inputs: no named parameters. Returns: Overall status and statistics for user's METU Webmail account.

list_emailsC

List recent emails from a specific mailbox folder.

Inputs: limit, folder, offset, unread_only. Returns: result

list_foldersB

List all available email folders and mailboxes in your METU Webmail account.

Returns folder names, user-friendly labels, and total/unread message counts.

Inputs: no named parameters. Returns: result

mark_emailC

Update email flags such as marking as read/unread or starred/flagged.

Inputs: message_id (required), folder, is_read, is_flagged. Returns: result

move_emailC

Move an email from one folder to another.

Inputs: message_id (required), source_folder, target_folder. Returns: result

read_emailC

Read the full content and details of a specific email message.

Inputs: message_id (required), folder, mark_as_read. Returns: Detailed view of an email message.

reply_emailA

Reply to an existing email message.

Automatically handles 'Re:' subject prefix, In-Reply-To and References headers, recipient selection, and quoting the previous message.

Inputs: body_text (required), message_id (required), folder, body_html, +2 more. Returns: Result of sending or replying to an email.

search_emailsC

Search for emails matching specific criteria.

Inputs: limit, query, folder, sender, +6 more. Returns: result

send_emailB

Send a new email using your METU Webmail account.

Inputs: to (required), subject (required), body_text (required), cc, +4 more. Returns: Result of sending or replying to an email.

Tool Schema Changelog

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

Loading tool schema changelogโ€ฆ

    TDQS

    B3.4/5.0

    Scored across 12 tools

    Disambiguation4/5

    Each tool maps to a distinct email action (move, delete, read, send, reply, forward, search, mark, attachment). The only mild overlap is between list_folders and get_mailbox_status, which both return folder names and message counts, though their descriptions are slightly differentiated.

    Naming Consistency5/5

    All 12 tools follow a clean, consistent verb_noun snake_case pattern (list_emails, send_email, move_email, mark_email, etc.). No deviations in style or casing.

    Tool Count5/5

    12 tools is a well-scoped set for an email client, covering the core read/compose/organize workflow without redundancy or filler.

    Completeness4/5

    Strong lifecycle coverage: list, search, read, send, reply, forward, move, delete, flag, and attachments. Minor gaps exist (e.g., no create_folder/rename folder or draft-save operation), but core email workflows are fully supported.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to interact with email accounts via IMAP and SMTP, supporting mailbox listing, email search, retrieval, sending, and management.
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to send, read, and manage emails via SMTP and IMAP, with support for attachments, threads, and mailbox organization.
      16
      81 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to read, send, organize, and search emails across multiple IMAP/SMTP mailboxes.
      756 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to securely manage multiple email accounts via IMAP and SMTP, including searching, reading, sending, replying, forwarding, organizing folders, marking, and bulk deleting messages.
      1,044 npm
      MIT