@topvisor/mcp-notifications 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +117 -15
- package/package.json +1 -1
- package/src/notifier.mjs +4 -2
- package/src/server.mjs +5 -2
package/README.md
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
# mcp-notifications
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@topvisor/mcp-notifications)
|
|
4
|
+
|
|
3
5
|
🚀 **Ship faster. Miss nothing.**
|
|
4
6
|
|
|
5
|
-
`mcp-notifications` gives your MCP agent a real desktop voice: instant system notifications for completed tasks,
|
|
7
|
+
`mcp-notifications` gives your MCP agent a real desktop voice: instant system notifications for completed tasks,
|
|
8
|
+
failures, and important updates.
|
|
6
9
|
|
|
7
10
|
No more checking logs every minute.
|
|
8
11
|
No more silent agent runs.
|
|
9
12
|
Just visible, reliable feedback on your desktop. 🔔
|
|
10
13
|
|
|
14
|
+
## Common problem this solves
|
|
15
|
+
|
|
16
|
+
You give tasks to several AI agents, then wait and keep checking who already replied.
|
|
17
|
+
|
|
18
|
+
With `mcp-notifications`, this gets simpler: the agent can notify you on desktop when it needs your input or when work
|
|
19
|
+
is done.
|
|
20
|
+
|
|
11
21
|
## Why teams install this
|
|
12
22
|
|
|
13
23
|
- ⚡ Immediate feedback from your MCP workflows.
|
|
@@ -26,23 +36,84 @@ Requirements:
|
|
|
26
36
|
npm i -g @topvisor/mcp-notifications
|
|
27
37
|
```
|
|
28
38
|
|
|
29
|
-
|
|
39
|
+
Executable name (use this in MCP config):
|
|
30
40
|
|
|
31
41
|
```bash
|
|
32
42
|
mcp-notifications
|
|
33
43
|
```
|
|
34
44
|
|
|
35
|
-
|
|
45
|
+
`mcp-notifications` is an MCP server entrypoint (`stdio`), not a one-shot notification command.
|
|
46
|
+
|
|
47
|
+
## Setup: Codex
|
|
36
48
|
|
|
37
49
|
Add this to `~/.codex/config.toml`:
|
|
38
50
|
|
|
39
51
|
```toml
|
|
40
|
-
[mcp_servers.
|
|
52
|
+
[mcp_servers.notifications]
|
|
41
53
|
enabled = true
|
|
42
54
|
command = "mcp-notifications"
|
|
43
55
|
args = []
|
|
44
56
|
```
|
|
45
57
|
|
|
58
|
+
Restart Codex after config update.
|
|
59
|
+
|
|
60
|
+
## Setup: Claude Agent
|
|
61
|
+
|
|
62
|
+
Add MCP server config to your Claude client config file:
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"mcpServers": {
|
|
67
|
+
"notifications": {
|
|
68
|
+
"command": "mcp-notifications",
|
|
69
|
+
"args": []
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Then restart Claude client.
|
|
76
|
+
|
|
77
|
+
## AI Agent Notification Instructions
|
|
78
|
+
|
|
79
|
+
There are two approaches to notifications: manual and automatic.
|
|
80
|
+
|
|
81
|
+
Choose the one that works better for your workflow.
|
|
82
|
+
|
|
83
|
+
### Manual
|
|
84
|
+
|
|
85
|
+
In a task where you want to be notified, explicitly ask the agent. Example:
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
Count files in the project; after the task is fully complete, notify me with sound.
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
You can also define sound, topic, and frequency rules inside a specific chat. Example:
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
Notify me about your replies without sound, include the reply text, and use title: "Large Refactoring"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Automatic
|
|
98
|
+
|
|
99
|
+
Automatic notifications can be configured globally or per project.
|
|
100
|
+
|
|
101
|
+
Example instruction to enable automatic notifications for agent replies:
|
|
102
|
+
|
|
103
|
+
```text
|
|
104
|
+
Send `send_notification` after your replies (actual task time >5 seconds or many steps); `play_sound: false`; `app_id: '{put your chat name here}'`
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Time is a rough threshold and depends on model behavior, so adjust this instruction to your own preferences.
|
|
108
|
+
|
|
109
|
+
### In Skills
|
|
110
|
+
|
|
111
|
+
You can also enable notifications in specific skills. Example for a Review skill:
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
After the review, run `send_notification` with a short summary; `play_sound: true`; `app_id: 'Reviewer {put task id here}'`
|
|
115
|
+
```
|
|
116
|
+
|
|
46
117
|
## Tool
|
|
47
118
|
|
|
48
119
|
### `send_notification`
|
|
@@ -53,28 +124,59 @@ Input:
|
|
|
53
124
|
- `message` `string` (required)
|
|
54
125
|
- `play_sound` `boolean` (optional, default: `false`)
|
|
55
126
|
- `icon` `string` (optional, absolute or relative path to image file)
|
|
127
|
+
- `app_id` `string` (optional, Windows App User Model ID for toast source)
|
|
56
128
|
|
|
57
129
|
Example:
|
|
58
130
|
|
|
59
131
|
```json
|
|
60
132
|
{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
133
|
+
"title": "Codex",
|
|
134
|
+
"message": "Deployment completed successfully",
|
|
135
|
+
"play_sound": true,
|
|
136
|
+
"icon": "/opt/mcp-notifications/icons/custom.png",
|
|
137
|
+
"app_id": "Topvisor.Codex"
|
|
65
138
|
}
|
|
66
139
|
```
|
|
67
140
|
|
|
141
|
+
## app_id (Windows)
|
|
142
|
+
|
|
143
|
+
- `app_id` controls the source shown in Windows toast notifications.
|
|
144
|
+
- If `app_id` is not set, Windows may show `SnoreToast` as the source.
|
|
145
|
+
- You can pass `app_id` in each tool call, or set `MCP_NOTIFICATIONS_APP_ID` as an environment variable for the server.
|
|
146
|
+
|
|
147
|
+
## Chat Prompts To Test In Codex
|
|
148
|
+
|
|
149
|
+
Use these messages directly in chat:
|
|
150
|
+
|
|
151
|
+
```text
|
|
152
|
+
Check send_notification
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
```text
|
|
156
|
+
Send a notification without sound: title "Test", message "Check"
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
```text
|
|
160
|
+
Send a notification with sound: title "Test", message "Check"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
```text
|
|
164
|
+
Send a notification with app_id "Topvisor.Codex": title "Test", message "Check"
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
```text
|
|
168
|
+
Send 3 test notifications in a row without sound
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Expected tool result in logs/response:
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
Notification queued
|
|
175
|
+
```
|
|
176
|
+
|
|
68
177
|
## Behavior
|
|
69
178
|
|
|
70
179
|
- ✅ Uses standard system notification channels.
|
|
71
180
|
- 🔊 Uses the standard system notification sound when `play_sound: true`.
|
|
72
181
|
- 🤖 Uses bundled Topvisor robot image as default notification icon.
|
|
73
182
|
- 🧰 Returns quickly while notifications are delivered in background queue.
|
|
74
|
-
|
|
75
|
-
## Local development
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
npm install
|
|
79
|
-
npm run start
|
|
80
|
-
```
|
package/package.json
CHANGED
package/src/notifier.mjs
CHANGED
|
@@ -12,12 +12,13 @@ const DEFAULT_ICON_PATH = path.resolve(__dirname, '../assets/topvisor-robot.png'
|
|
|
12
12
|
* Добавить уведомление в очередь фоновой отправки.
|
|
13
13
|
* Tool-вызов не ждёт завершения системного API уведомлений.
|
|
14
14
|
*/
|
|
15
|
-
export const enqueueNotification = ({ title, message, playSound, icon }) => {
|
|
15
|
+
export const enqueueNotification = ({ title, message, playSound, icon, appId }) => {
|
|
16
16
|
jobs.push({
|
|
17
17
|
title,
|
|
18
18
|
message,
|
|
19
19
|
playSound,
|
|
20
20
|
icon: normalizeIcon(icon),
|
|
21
|
+
appId,
|
|
21
22
|
});
|
|
22
23
|
processQueue();
|
|
23
24
|
};
|
|
@@ -37,6 +38,7 @@ const processQueue = () => {
|
|
|
37
38
|
wait: false,
|
|
38
39
|
sound: job.playSound,
|
|
39
40
|
icon: job.icon,
|
|
41
|
+
appID: job.appId,
|
|
40
42
|
},
|
|
41
43
|
(error) => {
|
|
42
44
|
isProcessing = false;
|
|
@@ -56,4 +58,4 @@ const normalizeIcon = (icon) => {
|
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
return path.resolve(icon);
|
|
59
|
-
};
|
|
61
|
+
};
|
package/src/server.mjs
CHANGED
|
@@ -15,15 +15,18 @@ server.tool(
|
|
|
15
15
|
message: z.string().min(1),
|
|
16
16
|
play_sound: z.boolean().optional(),
|
|
17
17
|
icon: z.string().min(1).optional(),
|
|
18
|
+
app_id: z.string().min(1).optional(),
|
|
18
19
|
},
|
|
19
|
-
async ({ title, message, play_sound, icon }) => {
|
|
20
|
+
async ({ title, message, play_sound, icon, app_id }) => {
|
|
20
21
|
const playSound = play_sound ?? false;
|
|
22
|
+
const appId = app_id ?? process.env.MCP_NOTIFICATIONS_APP_ID;
|
|
21
23
|
|
|
22
24
|
enqueueNotification({
|
|
23
25
|
title,
|
|
24
26
|
message,
|
|
25
27
|
playSound,
|
|
26
28
|
icon,
|
|
29
|
+
appId,
|
|
27
30
|
});
|
|
28
31
|
|
|
29
32
|
return {
|
|
@@ -38,4 +41,4 @@ server.tool(
|
|
|
38
41
|
);
|
|
39
42
|
|
|
40
43
|
const transport = new StdioServerTransport();
|
|
41
|
-
await server.connect(transport);
|
|
44
|
+
await server.connect(transport);
|