Skip to main content
Glama
00thies-blip

mail-mcp-oauth

by 00thies-blip

mail-mcp-oauth

セルフホスト型で、OAuth 2.1対応のIMAP/SMTP MCPサーバー(Claude.ai向け)— maxx3250/claude-mail-mcp のフォークです。OAuth 2.1 + 動的クライアント登録(DCR) + PKCE レイヤーを内蔵し、Render上で単一のステートレスプロセスとして実行できるよう調整されています(VPS、nginx、systemd、永続ディスクは不要)。

マルチアカウント対応: 1つのデプロイで複数のメールボックス(Gmail、カスタムドメインなど)を利用でき、それぞれIMAP/SMTPでアクセスできます。各MCPツールは、操作対象のメールボックスを選ぶオプションのaccountパラメータを受け取ります。

アップストリームからの変更点

  • OAuth 2.1を内蔵src/oauth.ts): /register(DCR)、/authorize(PKCE + シングルユーザーログインフォーム)、/token。独立したOAuthシムプロセスは不要です。アップストリームでは言及されていますが公開されていないため、このフォークでは同じExpressアプリ内に直接実装しています。

  • 設計上ステートレス — アクセストークン/リフレッシュトークンは署名済みのJWT(DB不要)。登録済みOAuthクライアントと処理中の認証コードはメモリ上に保持されます(再起動するとClaude.aiが自動的に再登録するだけで、その処理はMCPクライアントがすでに行います)。

  • 環境変数からアカウント設定: Renderのファイルシステムはephemeralなため、ディスク上のファイルではなくACCOUNTS_JSONを使用します。ファイルベースのACCOUNTS_FILEは、ローカル/VPS利用時には引き続き使用可能です。

  • CalDAV/カレンダーツールを削除 — このデプロイには不要で、依存関係も削減できます(tsdavical.js)。

Related MCP server: IMAP MCP Server

アーキテクチャ

Claude.ai (web)
    │  HTTPS + OAuth 2.1 (DCR, PKCE, JWT)
    ▼
Render (TLS terminated automatically, custom domain mcp-mail.<domain>)
    ▼
this process (single Node service)
    ├── /.well-known/oauth-authorization-server, /register, /authorize, /token   (src/oauth.ts)
    ├── /mcp  (Bearer-gated MCP Streamable HTTP transport)
    │     ├── ImapClient   ──▶ imapflow   ──▶ IMAP server (993/143) per account
    │     └── SmtpClient   ──▶ nodemailer ──▶ SMTP server (465/587) per account
    └── /health

ローカルセットアップ

npm install
cp .env.example .env
# fill in PUBLIC_URL, ACCOUNTS_JSON (see docs/ACCOUNTS.md), OAUTH_USER,
# OAUTH_PASS, and JWT_SECRET (openssl rand -hex 32)
npm run dev

Renderへのデプロイ

詳細な手順(GitHub push、Render Webサービス、カスタムドメイン、Netcup DNS、Claude.aiの接続)は docs/DEPLOY_RENDER.md を参照してください。

アカウント

accounts.jsonのスキーマとプロバイダー別設定(Gmailのアプリパスワード、Netcup WebhostingのIMAP/SMTP、そしてHotmail/Outlook.com が別途OAuth2フローを必要とする理由)については docs/ACCOUNTS.md を参照してください。

Claudeに公開されるツール

Tool

用途

list_accounts

設定済みのメールボックスを一覧表示(id、label、default、From)— 資格情報は表示しません

list_folders

IMAPメールボックスを列挙

list_messages

フォルダ内の最新N件を取得

search_messages

サーバーサイドのIMAP検索

get_message

本文全体 + ヘッダー + 添付ファイルのメタデータを取得

send_message

SMTPで送信(必要に応じてSentにコピー)

create_draft

RFC-822メッセージを作成しDraftsにAPPEND

mark_read

\Seenを切り替え

move_message

フォルダ間で移動

delete_message

削除(破壊的操作 — Trashへの移動を推奨)

ライセンス

MIT — LICENSE を参照してください。原著作者: Markus Stöger(maxx3250/claude-mail-mcp)。

A
license - permissive license
Not graded
quality - not tested
B
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 Servers

  • A
    license
    A
    quality
    A
    maintenance
    Enables Claude to interact with email accounts via IMAP and SMTP, providing tools for searching, reading, sending, and managing emails across multiple providers.
    40
    417
    76
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables Claude to read, search, send, label, and trash emails in any Gmail account via Google's Gmail API, using OAuth2 authentication with automatic token refresh.
    67
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables searching, reading, moving, tagging, and linking emails in MailMate via MCP tools, allowing Claude to manage email without leaving the conversation.
    3
    GPL 3.0

View all related MCP servers

Related MCP Connectors

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

  • Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…

  • 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/00thies-blip/mail-mcp-oauth'

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