metu-webmail-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@metu-webmail-mcp Check my inbox for unread emails from my advisor."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
stdiomode andsseHTTP streaming mode.
Related MCP server: Mail MCP Server
๐ ๏ธ Installation & Setup
Prerequisites
Python 3.11+
uv(recommended) orpip
1. Clone & Install Dependencies
cd /Users/ates/Documents/projects/metu-webmail-mcp
uv sync2. 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=587Note: Both
METU_USERNAME/METU_PASSWORDandSAIS_USERNAME/SAIS_PASSWORDare 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 |
| Returns overall account summary, email address, all folder metrics, and total unread count. |
| Lists all mailbox folders with total and unread email counts. |
| Lists recent emails from a folder (e.g. |
| Searches emails by text query, sender, recipient, subject, date ranges, unread only, or flagged only. |
| Reads full email content, decoded headers, markdown/html body, attachments list, and optionally marks as read. |
| Downloads/extracts attachment base64 content by filename or index. |
| Sends an email via METU SMTP with optional HTML body, CC, BCC, and file attachments. |
| Replies to an existing email with automatic message threading and quoting. |
| Forwards an existing email with optional comments to new recipients. |
| Updates flags (read/unread, flagged/starred). |
| Moves an email from one folder to another. |
| 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 toolsdelete_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
Scored across 12 tools
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.
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.
12 tools is a well-scoped set for an email client, covering the core read/compose/organize workflow without redundancy or filler.
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
Related MCP Connectors
Email for AI agents: read, search and send from your Gmail, Outlook, Yahoo, iCloud or IMAP inbox.
Connect any IMAP/SMTP mailbox to Claude & ChatGPT: search, read, sort, draft. Sends only with OK.
Search connected email, read and manage messages, draft and send, and manage rules for new mail.
Email infrastructure for AI agents โ send, receive, search, and reply to email over MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with email accounts via IMAP and SMTP, supporting mailbox listing, email search, retrieval, sending, and management.MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to send, read, and manage emails via SMTP and IMAP, with support for attachments, threads, and mailbox organization.1681 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to read, send, organize, and search emails across multiple IMAP/SMTP mailboxes.756 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables 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 npmMIT