一个模型上下文协议(MCP)服务器,使AI助手能够触发macOS的通知、声音和语音播报。
最快的方式是使用uvx,它可以在不进行永久安装的情况下运行包:
# 如果没有安装uv,请先安装
curl -LsSf https://astral.sh/uv/install.sh | sh
# 直接运行MCP服务器(无需安装)
uvx macos-notification-mcp
在你的Claude Desktop配置中添加以下内容(~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"macos-notification-mcp": {
"command": "uvx",
"args": ["macos-notification-mcp"]
}
}
}
然后重启Claude Desktop。
标准安装:
pip install macos-notification-mcp
从源码安装:
git clone https://github.com/devizor/macos-notification-mcp
cd macos-notification-mcp
pip install .
sound_notification(sound_name="Submarine")
可用的声音:Basso, Blow, Bottle, Frog, Funk, Glass, Hero, Morse, Ping, Pop, Purr, Sosumi, Submarine, Tink
banner_notification(
title="任务完成",
message="您的分析已完成",
subtitle=None, # 可选
sound=False, # 可选:与通知一起播放声音
sound_name=None # 可选:指定系统声音
)
speak_notification(
text="进程已完成",
voice=None, # 可选:使用的系统语音
rate=150, # 可选:每分钟单词数(默认:150)
volume=1.0 # 可选:音量级别 0.0-1.0
)
list_available_voices() # 列出所有可用的文本到语音的语音
test_notification_system() # 测试所有通知方法
afplay, osascript, say)MIT 许可证