一个在代理任务完成后发送带有声音效果的桌面通知的MCP服务器。
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
# 确保终端通知程序已安装到您的系统中
brew install terminal-notifier
找到配置文件 claude_desktop_config.json
{
"mcpServers": {
"NotificationServer": {
"command": "uv",
"args": [
"--directory",
"path/to/your/mcp_server_notify project",
"run",
"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 project",
"run",
"mcp-server-notify",
]
}
}
}
配置完成后,在任务输入结束时添加类似 最后,请在任务完成时给我发送通知。 的提示来触发通知。
在 Cursor 中,您可以在 Cursor 设置 -> 规则 中添加此提示作为规则,这样每次就不必手动输入了。
安装服务管理器 uv/uvx:
pip install uv
将服务添加到 VSCode 设置中:
Windows %APPDATA%\Code\User\settings.json
macOS $HOME/Library/Application\ Support/Code/User/settings.json
Linux $HOME/.config/Code/User/settings.json
"mcp": {
"servers": {
"notifier": {
"command": "uvx",
"args": [
"mcp-server-notify"
],
"env": {}
}
}
}
确保您正在使用最新版本的 VSCode —— 它会自动运行 MCP 服务
打开 VSCode → 启用 Copilot → 切换到代理模式。
输入 # → 您将看到 #send_notification 选项。
请求代理:运行 #send_notification(它将自动处理通知)。
现在,代理模式下的 Copilot 可以发送桌面通知。
由于环境兼容性问题,目前不可用。 如果 Docker 容器需要触发主机通知,无论主机操作系统是 Windows、macOS 还是 Linux,解决方案变得更加复杂,通常直接使用原生通知不可行。
主要问题:
操作系统特定的通知系统 每个操作系统(Windows、macOS、Linux)都有其独特的通知机制。
Docker 隔离 Docker 容器的隔离限制了它们直接访问主机操作系统资源的能力。
依赖管理 需要处理每个操作系统的不同通知库和依赖项。
MIT
欢迎提交问题和拉取请求!