You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ntfy-me-mcp provides AI assistants with the ability to send real-time notifications to your devices through the [ntfy](https://ntfy.sh) service (either public or selfhosted with token support). Get notified when your AI completes tasks, encounters errors, or reaches important milestones - all without constant monitoring.
23
17
24
18
The server includes intelligent features like automatic URL detection for creating view actions and smart markdown formatting detection, making it easier for AI assistants to create rich, interactive notifications without extra configuration.
25
19
26
-
<details>
27
-
<summary>Intelligent Auto Detect Preview:</summary>
@@ -69,14 +70,15 @@ The server includes intelligent features like automatic URL detection for creati
69
70
- 🚀 **Quick Setup**: Run with npx or docker!
70
71
- 🔔 **Real-time Notifications**: Get updates on your phone/desktop when tasks complete
71
72
- 🎨 **Rich Notifications**: Support for topic, title, priorities, emoji tags, and detailed messages
73
+
- 🔍 **Notification Fetching**: Fetch and filter cached messages from your ntfy topics
72
74
- 🎯 **Smart Action Links**: Automatically detects URLs in messages and creates view actions
73
75
- 📄 **Intelligent Markdown**: Auto-detects and enables markdown formatting when present
74
76
- 🔒 **Secure**: Optional authentication with access tokens
75
77
- 🔑 **Input Masking**: Securely store your ntfy token in your vs config!
76
78
- 🌐 **Self-hosted Support**: Works with both ntfy.sh and self-hosted ntfy instances
77
79
78
80
### (Coming soon...)
79
-
- 📨 **Email**: Send notifications to email (requires ntfy email server configuration)
81
+
- 📨 **Email**: Send notifications to email (requires ntfy email server configuration)
80
82
- 🔗 **Click urls**: Ability to customize click urls
81
83
- 🖼️ **Image urls**: Intelligent image url detection to automatically include image urls in messages and notifications
82
84
- 🏁 and more!
@@ -332,17 +334,22 @@ If authentication is required but not provided, you'll receive a clear error mes
332
334
1. Install the [ntfy app](https://ntfy.sh/app) on your device
333
335
2. Subscribe to your chosen topic (the same as your `NTFY_TOPIC` setting)
334
336
335
-
### Using with AI Assistants
337
+
### Sending Notifications (ntfy_me tool)
338
+
339
+
This section covers all functionality related to sending notifications using the ntfy_me tool.
336
340
337
-
When working with your AI assistant, include phrases like:
341
+
#### Using Natural Language
338
342
343
+
When working with your AI assistant, you can use natural phrases like:
339
344
```
340
-
Write me a React component, and notify me when it's done.
345
+
"Send me a notification when the build is complete"
346
+
"Notify me when the task is done"
347
+
"Alert me after generating the code"
348
+
"Message me when the process finishes"
349
+
"Send an alert with high priority"
341
350
```
342
351
343
-
Your AI will use the `ntfy_me` tool to send a notification upon task completion.
344
-
345
-
### Notification Parameters
352
+
#### Message Parameters
346
353
347
354
The tool accepts these parameters:
348
355
@@ -355,11 +362,23 @@ The tool accepts these parameters:
355
362
| markdown | Boolean to enable markdown formatting (true/false) | No |
356
363
| actions | Array of view action objects for clickable links | No |
357
364
358
-
### Action Links
365
+
Example:
366
+
```javascript
367
+
{
368
+
taskTitle:"Code Generation Complete",
369
+
taskSummary:"Your React component has been created successfully with proper TypeScript typing.",
370
+
priority:"high",
371
+
tags: ["check", "code", "react"]
372
+
}
373
+
```
374
+
375
+
This will send a high-priority notification with a checkmark emoji.
376
+
377
+
#### Action Links
359
378
360
379
You can add clickable action buttons to your notifications using the `actions` parameter, or let the server automatically detect URLs in your message.
361
380
362
-
#### Automatic URL Detection
381
+
#####Automatic URL Detection
363
382
When URLs are present in your message body, the server automatically creates up to 3 view actions (ntfy's maximum limit) from the first detected URLs. This makes it easy to include clickable links without manually specifying the actions array.
364
383
365
384
For example, this message:
@@ -372,7 +391,7 @@ For example, this message:
372
391
373
392
Will automatically generate view actions for both URLs, making them easily clickable in the notification.
374
393
375
-
#### Manual Action Configuration
394
+
#####Manual Action Configuration
376
395
For more control, you can manually specify actions:
377
396
378
397
| Property | Description | Required |
@@ -406,7 +425,7 @@ Example with action links:
406
425
}
407
426
```
408
427
409
-
### Emoji Shortcodes
428
+
####Emoji Shortcodes
410
429
411
430
You can use emoji shortcodes in your tags for visual indicators:
412
431
@@ -417,11 +436,11 @@ You can use emoji shortcodes in your tags for visual indicators:
417
436
418
437
See the [full list of supported emoji shortcodes](https://docs.ntfy.sh/emojis/).
419
438
420
-
### Markdown Formatting
439
+
####Markdown Formatting
421
440
422
441
Your notifications support rich markdown formatting with intelligent detection! When you include markdown syntax in your `taskSummary`, the server automatically detects it and enables markdown parsing - no need to set `markdown: true` explicitly.
423
442
424
-
#### Automatic Detection
443
+
#####Automatic Detection
425
444
The server checks for common markdown patterns like:
426
445
- Headers (#, ##, etc.)
427
446
- Lists (-, *, numbers)
@@ -431,7 +450,7 @@ The server checks for common markdown patterns like:
431
450
432
451
When these patterns are detected, markdown parsing is automatically enabled for the message.
433
452
434
-
#### Manual Override
453
+
#####Manual Override
435
454
While automatic detection works in most cases, you can still explicitly control markdown parsing:
436
455
```javascript
437
456
{
@@ -441,18 +460,78 @@ While automatic detection works in most cases, you can still explicitly control
441
460
}
442
461
```
443
462
444
-
### Example Notification
463
+
### Retrieving Messages (ntfy_me_fetch tool)
464
+
465
+
This section covers all functionality related to fetching and filtering messages using the ntfy_me_fetch tool.
466
+
467
+
#### Using Natural Language
468
+
469
+
AI assistants understand various ways to request message fetching:
470
+
```
471
+
"Show me my recent notifications"
472
+
"Get messages from the last hour"
473
+
"Find notifications with title 'Build Complete'"
474
+
"Search for messages with the test_tube tag"
475
+
"Show notifications from the updates topic from the last 24hr"
476
+
"Check my latest alerts"
477
+
```
478
+
479
+
#### Message Parameters
480
+
481
+
The tool accepts these parameters:
482
+
483
+
| Parameter | Description | Required |
484
+
|-----------|-------------|----------|
485
+
| ntfyTopic | Topic to fetch messages from (defaults to NTFY_TOPIC env var) | No |
486
+
| since | How far back to retrieve messages ('10m', '1h', '1d', timestamp, message ID, or 'all') | No |
487
+
| messageId | Find a specific message by its ID | No |
488
+
| messageText | Find messages containing exact text content | No |
489
+
| messageTitle | Find messages with exact title/subject | No |
490
+
| priorities | Find messages with specific priority levels | No |
491
+
| tags | Find messages with specific tags | No |
492
+
493
+
#### Examples
494
+
495
+
1.**Fetch Recent Messages**
496
+
```javascript
497
+
{
498
+
since:"30m"// Get messages from last 30 minutes
499
+
}
500
+
```
501
+
502
+
2.**Filter by Title and Priority**
503
+
```javascript
504
+
{
505
+
messageTitle:"Build Complete",
506
+
priorities:"high",
507
+
since:"1d"
508
+
}
509
+
```
445
510
511
+
3.**Search Different Topic with Tags**
446
512
```javascript
447
513
{
448
-
taskTitle:"Code Generation Complete",
449
-
taskSummary:"Your React component has been created successfully with proper TypeScript typing.",
450
-
priority:"high",
451
-
tags: ["check", "code", "react"]
514
+
ntfyTopic:"updates",
515
+
tags: ["error", "warning"],
516
+
since:"all"
452
517
}
453
518
```
454
519
455
-
This will send a high-priority notification with a checkmark emoji.
520
+
4.**Find Specific Message**
521
+
```javascript
522
+
{
523
+
messageId:"xxxxXXXXxxxx"
524
+
}
525
+
```
526
+
527
+
Messages are returned with full details including:
528
+
- Message ID and timestamp
529
+
- Topic and title
530
+
- Content and priority
531
+
- Tags and attachments
532
+
- Action links and expiration
533
+
534
+
> **Note**: Message history availability depends on your ntfy server's cache settings. The public ntfy.sh server typically caches messages for 12 hours.
@@ -62,7 +63,7 @@ async function initializeServer() {
62
63
version: packageJson.version,
63
64
});
64
65
// Add the notify_user tool
65
-
server.tool("ntfy_me","Notify the user that certain task is complete/error/stopped and give the summary and title of the completed task",{
66
+
server.tool("ntfy_me","Send a notification to the user via ntfy. Use this tool when the user asks to 'send a notification', 'notify me', 'send me an alert', 'message me', 'ping me', or any similar request. This tool is perfect for sending status updates, alerts, reminders, or notifications about completed tasks.",{
ntfyUrl: z.string().optional().describe("Optional custom ntfy URL (defaults to NTFY_URL env var or https://ntfy.sh)"),
@@ -155,6 +156,76 @@ async function initializeServer() {
155
156
};
156
157
}
157
158
});
159
+
// Add the ntfy_me_fetch tool to fetch cached messages
160
+
server.tool("ntfy_me_fetch","Fetch cached messages from an ntfy server topic. Use this tool when the user asks to 'show notifications', 'get my messages', 'show my alerts', 'find notifications', 'search notifications', or any similar request. Great for finding recent notifications, checking message history, or searching for specific notifications by content, title, tags, or priority.",{
161
+
ntfyUrl: z.string().optional().describe("Optional custom ntfy server URL (defaults to NTFY_URL env var or https://ntfy.sh)"),
162
+
ntfyTopic: z.string().optional().describe("Optional custom ntfy topic/channel to get messages from (defaults to NTFY_TOPIC env var)"),
163
+
accessToken: z.string().optional().describe("Optional access token for authentication (defaults to NTFY_TOKEN env var)"),
164
+
since: z.union([z.string(),z.number()]).optional().describe("How far back to retrieve messages: timespan (e.g., '10m', '1h', '1d'), timestamp, message ID, or 'all' for all messages. Default: 10 minutes"),
165
+
messageId: z.string().optional().describe("Find a specific message by its ID"),
166
+
messageText: z.string().optional().describe("Find messages containing this exact text content"),
167
+
messageTitle: z.string().optional().describe("Find messages with this exact title/subject"),
168
+
priorities: z.union([z.string(),z.array(z.string())]).optional().describe("Find messages with specific priority levels (min, low, default, high, max)"),
169
+
tags: z.union([z.string(),z.array(z.string())]).optional().describe("Find messages with specific tags (e.g., 'error', 'warning', 'success')"),
0 commit comments