NTFY MCP Server
NTFY MCPサーバー
ntfy.sh通知、非同期エージェントメッセージング、およびヒューマン・イン・ザ・ループ(人間が介在する)ワークフローのためのMCPサーバーです。
MCPクライアントがntfyトピックにメッセージを公開し、ライブサブスクリプションを維持し、カスタムメッセージングレイヤーを構築することなく返信を待機するためのシンプルな方法を提供します。
機能
このサーバーは、以下のような場合に役立ちます:
MCP接続されたエージェントからのプッシュ通知
ユーザーとエージェント間の非同期メッセージ交換
ntfyを介した軽量な人間の承認または返信ループ長時間実行されるワークフローのためのシンプルな通知チャネル
一般的なフロー:
ユーザーまたは外部システムが
ntfyトピックにメッセージを公開します。MCPクライアントが
wait-and-read-inboxまたはntfy://inboxを通じてそれを読み取ります。エージェントが
send-ntfyを通じて応答します。ユーザーが
ntfyプッシュ通知として応答を受け取ります。
Related MCP server: Chat Human MCP Server
特徴
タイトル、優先度、タグ、添付ファイル付きのメッセージ公開
ほぼリアルタイム配信のための永続的なサブスクリプションの維持
サーバーを再起動せずにトピックを切り替え可能
最近のメッセージをメモリおよびディスク上に保持
ベアラートークンおよび基本認証で保護されたトピックのサポート
公開されている
ntfy.shですぐに使用可能
インストール
グローバルにインストール:
npm install -g nfty-mcp-serverまたはnpx経由で実行:
npx -y --yes nfty-mcp-serverクイックスタート
1. トピックを選択する
ntfy.shでトピックを作成または再利用します。公開トピックは設定が簡単なので、ユニークな名前を選んでください。
2. MCPクライアントを設定する
CursorまたはVS Codeの場合、MCP設定に以下を追加します:
{
"mcpServers": {
"nfty": {
"command": "npx",
"args": ["-y", "--yes", "nfty-mcp-server"],
"env": {
"NTFY_TOPIC": "your-topic-name",
"NTFY_BASE_URL": "https://ntfy.sh"
}
}
}
}Claude Desktopの場合、claude_desktop_config.jsonに同じサーバーエントリを追加します。
注意:
NTFY_TOPICは必須です--yesは、プロジェクトディレクトリを汚染する代わりにnpxのインストールを独自のキャッシュ内に保持します
3. クライアントを再起動する
Cursor、VS Code、またはClaude Desktopを再起動して、MCPサーバーが読み込まれるようにします。
ツール
send-ntfy
設定されたトピックにメッセージを公開します。
パラメータ:
message必須titleオプションpriorityオプション、1から5tagsオプションattachUrlオプション
例:
{
"message": "Task completed successfully.",
"title": "Task Status",
"priority": 4
}set-ntfy-topic
現在のセッションのアクティブなトピックを切り替えます。
パラメータ:
topic必須baseUrlオプション
wait-and-read-inbox
設定されたトピックで新しいメッセージを待機し、少なくとも1つ到着したときに返します。
パラメータ:
sinceオプションsinceTimeオプションsinceNowオプション、デフォルトはtrue
重要:
多くのMCPクライアントは約60秒のタイムアウトを課します
人間の入力を待機している場合、クライアントまたは呼び出し元エージェントはタイムアウト時に再試行する必要があります
エージェントチャットフローの推奨プロンプト動作:
wait-and-read-inboxがユーザーの応答を待機中にタイムアウトした場合は、新しいメッセージが到着するまで再試行してください。
リソース
ntfy://inbox
設定されたトピックの最近のメッセージをJSONとして返します。
例の形式:
{
"topic": "your-topic",
"baseUrl": "https://ntfy.sh",
"messages": [
{
"id": "message-id",
"time": 1234567890,
"title": "Message Title",
"message": "Message body",
"priority": 3,
"tags": ["tag1"],
"topic": "your-topic"
}
]
}設定
データストレージ
サーバーはログ、キャッシュファイル、ロックファイルを専用のデータディレクトリに保存するため、現在のプロジェクトを乱雑にしません。
デフォルトの場所:
macOS / Linux:
~/.nfty-mcp-server/Windows:
C:\Users\<user>\.nfty-mcp-server\
そこに書き込まれるファイル:
nfty-messages.jsonnfty-debug.lognfty-process.lognfty.lock
環境変数
変数 | 説明 | デフォルト |
| メッセージの送受信先トピック | 必須 |
| ntfyサーバーURL |
|
| ベアラートークン | オプション |
| 基本認証ユーザー名 | オプション |
| 基本認証パスワード | オプション |
| 初期バックログカーソル |
|
| フェッチタイムアウト(ミリ秒) |
|
| 起動時にログ/キャッシュをクリア |
|
| 既存のサーバーインスタンスを終了 |
|
| データディレクトリのオーバーライド | デフォルトのプラットフォームパス |
| キャッシュファイルのオーバーライド |
|
CLI引数
サーバーを直接設定することもできます:
npx nfty-mcp-server --topic my-topic --base-url https://ntfy.sh --auth-token your-tokenサポートされている引数:
--topic--base-urlまたは--server--auth-token--username--password--since--log-incoming
仕組み
サーバーは設定されたトピックへの永続的なHTTPサブスクリプションを開きます。
受信メッセージはそのライブ接続を通じて受け取られます。
最近のメッセージはメモリにキャッシュされ、ディスクに永続化されます。
MCPツールは、そのサブスクリプションの上に送信、トピック切り替え、待機/読み取り動作を公開します。
ユースケース
非同期のユーザー・エージェント間メッセージング
長時間実行されるタスクのプッシュ通知
人間の承認ループ
軽量なオペレーターアラート
共有トピックを介したエージェント間の調整
開発
git clone https://github.com/harshwasan/NFTY-MCP.git
cd NFTY-MCP
npm install
npm test
npm run devプロジェクトレイアウト:
NFTY-MCP/
src/server.js
tests/server.test.js
package.jsonトラブルシューティング
メッセージが届かない場合:
NTFY_TOPICを確認してくださいトピックが存在し、到達可能であることを確認してください
設定されたデータディレクトリ内のデバッグログを調査してください
接続の問題:
設定された
NTFY_BASE_URLへのネットワークアクセスを確認してくださいトピックが保護されている場合は、認証設定を確認してください
ライセンス
MIT
Available Tools
3 toolssend-ntfySend ntfy messageA
Publish a message to the configured ntfy topic (set in mcp.json). Supports optional title, priority (1-5), tags, and attachUrl. After sending, use wait-and-read-inbox to wait for responses.
Inputs: message (required), tags, title, priority, +1 more. Returns: id, time, topic, status, +1 more
set-ntfy-topicSet ntfy topicB
Change the ntfy topic for this MCP server session (no restart needed).
Inputs: topic (required), baseUrl. Returns: topic, baseUrl
wait-and-read-inboxWait for new messagesA
Waits for new messages on the configured topic (set in mcp.json) and returns when a new message arrives. Does not return until at least one new message is received. Uses the existing subscription. Note: The MCP protocol has a ~60s client-side timeout that cannot be controlled from the server, but this tool will wait as long as possible within that limit.
Inputs: since, sinceNow, sinceTime. Returns: messages, newCount, lastCursor
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool serves a distinct purpose: sending messages, changing topic, and waiting for incoming messages. No overlap, clear boundaries.
Tool names mix patterns: 'send-ntfy' and 'set-ntfy-topic' use verb-ntfy, but 'wait-and-read-inbox' uses a different structure with 'and'. Inconsistent naming conventions.
Three tools is appropriate for a focused notification server: send, configure topic, and receive. Each tool is necessary and none are redundant.
Core publish/subscribe functionality is covered with send and wait. The set-topic tool adds flexibility. A minor gap is lack of explicit unsubscribe or message history, but not essential for core use.
Related MCP Connectors
Push notifications for AI agents - send instant iPhone notifications from any MCP client.
Let your AI agents ask you for decisions and get your answers back, from your phone or the web.
Reach your own phone from an AI agent: notifications, approval questions, reminders, ring, files.
Let your AI agent notify you by email, Slack, Discord, or webhook. One tool: send_notification.
Related MCP Servers
- AlicenseAqualityBmaintenanceA streamlined MCP server that enables AI assistants to send real-time notifications to your devices through the ntfy service, allowing you to receive alerts when tasks complete or important events occur.2229 npm77GPL 3.0
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to send messages to human users via chat platforms (currently Discord) and optionally wait for human responses, facilitating human-in-the-loop interactions.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to communicate with humans using notify and ask semantics, supporting session management and blocking or non-blocking messages.MIT
- AlicenseNot gradedqualityDmaintenanceSend push notifications to mobile devices via ntfy.sh from AI assistants.MIT