Mailru
FreeNot checkedπ§ͺ TheNovaNodes Ecosystem: Production-grade Model Context Protocol (MCP) server for Mail.ru (IMAP, SMTP, WebDAV) in Go with Two-Phase Commit HITL.
About
π§ͺ TheNovaNodes Ecosystem: Production-grade Model Context Protocol (MCP) server for Mail.ru (IMAP, SMTP, WebDAV) in Go with Two-Phase Commit HITL.
README
π§ Mail.ru MCP Server (Go Production Edition)
A core component of TheNovaNodes Ecosystem
High-performance, stateless Model Context Protocol (MCP) gateway written in Go, enabling Agentic AI control via Mail.ru IMAP, SMTP, and WebDAV.
[](https://github.com/TheNovaNodes/mailru-mcp-server/actions/workflows/ci.yml)
π§ͺ Ecosystem Role
This repository serves as a hardened, stateless bridge between autonomous AI agents (e.g. Kairos, Trickster, Prometheus) and Mail.ru services. It strictly enforces Human-In-The-Loop (HITL) policies via an atomic Two-Phase Commit token system with sliding TTL for all mutating or outbound operations.
β CAPABILITIES MATRIX:
- Mail (IMAP / SMTP): π’ FULLY SUPPORTED (TLS on 993/465, strict 15s socket deadlines, aggregates INBOX & smart subfolders, draft generation, full body extraction, semantic thread search).
- Cloud Storage (WebDAV): π’ FULLY SUPPORTED (PROPFIND XML parsing, 15s HTTP timeout, paginated listing, allowed-roots path traversal defense, upload, create folder, delete).
- Calendar & Contacts: ποΈ NATIVELY DELEGATED TO NEXTCLOUD (
nextcloud-mcp-control/nextcloud-gateway). Mail.ru does not provide a public CalDAV server and rejects CardDAV PUT requests. Schedule and address book management are maintained via Nextcloud.
ποΈ Architecture & Highlights
- Native Go Implementation: Built with
github.com/mark3labs/mcp-go,github.com/emersion/go-imap/v2, and standard librarynet/http. - Zero Interpreter Overhead: Single self-contained static binary (
~13MB) replacing Python virtual environment. Memory drops from ~85MB to ~15MB RSS. Cold-start latency drops from ~1.2s to <10ms. - Fail-Safe Socket Timeouts: Every network call (IMAP TLS, SMTP TLS, WebDAV HTTP) enforces an explicit 15-second deadline (
MAILRU_TIMEOUT=15), eliminating deadlock hazards. - Stateless Two-Phase Commit (HITL): Destructive actions generate cryptographically secure single-use tokens stored in memory with a 3600-second TTL and automatic eviction when capacity (
MAX_PENDING_ACTIONS = 100) is reached. - Workspace Path Traversal Defense: All file downloads, uploads, and email attachments strictly validate that paths resolve inside designated operational roots (user home, CWD, system temporary directory, or customizable via
MAILRU_ALLOWED_ROOTS). - Fail-Fast Initialization: Server terminates immediately (
exit 1) during startup if essential credentials (MAILRU_USERNAME,MAILRU_APP_PASS) are missing.
π οΈ MCP Tool Registry (13 Tools)
| Tool Name | Risk / HITL | Parameters | Description |
|---|---|---|---|
execute_pending_action |
π’ Safe | token (str) |
Executes a staged action blocked by HITL. |
mail_read_inbox |
π’ Safe | limit (int), folder (str), include_smart_folders (bool) |
Fetches latest emails across INBOX and Mail.ru smart folders. |
mail_get_body |
π’ Safe | uid (str), folder (str) |
Extracts full email text and HTML content by message UID. |
mail_send_draft |
π’ Safe | to_email (str), subject (str), body (str) |
Saves an email draft for human review. |
mail_search_thread |
π’ Safe | query (str), folder (str), limit (int) |
Searches email subject and body across specified folder. |
mail_send_reply |
π΄ HITL | to_email (str), subject (str), body (str) |
Sends an email reply via SMTP TLS (Port 465). |
mail_send_with_attachment |
π΄ HITL | to_email, subject, body, attachment_path (str) |
Sends email with local attachment via MIME multipart. |
mail_move_message |
π΄ HITL | uid (str), to_folder (str), from_folder (str) |
Moves message between IMAP folders. |
dav_list_dir |
π’ Safe | path (str), offset (int), limit (int) |
Lists WebDAV directory contents with pagination. |
dav_download_file |
π’ Safe | remote_path (str), local_path (str) |
Downloads file to local workspace with path containment check. |
dav_upload_file |
π΄ HITL | local_path (str), remote_path (str) |
Uploads local file to WebDAV cloud storage. |
dav_create_folder |
π΄ HITL | path (str) |
Creates remote directory in WebDAV cloud storage. |
dav_delete_file |
π΄ HITL | path (str) |
Deletes remote file or directory in WebDAV. |
π Building & Deployment
Compilation
# Build binary
make build
# Or directly with go
go build -v -o mailru-mcp-server .
Configuration (Environment Variables)
export MAILRU_USERNAME="[email protected]"
export MAILRU_APP_PASS="app-specific-password"
export MAILRU_TIMEOUT="15" # Optional (default: 15 seconds)
export MAILRU_IMAP_HOST="imap.mail.ru" # Optional (default: imap.mail.ru)
export MAILRU_SMTP_HOST="smtp.mail.ru" # Optional (default: smtp.mail.ru)
export MAILRU_WEBDAV_HOST="https://webdav.cloud.mail.ru" # Optional
export MAILRU_ALLOWED_ROOTS="" # Optional (comma-separated allowed roots)
export MAILRU_OPERATOR_NAME="ZavLab" # Optional (operator confirmation name)
Deployment via mcp-router or MCP Client
Example configuration in config.yaml or client settings:
mailru:
transport: stdio
command: /usr/local/bin/mailru-mcp-server
env:
MAILRU_USERNAME: ${MAILRU_USERNAME}
MAILRU_APP_PASS: ${MAILRU_APP_PASS}
prefix: mailru__
π§ͺ Testing & Verification
# Run unit tests with race detection and coverage
make test
# Run linter
make lint
# Generate coverage breakdown
make coverage
π Governance & Standards
- License: MIT License
- Contribution Guide: CONTRIBUTING.md
- Security Policy: SECURITY.md
- Changelog: CHANGELOG.md
- Architecture Decisions: ARCHITECTURE.md
Installing Mailru
This server has no published package β it is built from source. Open the repository and follow its README.
βΈ github.com/TheNovaNodes/mailru-mcp-serverFAQ
Is Mailru MCP free?
Yes, Mailru MCP is free β one-click install via Unyly at no cost.
Does Mailru need an API key?
No, Mailru runs without API keys or environment variables.
Is Mailru hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Mailru in Claude Desktop, Claude Code or Cursor?
Open Mailru on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install β the config is generated automatically, no JSON editing.
Related MCPs
Gmail
Read, send and search emails from Claude
by GoogleSlack
Send, search and summarize Slack messages
by SlackRunbear
No-code MCP client for team chat platforms, such as Slack, Microsoft Teams, and Discord.
Discord Server
A community discord server dedicated to MCP by [Frank Fiegel](https://github.com/punkpeye)
Klavis AI
Open Source MCP Infra. Hosted MCP servers and MCP clients on Slack and Discord.
Work90210/APIFold
Turn any REST API into a hosted MCP server. 18 free public servers (GitHub, Stripe, Slack, OpenAI, Notion, and more) β no setup required, bring your own API key
by Work90210arikusi/deepseek-mcp-server
MCP server for DeepSeek AI with chat, reasoning, multi-turn sessions, function calling, thinking mode, and cost tracking.
by arikusihashgraph-online/hashnet-mcp-js
MCP server for the Registry Broker. Discover, register, and chat with AI agents on the Hashgraph network.
by hashgraph-onlineprofullstack/mcp-server
A comprehensive MCP server aggregating 20+ tools including SEO optimization, document conversion, domain lookup, email validation, QR generation, weather data,
by profullstackWayStation-ai/mcp
Seamlessly and securely connect Claude Desktop and other MCP hosts to your favorite apps (Notion, Slack, Monday, Airtable, etc.). Takes less than 90 secs.
by waystation-aiCompare Mailru with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All communication MCPs
