notifications-mcp
notifications-mcp
統合型 Notifications MCP サーバー — フェーズ 1: Gmail 任意の AI エージェント(Claude、LangGraph、GPT)から Model Context Protocol を介してメールアラートを送信します。
これは何をするのか
この MCP サーバーは、MCP 互換の任意の AI エージェントが Gmail 経由でメールを送信するために呼び出せる mail_send ツールを公開します。
ユースケース: 工場の機械が停止 → AI 監視エージェントが mail_send を呼び出す → マネージャー、技術者、スタッフ全員に即座にアラートメールが届きます。
Machine stops → AI Agent → mail_send tool → Gmail → Manager + Technician notifiedMCP エンドポイント: http://localhost:8100/mcp
アーキテクチャ
notifications-mcp/
├── src/
│ ├── server.py ← Entrypoint (Streamable HTTP + OAuth routes)
│ ├── config.py ← Loads config.yaml
│ ├── registry.py ← Dynamically loads channel tools
│ └── channels/
│ ├── mail/ ← Gmail channel (Phase 1)
│ ├── teams/ ← Microsoft Teams (Phase 2 placeholder)
│ └── sms/ ← SMS via Twilio (Phase 3 placeholder)新しいチャネルを追加するには: channels/<name>/tools.py を作成し、register(mcp, cfg) 関数を含め、config.yaml の enabled_channels にチャネル名を追加します。他のファイルは変更しません。
セットアップ
1. 前提条件
Python 3.11+
Gmail API が有効化された Google Cloud プロジェクト
2. Google Cloud セットアップ
Google Cloud Console にアクセス
プロジェクトで Gmail API を有効化
API とサービス → 認証情報 → 認証情報を作成 → OAuth 2.0 クライアント ID に移動
アプリケーションの種類: ウェブ アプリケーション
承認済みのリダイレクト URI を追加:
http://localhost:8100/auth/gmail/callbackJSON をダウンロード →
credentials/google_credentials.jsonとして保存
3. 依存関係のインストール
pip install -r requirements.txt
# or for development:
pip install -e ".[dev]"4. サーバーの起動
python -m src.server次のように表示されます:
{"level": "INFO", "message": "Starting notifications-mcp | host=0.0.0.0 | port=8100"}
{"level": "INFO", "message": "MCP endpoint → http://localhost:8100/mcp"}
{"level": "INFO", "message": "Gmail OAuth → http://localhost:8100/auth/gmail/start"}5. Gmail の認証 (初回のみ)
ブラウザで次の URL を開きます:
http://localhost:8100/auth/gmail/startGoogle の同意画面にリダイレクトされます
送信元として使用する Gmail アカウントでログイン
「メールを送信」権限を許可
✅ Gmail Authenticated! と表示されたらタブを閉じます
トークンは
credentials/gmail_token.jsonに保存され、以降は自動的にサイレント更新されます
mail_send ツールの使用方法
MCP Inspector から (テスト)
npx @modelcontextprotocol/inspector http://localhost:8100/mcpmail_send を次のパラメータで呼び出します:
{
"to": ["manager@yourcompany.com", "technician@yourcompany.com"],
"subject": "ALERT: Machine #3 stopped",
"body": "Machine #3 on Floor B stopped at 18:02.\nError code: E-404.\nPlease investigate immediately."
}AI エージェントから (Claude / LangGraph)
エージェントには次のツール説明が表示されます:
mail_send — 1 人以上の受信者に Gmail 経由でメールを送信します。工場の機械ダウンタイムアラートの場合、機械名、場所、停止時間、エラーコードを含めてください。
エージェントは次のように呼び出します:
result = await client.call_tool("mail_send", {
"to": ["manager@factory.com", "tech@factory.com"],
"subject": "ALERT: Machine #3 stopped",
"body": "Machine #3 stopped at 18:02. Error: E-404. Location: Floor B, Line 2."
})Antigravity / Claude Desktop から
MCP 設定に追加:
{
"mcpServers": {
"notifications": {
"url": "http://localhost:8100/mcp"
}
}
}ツールリファレンス
mail_send
1 人以上の受信者に Gmail 経由でメールを送信します。
パラメータ | タイプ | 必須 | 説明 |
|
| ✅ | 受信者のメールアドレスリスト |
|
| ✅ | メールの件名 |
|
| ✅ | メール本文(プレーンテキスト) |
|
| ❌ | CC 受信者 |
|
| ❌ | BCC 受信者 |
成功時の戻り値:
{"status": "sent", "message_id": "18b3c...", "recipients": ["manager@co.com"]}失敗時の戻り値:
{"status": "failed", "error": "rate_limited", "message": "Gmail rate limit hit. Wait 60s."}設定
config.yaml を編集して設定を変更します:
server:
host: "0.0.0.0"
port: 8100 # Change port here
enabled_channels:
- mail # Add 'teams' or 'sms' here in Phase 2/3
channels:
mail:
credentials_path: "credentials/google_credentials.json"
token_path: "credentials/gmail_token.json"
scopes:
- "https://www.googleapis.com/auth/gmail.send"
oauth_redirect_uri: "http://localhost:8100/auth/gmail/callback"テストの実行
pytest tests/ -v期待される出力:
tests/channels/mail/test_tools.py::test_mail_send_success PASSED
tests/channels/mail/test_tools.py::test_mail_send_not_authenticated PASSED
tests/channels/mail/test_tools.py::test_mail_send_rate_limited PASSED
tests/channels/mail/test_tools.py::test_mail_send_missing_to_field PASSED
tests/channels/mail/test_tools.py::test_mail_send_missing_subject PASSED
tests/channels/mail/test_tools.py::test_mail_send_multiple_recipients PASSED
tests/channels/mail/test_tools.py::test_mail_send_with_cc_bcc PASSEDフェーズ 2 (Teams) またはフェーズ 3 (SMS) の追加
チャネルフォルダを作成:
src/channels/teams/__init__.py src/channels/teams/auth.py src/channels/teams/client.py src/channels/teams/schemas.py src/channels/teams/tools.py ← must have def register(mcp, cfg)config.yamlに追加:enabled_channels: - mail - teams ← add this channels: teams: tenant_id: "..." client_id: "..."完了。
server.pyとregistry.pyは変更不要です。
セキュリティに関する注意事項
credentials/は gitignore されています — Google 認証情報をコミットしないでくださいOAuth トークンは自動的にサイレント更新されます — 同意は 1 回だけです
サーバーは localhost で実行されます — デフォルトではインターネットに公開されません
localhost での使用に API キーは不要です
フェーズ 1: Gmail ✅ | フェーズ 2: Teams 🔜 | フェーズ 3: SMS 🔜
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 Connectors
Phone, SMS & email for AI agents — one remote MCP endpoint, OAuth login, zero install.
Push notifications for AI agents - send instant iPhone notifications from any MCP client.
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
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/Manojbonthu/Custom_MCP_Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server