Mail (mail.ru) mcp server with IMAP,SMTP, WEBDAV, CALDAV
Python MCP server for IMAP/SMTP email, WebDAV, and CalDAV for mail.ru services
Package Run
Publish the package to PyPI as mcp-email-webdav-caldav, then run it without cloning this repository:
Get external app password here (choose all protocols) https://account.mail.ru/user/2-step-auth/passwords
Update package
uv tool upgrade mcp-email-webdav-caldav
For Claude:
claude-glm-5 mcp add --scope user mail-webdav-caldav \
--env 'MCP_SERVER_FULL_NAME=Иван Иванов' \
--env MCP_SERVER_EMAIL_ADDRESS=ivan@inbox.ru \
--env MCP_SERVER_PASSWORD=token \
-- uvx mcp-email-webdav-caldav
For Codex:
[mcp_servers.mail-webdav-python]
command = "uvx"
args = ["mcp-email-webdav-caldav"]
enabled = true
[mcp_servers.mail-webdav-python.env]
MCP_SERVER_FULL_NAME = "Jane Doe"
MCP_SERVER_EMAIL_ADDRESS = "jane@example.com"
MCP_SERVER_PASSWORD = "app_password_here"
Equivalent one-off run:
uvx mcp-email-webdav-caldav
Or install the package once and run the console script:
pipx install mcp-email-webdav-caldav
Then Codex can use:
command = "mcp-email-webdav-caldav"
args = []
Ready-made examples:
Build And Publish
Build source and wheel distributions:
uv build
Publish to PyPI:
uv publish
Runtime Environment Variables
Required:
MCP_SERVER_FULL_NAMEMCP_SERVER_EMAIL_ADDRESSMCP_SERVER_PASSWORD
MCP_SERVER_EMAIL_ADDRESS and MCP_SERVER_PASSWORD are reused as credentials for Email, WebDAV, and CalDAV.
Service Constants
Provider-specific settings live in src/mcp_email_webdav_caldav/constants.py:
- Email IMAP/SMTP host, port, SSL, sent-folder, and attachment-download settings.
- WebDAV account name, base URL, description, download, and upload settings.
- CalDAV account name, base URL, well-known discovery, and write settings.
CalDAV uses /.well-known/caldav discovery by default. The client follows redirects, reads current-user-principal, then reads calendar-home-set and performs calendar/event operations relative to that discovered calendar-home URL.
TLS certificate verification is always disabled; connections use an unverified SSL context.
Accounts are configured entirely through the MCP_SERVER_* environment variables together with constants.py — one account each for Email, WebDAV, and CalDAV. There is no on-disk config file.
Tools
Email:
list_available_accountslist_mailboxeslist_emails_metadataget_emails_contentsend_emaildelete_emailsdownload_attachment
WebDAV:
list_webdav_accountswebdav_listwebdav_get_textwebdav_download_filewebdav_put_textwebdav_upload_filewebdav_mkdirwebdav_deletewebdav_movewebdav_copy
CalDAV:
list_caldav_accountscaldav_list_calendarscaldav_list_eventscaldav_check_availabilitycaldav_get_eventcaldav_put_eventcaldav_create_eventcaldav_delete_event
list_emails_metadata returns mailbox together with each email_id; pass the same mailbox to get_emails_content, delete_emails, and download_attachment. Set all_mailboxes=true to search every selectable IMAP folder.
webdav_download_file and webdav_upload_file are disabled by default because they read/write local files. Enable them explicitly in constants.py.
Sent email is uploaded to IMAP after SMTP send when EMAIL_SAVE_TO_SENT is enabled. Leave EMAIL_SENT_FOLDER_NAME empty to auto-detect the IMAP mailbox with the \Sent flag, which is the right mode for localized folders such as Mail.ru Отправленные. The send_email response includes sent_copy with the mailbox used for the saved copy.
caldav_put_event, caldav_create_event, and caldav_delete_event are disabled by default because they modify remote calendars. Enable them explicitly in constants.py.
caldav_create_event accepts attendees as attendees = ["Name <user@example.com>", "other@example.com"]. The participants field is accepted as an alias. The server writes standard ORGANIZER / ATTENDEE iCalendar fields. Use caldav_check_availability before creating a meeting to check whether the selected calendar has busy items in the requested time range.
Test
PYTHONPATH=src python3 -m unittest discover -s tests
Metadata
Release files for mcp-email-webdav-caldav 0.2.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mcp_email_webdav_caldav-0.2.14.tar.gz | 27.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_email_webdav_caldav-0.2.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 51.5 kB
Release files / mcp_email_webdav_caldav-0.2.14.tar.gz
| Download URL | mcp_email_webdav_caldav-0.2.14.tar.gz |
|---|---|
| Size | 27.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1fe4684184c8e663092d80cd5dff4d8c01b41df522d3e08a156f89774e1be1f1
|
|
BLAKE2b-256 checksum How to use checksums |
89ef373b7884d2fdc0c11d0feadcfc7d2a645bafe697ee9bb37f5924862c8c8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / mcp_email_webdav_caldav-0.2.14-py3-none-any.whl
| Download URL | mcp_email_webdav_caldav-0.2.14-py3-none-any.whl |
|---|---|
| Size | 23.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
36f675782d495890f5276578458047dea5c0e832bb788e145ae0aff404abb381
|
|
BLAKE2b-256 checksum How to use checksums |
5db0c5a2ded732201c3570fa772d815e1a162e3b9a3bc2d0263bfce6b9145104
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|