mail-mcp-oauth
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/カレンダーツールを削除 — このデプロイには不要で、依存関係も削減できます(
tsdav、ical.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 devRenderへのデプロイ
詳細な手順(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 | 用途 |
| 設定済みのメールボックスを一覧表示(id、label、default、From)— 資格情報は表示しません |
| IMAPメールボックスを列挙 |
| フォルダ内の最新N件を取得 |
| サーバーサイドのIMAP検索 |
| 本文全体 + ヘッダー + 添付ファイルのメタデータを取得 |
| SMTPで送信(必要に応じてSentにコピー) |
| RFC-822メッセージを作成しDraftsにAPPEND |
|
|
| フォルダ間で移動 |
| 削除(破壊的操作 — Trashへの移動を推奨) |
ライセンス
MIT — LICENSE を参照してください。原著作者: Markus Stöger(maxx3250/claude-mail-mcp)。
This server cannot be installed
Maintenance
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
- AlicenseAqualityDmaintenanceEnables seamless email management through natural language conversations with Claude. Supports searching, reading, and sending emails securely with Gmail and other email providers.4MIT
- AlicenseAqualityAmaintenanceEnables Claude to interact with email accounts via IMAP and SMTP, providing tools for searching, reading, sending, and managing emails across multiple providers.4041776MIT
- AlicenseNot gradedqualityCmaintenanceEnables 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.67MIT
- AlicenseNot gradedqualityDmaintenanceEnables searching, reading, moving, tagging, and linking emails in MailMate via MCP tools, allowing Claude to manage email without leaving the conversation.3GPL 3.0
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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