devizor
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"macos-notification-mcp": {
"args": [
"macos-notification-mcp"
],
"command": "uvx"
}
}
}
可用工具 (5 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
sound_notification
Play a system sound notification.Args: sound_name: Name of the system sound to play (default: Submarine) Options: Basso, Blow, Bottle, Frog, Funk, Glass, Hero, Morse, Ping, Pop, Purr, Sosumi, Submarine, TinkReturns: A message indicating whether the sound was played successfully
该工具无需必填参数,直接调用即可
banner_notification
Display a banner notification on macOS.Args: title: The title of the notification message: The main content of the notification subtitle: Optional subtitle for the notification sound: Whether to play a sound with the notification (default: False) sound_name: Optional system sound to play (default: None, uses system default)Returns: A message indicating the notification was sent
该工具无需必填参数,直接调用即可
speak_notification
Use macOS text-to-speech to speak a message.Args: text: The text to speak voice: Optional voice to use (default: system default) rate: Speech rate, words per minute (default: 150) volume: Volume level from 0.0 to 1.0 (default: 1.0)Returns: A message indicating the text was spoken
该工具无需必填参数,直接调用即可
list_available_voices
List all available text-to-speech voices on the system.Returns: A string listing all available voices
该工具无需必填参数,直接调用即可
test_notification_system
Test the notification system by trying all notification methods.Returns: A diagnostic report of the notification system
该工具无需必填参数,直接调用即可
服务介绍
🔔 macOS 通知 MCP
一个模型上下文协议(MCP)服务器,使 AI 助手能够触发 macOS 通知、声音和文本转语音。
✨ 特性
- 🔊 声音通知:播放系统声音,如 Submarine、Ping 或 Tink
- 💬 横幅通知:显示带有可自定义标题、消息和副标题的视觉通知
- 🗣️ 语音通知:将文本转换为语音,并可调整语音、语速和音量
- 🎙️ 语音管理:列出并选择可用的系统语音
- 🧪 测试工具:诊断工具以验证所有通知方法
🚀 使用 uvx 快速开始(推荐)
使用此工具最快的方法是通过 uvx,它可以在不永久安装的情况下运行包:
bash
如果你还没有安装 uv,请先安装
curl -LsSf https://astral.sh/uv/install.sh | sh
直接运行 MCP 服务器(无需安装)
uvx macos-notification-mcp
⚙️ 配置 Claude Desktop
将以下内容添加到你的 Claude Desktop 配置文件中(~/Library/Application Support/Claude/claude_desktop_config.json):
json
{
"mcpServers": {
"macos-notification-mcp": {
"command": "uvx",
"args": ["macos-notification-mcp"]
}
}
}
然后重启 Claude Desktop。
📦 其他安装方法
标准安装:
bash
pip install macos-notification-mcp
从源代码安装:
bash
git clone https://github.com/devizor/macos-notification-mcp
cd macos-notification-mcp
pip install .
🛠️ 可用的通知工具
🔊 声音通知
python
sound_notification(sound_name="Submarine")
可用的声音:Basso, Blow, Bottle, Frog, Funk, Glass, Hero, Morse, Ping, Pop, Purr, Sosumi, Submarine, Tink
💬 横幅通知
python
banner_notification(
title="任务完成",
message="您的分析已准备好",
subtitle=None, # 可选
sound=False, # 可选:随通知播放声音
sound_name=None # 可选:指定系统声音
)
🗣️ 语音通知
python
speak_notification(
text="进程已完成",
voice=None, # 可选:使用的系统语音
rate=150, # 可选:每分钟单词数(默认:150)
volume=1.0 # 可选:音量级别 0.0-1.0
)
🎙️ 语音管理
python
list_available_voices() # 列出所有可用的文本转语音语音
🧪 测试
python
test_notification_system() # 测试所有通知方法
🔒 实现细节
- ⏱️ 速率限制:通知一次处理一个,最小间隔为 0.5 秒
- 🔄 队列:多个通知请求按顺序处理
- 🪟 操作系统集成:使用原生 macOS 命令 (
afplay,osascript,say) - 🔌 FastMCP:基于 FastMCP 框架构建,用于 AI 通信
⚠️ 故障排除
- 🔐 权限:确保在系统设置 → 通知中允许通知
- ⏳ 时间:每次只处理一个通知
- 🌐 环境:如果直接使用命令(而不是 uvx),可能需要使用完整路径
📄 许可证
MIT 许可证