mcp通知
](https://www.npmjs.com/package/@topvisor/mcp-notifications)
🚀 船更快。什么都不错过。
mcp-notifications 允许您的MCP代理发送已完成任务、失败和重要更新的桌面通知。
这对控制台AI代理特别有用,因为默认情况下它们通常没有内置通知。
不再每分钟查看聊天记录。\ 不再有无声的代理响应。\ 在您的桌面上提供直观、可靠的反馈。 🔔
这解决了一个常见问题
你给几个人工智能代理分配任务,然后等待并不断检查谁已经回复了。
随着 mcp-notifications,这变得更简单:代理可以在需要您的输入或工作时在桌面上通知您 完成了。
为什么团队要安装这个
- ⚡ 来自MCP工作流程的即时反馈。
- 🧠 更好的专注:让代理人在你专注于主要任务的同时工作。
- 🖥️ 通过以下方式发送本地操作系统通知
node-notifier. - 🧵 非阻塞行为:通知发送在后台排队。
全局安装
要求:
- Node.js
>=20 - npm
>=10
npm i -g @topvisor/mcp-notifications可执行文件名(在MCP配置中使用):
mcp-notificationsmcp-notifications 是MCP服务器入口点(stdio),而不是一次性通知命令。
设置:Codex
将此添加到 ~/.codex/config.toml:
[mcp_servers.notifications]
enabled = true
command = "mcp-notifications"
args = []配置更新后重新启动Codex。
设置:Claude代理
将MCP服务器配置添加到Claude客户端配置文件中:
{
"mcpServers": {
"notifications": {
"command": "mcp-notifications",
"args": []
}
}
}然后重新启动Claude客户端。
AI代理通知说明
通知有两种方法:手动和自动。
选择一个更适合您工作流程的。
手册
在您希望收到通知的任务中,明确询问代理。例子:
Count files in the project; after the task is fully complete, notify me with sound.您还可以在特定聊天中定义声音、主题和频率规则。例子:
Notify me about your replies without sound, include the reply text, and use title: "Large Refactoring"自动
自动通知可以全局配置或按项目配置。
启用代理回复自动通知的示例说明:
Send `send_notification` after your replies (actual task time >5 seconds or many steps); `play_sound: false`; `app_id: '{put your chat name here}'`时间是一个粗略的阈值,取决于模型行为,因此请根据自己的喜好调整此指令。
在技能
您还可以在特定技能中启用通知。复习技能示例:
After the review, run `send_notification` with a short summary; `play_sound: true`; `app_id: 'Reviewer {put task id here}'`工具
send_notification
输入:
titlestring(必填)messagestring(必填)play_soundboolean(可选,默认值:false)iconstring(可选,图像文件的绝对或相对路径)app_idstring(可选,吐司来源的Windows应用程序用户模型ID)
例子:
{
"title": "Codex",
"message": "Deployment completed successfully",
"play_sound": true,
"icon": "/opt/mcp-notifications/icons/custom.png",
"app_id": "Topvisor.Codex"
}app_id(Windows)
app_id控制Windows吐司通知中显示的源。- 如果
app_id未设置,Windows可能会显示SnoreToast作为来源。 - 你可以通过
app_id在每个工具调用或集合中MCP_NOTIFICATIONS_APP_ID作为服务器的环境变量。
聊天提示在Codex中进行测试
直接在聊天中使用这些消息:
Check send_notificationSend a notification without sound: title "Test", message "Check"Send a notification with sound: title "Test", message "Check"Send a notification with app_id "Topvisor.Codex": title "Test", message "Check"Send 3 test notifications in a row without sound日志/响应中的预期工具结果:
Notification queued行为
- ✅ 使用标准系统通知通道。
- 🔊 在以下情况下使用标准系统通知声音
play_sound: true. - 🤖 使用捆绑的Topvisor机器人图像作为默认通知图标。
- 🧰 在后台队列中传递通知时快速返回。
示例
AI代理正在等待您:
