Email MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/nikolausm/imap-mcp-server.git
cd imap-mcp-server
npm install
npm run build
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add email-mcp-5206 -- node "<FULL_PATH_TO_MCP_EMAIL>/dist/index.js"

Replace <FULL_PATH_TO_MCP_EMAIL>/dist/index.js with the actual folder you prepared in step 1.

README.md

An HTTP/SSE wrapper for the IMAP MCP server to read, search, and send emails.

Email MCP Server

HTTP/SSE wrapper для nikolausm/imap-mcp-server, обеспечивающий удалённый доступ через Claude Web и другие HTTP-клиенты MCP.

Возможности

  • 📧 Полноценная работа с почтой: чтение, поиск, отправка, ответ, пересылка
  • 🔐 Безопасное хранение: AES-256 шифрование учётных данных
  • 🌐 Удалённый доступ: HTTP/SSE транспорт для Claude Web
  • 📱 15+ провайдеров: Gmail, Outlook, Yahoo, Yandex, Mail.ru и др.
  • 🔄 Multi-account: Поддержка нескольких почтовых аккаунтов

Архитектура

┌─────────────────────────────────────────────────────┐
│                  HTTP/SSE Wrapper                    │
│                  (Python/aiohttp)                    │
├─────────────────────────────────────────────────────┤
│                                                      │
│   HTTP/SSE ←→ STDIO Bridge ←→ imap-mcp-server       │
│                                                      │
└─────────────────────────────────────────────────────┘

Быстрый старт

Локально для Claude Desktop

# Клонировать репозиторий
git clone https://github.com/nikolausm/imap-mcp-server.git
cd imap-mcp-server

# Установить и собрать
npm install
npm run build

# Настроить аккаунты через web wizard
npm run setup

Добавить в ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "imap-email": {
      "command": "node",
      "args": ["/path/to/imap-mcp-server/dist/index.js"]
    }
  }
}

Удалённый сервер (Docker)

# Собрать и запустить
docker-compose up -d

# Проверить здоровье
curl http://localhost:3008/health

Через Gateway (Claude Web)

URL для Custom Connector:

https://mcp.svsfinpro.ru/email/sse

API Endpoints

Endpoint Метод Описание
/ GET Информация о сервере
/health GET Health check
/sse GET SSE endpoint для установления соединения
/mcp POST Streamable HTTP endpoint
/messages POST Legacy SSE messages endpoint

MCP Инструменты

Управление аккаунтами

  • imap_add_account - Добавить почтовый аккаунт
  • imap_list_accounts - Список аккаунтов
  • imap_remove_account - Удалить аккаунт
  • imap_connect - Подключиться к аккаунту
  • imap_disconnect - Отключиться

Работа с письмами

  • imap_search_emails - Поиск писем
  • imap_get_email - Получить письмо
  • imap_get_latest_emails - Последние письма
  • imap_mark_as_read / imap_mark_as_unread - Пометить как прочитанное
  • imap_delete_email - Удалить письмо

Отправка писем

  • imap_send_email - Отправить письмо
  • imap_reply_to_email - Ответить на письмо
  • imap_forward_email - Переслать письмо

Папки

  • imap_list_folders - Список папок
  • imap_folder_status - Статус папки
  • imap_get_unread_count - Количество непрочитанных

Настройка провайдеров

Gmail

  1. Включить 2FA
  2. Создать App Password: https://myaccount.google.com/apppasswords
  3. IMAP: imap.gmail.com:993
  4. SMTP: smtp.gmail.com:465

Yandex

  1. Создать пароль приложения
  2. IMAP: imap.yandex.ru:993
  3. SMTP: smtp.yandex.ru:465

Mail.ru

  1. IMAP: imap.mail.ru:993
  2. SMTP: smtp.mail.ru:465

Deployment

На сервер 217.199.253.8

./deploy.sh

Добавить в nginx gateway

Скопировать nginx-mcp-email.conf в конфигурацию сервера.

Безопасность

  • ⚠️ НИКОГДА не используйте основной пароль - только App Passwords
  • 🔐 Учётные данные шифруются AES-256
  • 📁 Хранятся в Docker volume email-mcp-accounts
  • 🔒 HTTPS через nginx gateway

Переменные окружения

Переменная Описание По умолчанию
HOST Адрес сервера 0.0.0.0
PORT Порт 8080
IMAP_SERVER_PATH Путь к imap-mcp-server /app/imap-mcp-server/dist/index.js
LOG_LEVEL Уровень логирования INFO

Troubleshooting

Контейнер не запускается

docker logs email-mcp-server

Проблемы с подключением к почте

  • Проверьте App Password
  • Убедитесь что IMAP включен в настройках почты
  • Проверьте firewall

License

MIT

Tools (6)

imap_add_accountAdd a new email account
imap_list_accountsList all configured email accounts
imap_search_emailsSearch for emails based on criteria
imap_get_emailRetrieve the content of a specific email
imap_send_emailSend a new email
imap_reply_to_emailReply to an existing email

Environment Variables

HOSTServer address
PORTServer port
IMAP_SERVER_PATHPath to the imap-mcp-server index.js file
LOG_LEVELLogging verbosity level

Configuration

claude_desktop_config.json
{"mcpServers": {"imap-email": {"command": "node", "args": ["/path/to/imap-mcp-server/dist/index.js"]}}}

Try it

List all my configured email accounts.
Search for the latest emails from my bank in the Inbox.
Read the most recent email from my project manager.
Send a reply to the last email I received confirming I will attend the meeting.
Check how many unread emails I have in my work folder.

Frequently Asked Questions

What are the key features of Email MCP Server?

Full email management including reading, searching, sending, replying, and forwarding. Secure credential storage using AES-256 encryption. Support for 15+ email providers including Gmail, Outlook, and Yandex. Multi-account support for managing multiple inboxes simultaneously. Remote access capabilities via HTTP/SSE transport for Claude Web.

What can I use Email MCP Server for?

Automating email responses for routine inquiries directly from the Claude interface. Searching through large archives of emails to find specific project information. Managing multiple professional and personal email accounts from a single AI assistant. Quickly summarizing the latest unread emails to stay on top of communications.

How do I install Email MCP Server?

Install Email MCP Server by running: git clone https://github.com/nikolausm/imap-mcp-server.git && cd imap-mcp-server && npm install && npm run build

What MCP clients work with Email MCP Server?

Email MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Email MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare