MC

maxx3250/claude-mail-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

6 stars 7 forks 质量 65 趋势 18MIT

Self-hosted IMAP/SMTP/CalDAV connector for Claude. Streamable HTTP MCP server with 13 tools for email and calendar. Works with Mailbox.

概览

Self-hosted with multi-account support. A Streamable HTTP MCP server that lets Claude.ai read and write your email + calendar against any RFC-compliant mailbox. Built because every other Claude email connector targets Gmail. This one is for the rest of us — Mailbox.org, Fastmail, iCloud, Mailcow, iRedMail, Migadu, Nextcloud, your own Postfix box. If your provider speaks IMAP, SMTP and CalDAV, this works. One connector, all your inboxes. Every tool accepts an optional account: " " parameter to pick a mailbox; omit it to use the default account. So "list unread in INBOX of work account" vs "compare today's calendar across work and personal" both work in one connector. Hosted email-AI services need full mailbox access. That's a lot of trust to hand to a vendor. This connector flips the model: . - One Node process per mailbox - Credentials in a single .env file - One Bearer token gates every MCP call - Add the URL to Claude.ai once, done The server boots with — that's fine.

README

以下为原文 README 节选,完整内容请查看原文。

claude-mail-mcp

Self-hosted IMAP / SMTP / CalDAV connector for Claude with multi-account support. A Streamable HTTP MCP server that lets Claude.ai read and write your email + calendar against any RFC-compliant mailbox.

Built because every other Claude email connector targets Gmail. This one is for the rest of us — Mailbox.org, Fastmail, iCloud, Mailcow, iRedMail, Migadu, Nextcloud, your own Postfix box. If your provider speaks IMAP, SMTP and CalDAV, this works. One connector, all your inboxes.


What it does

Exposes 14 MCP tools to Claude:

Accounts (1)

Tool Purpose
list_accounts List all configured mailboxes — id, label, default flag, From, CalDAV-enabled. Never returns credentials.

Mail (9)

Tool Purpose
list_folders Enumerate IMAP mailboxes (INBOX, Sent, …)
list_messages Newest N messages in a folder
search_messages Server-side IMAP search (from/to/subject/body/date/flags)
get_message Full body + headers + attachment metadata
send_message Send via SMTP, optionally copy to Sent folder
create_draft Build RFC-822 and APPEND to Drafts
mark_read Toggle \Seen flag
move_message Move between folders
delete_message Delete (destructive — prefer move to Trash)

Calendar (4)

Tool Purpose
list_calendars Discover CalDAV calendars
list_events Events in a time window (recurrences expanded)
create_event Add new event (writes to CalDAV)
find_free_slot Compute free intervals across one or more calendars

Every tool accepts an optional account: "" parameter to pick a mailbox; omit it to use the default account. So “list unread in INBOX of work account” vs “compare today’s calendar across work and personal” both work in one connector.


Why bring-your-own-server?

Hosted email-AI services need full mailbox access. That’s a lot of trust to hand to a vendor. This connector flips the model: you run it, you hold the credentials, no third party between Claude and your inbox.

  • One Node process per mailbox
  • Credentials in a single .env file
  • One Bearer token gates every MCP call
  • Add the URL to Claude.ai once, done

Quick start

git clone https://github.com/maxx3250/claude-mail-mcp.git
cd claude-mail-mcp
npm install
cp .env.example .env
# Generate an AUTH_TOKEN and fill it into .env:
#   echo "AUTH_TOKEN=$(openssl rand -hex 32)" >> .env
npm run build
npm start

The server boots with no mailboxes configured — that’s fine. Add them via the OAuth shim’s /settings UI (see Deployment) or hand-craft an accounts.json:

{
  "version": 1,
  "accounts": [
    {
      "id": "main",
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →