Skip to main content
Glama
dongjunke

ai-mail-mcp

by dongjunke

ai-mail-mcp

Connect your private domain email to any MCP client for email services. Supports sending (automatically appends a personal signature / brand introduction page link), receiving, reading email content, and connection testing.

Compatible with WorkBuddy, Claude Desktop, Cursor, and all tools that support the MCP protocol. Through cloud deployment, WorkBuddy desktop and mobile can share the same email entry point, allowing you to manage your email affairs with natural language anytime, anywhere.

Features

  • โœ‰๏ธ send_email: Send emails, automatically appending a personal signature "Sent by xx via xx" (includes an introduction page link, which can serve as a personal IP entry point)

  • ๐Ÿ“ฅ get_recent_emails: Get a list of emails from the last N days (subject / sender / time)

  • ๐Ÿ“– get_email_content: Read the full email body and attachment information by UID

  • ๐Ÿ”Œ test_email_connection: One-click test of SMTP / IMAP connection

  • ๐Ÿš€ Two transport methods: stdio (local debugging) / SSE (cloud remote deployment)

  • ๐Ÿ” Endpoint Bearer Token authentication, all credentials go through environment variables, never hardcoded

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   HTTPS + Bearer   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   SMTP/IMAP   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ WorkBuddy    โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ โ”‚ ai-mail-mcp      โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ โ”‚ ไฝ ็š„ๅŸŸๅ้‚ฎ็ฎฑ   โ”‚
โ”‚ ๆกŒ้ข็ซฏ / ็งปๅŠจ็ซฏ โ”‚                   โ”‚ (ไบ‘็ซฏ MCP Server) โ”‚               โ”‚ you@your.com โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Cloud deployment is key: one HTTPS endpoint that both desktop and mobile can connect to, no need for the local machine to be on.

Quick Start

1. Configure Environment Variables

cp .env.example .env
# ็ผ–่พ‘ .env๏ผŒๅกซๅ…ฅไฝ ็š„้‚ฎ็ฎฑ่ดฆๅทใ€ๆŽˆๆƒ็ ใ€SMTP/IMAP ๅœฐๅ€ใ€Bearer Token

2A. Local Debugging (stdio)

npm install
MCP_TRANSPORT=stdio node server.js

Requires a server with a public IP + a domain name (HTTPS).

cp .env.example .env   # ๅœจๆœๅŠกๅ™จไธŠๅกซๅ†™็œŸๅฎž้…็ฝฎ
docker compose up -d

Then use nginx reverse proxy + acme.sh/certbot to sign an HTTPS certificate (there are commented examples in docker-compose.yml), resulting in an endpoint like https://mcp.your-domain.com/mail-mcp/sse.

3. Connect to WorkBuddy (Custom Connector)

Edit ~/.workbuddy/mcp.json:

{
  "mcpServers": {
    "ai-mail-mcp": {
      "type": "sse",
      "url": "https://mcp.your-domain.com/mail-mcp/sse",
      "headers": {
        "Authorization": "Bearer ไฝ ็š„้šๆœบToken"
      }
    }
  }
}

In the WorkBuddy connector management page, click Trust / Enable on this connector and restart the session. You can then use in conversations:

  • "Send an email to xx, subjectโ€ฆ, bodyโ€ฆ"

  • "Check my emails from the last 3 days and summarize which ones need replies"

  • "Every morning at 9, send a summary of yesterday's emails to my inbox"

Tool List

Tool

Description

Key Parameters

send_email

Send email (auto-appends signature)

to[] subject text (required), cc bcc html attachments optional

get_recent_emails

Recent email list

limit (default 20) days (default 3)

get_email_content

Read full email content

uid (required)

test_email_connection

Test SMTP/IMAP

None

Security Tips

  • MCP_BEARER_TOKEN must be set to a sufficiently random long string (generated with openssl rand -hex 32) and kept securely

  • Do not commit .env or real credentials to any repository; only .env.example is committed to this documentation repository

  • It is recommended to use a separate email account with minimal permissions (send/receive only, no delete/management permissions)

  • Self-hosting means all email data stays on your own server and is not handed over to third parties

License

MIT

-
license - not tested
-
quality - not tested
C
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.

  • Shipmail MCP server for AI agent custom-domain email inboxes with REST API and webhooks.

  • Hosted email MCP for AI agents with inboxes, send/receive, memory, recovery, and credits.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dongjunke/ai-mail-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server