MCP通知服务

为MCP代理提供桌面通知功能,用于任务完成、失败和重要更新的提醒。

  • by Artemeey
  • JavaScript
  • 本地部署
  • 2 星标
  • 更新于
在 GitHub 查看 artemeey/mcp-notifications

使用说明

mcp通知

🚀 船更快。什么都不错过。

mcp-notifications 允许您的MCP代理发送已完成任务、失败和重要更新的桌面通知。

这对控制台AI代理特别有用,因为默认情况下它们通常没有内置通知。

不再每分钟查看聊天记录。
不再有无声的代理响应。
在您的桌面上提供直观、可靠的反馈。 🔔

这解决了一个常见问题

你给几个人工智能代理分配任务,然后等待并不断检查谁已经回复了。

随着 mcp-notifications,这变得更简单:代理可以在需要您的输入或工作时在桌面上通知您 完成了。

为什么团队要安装这个

  • ⚡ 来自MCP工作流程的即时反馈。
  • 🧠 更好的专注:让代理人在你专注于主要任务的同时工作。
  • 🖥️ 通过以下方式发送本地操作系统通知 node-notifier.
  • 🧵 非阻塞行为:通知发送在后台排队。

全局安装

要求:

  • Node.js >=20
  • npm >=10
npm i -g @topvisor/mcp-notifications

可执行文件名(在MCP配置中使用):

mcp-notifications

mcp-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

输入:

  • title string (必填)
  • message string (必填)
  • play_sound boolean (可选,默认值: false)
  • icon string (可选,图像文件的绝对或相对路径)
  • app_id string (可选,吐司来源的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_notification
Send 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代理正在等待您: