MCP 通知服务器是一个强大的工具,它能在代理任务完成时,通过系统桌面通知和提示音及时提醒用户。该服务器基于标准 MCP 协议,支持跨平台使用,可与各种 LLM 客户端集成,为用户带来便捷的使用体验。
git clone https://github.com/Cactusinhand/mcp_server_notify.git
cd mcp_server_notify
uv venv
source .venv/Scripts/activate
uv pip install mcp-server-notify
# 或者
pip install mcp-server-notify
安装完成后,可直接调用模块以检查是否安装成功:
python -m mcp_server_notify
此模块接受 --debug 或 --file 选项,使用示例如下:
python -m mcp_server_notify --debug
python -m mcp_server_notify --debug --log-file=path/to/logfile.log
我们使用Apprise API来发送桌面通知,因此需要在桌面上安装一些特殊要求。
Windows
# Windows的最低要求
pip install pywin32
macOS
# 确保终端 notifier 已安装到系统中
brew install terminal-notifier
找到配置文件 claude_desktop_config.json
{
"mcpServers": {
"NotificationServer": {
"command": "uv",
"args": [
"--directory",
"path/to/your/mcp_server_notify 项目",
"运行",
"mcp-server-notify",
]
}
}
}
如果全局安装,也可以使用python命令:
{
"mcpServers": {
"NotificationServer": {
"command": "python",
"args": [
"-m",
"mcp_server_notify",
]
}
}
}
找到配置文件 ~/.cursor/mcp.json 或 your_project/.cursor/mcp.json
{
"mcpServers": {
"NotificationServer": {
"command": "uv",
"args": [
"--directory",
"path/to/your/mcp_server_notify 项目",
"运行",
"mcp-server-notify",
]
}
}
}
配置完成后,只需在任务输入的末尾添加类似 最后,请在任务完成时通知我。 的提示词即可触发通知。在Cursor中,可以在 Cursor 设置 -> 规则 中将此提示词作为规则添加,这样就不用每次手动输入了。
由于环境兼容性问题,目前不可用。如果Docker容器需要无论宿主机OS是Windows、macOS还是Linux都能触发宿主通知,解决方案变得复杂得多,通常直接使用原生通知不可行。
主要问题: