](https://mseep.ai/app/turlockmike-apple-notifier-mcp)
苹果通知器MCP服务器
](https://smithery.ai/server/apple-notifier-mcp) 通过任何兼容MCP的客户端(如Claude Desktop或Cline)发送本地macOS通知并与系统对话框交互。
先决条件
- macOS
- Node.js>=18
- MCP兼容客户端(Claude Desktop,Cline)
故障排除:通知未出现
要显示通知,运行MCP服务器的终端或应用程序需要macOS中的通知权限。
授予通知权限
- 对于Claude Desktop用户:
- 打开 系统偏好设置 (或 系统设置 在macOS Ventura+上) - 首选 通知 - 找到 节点 或 终端通知器 (以出现者为准) - 启用 允许通知 - 将警报样式设置为 横幅 或 警报
- 对于Claude Code/Terminal用户:
- 打开 系统偏好设置 > 通知 - 找到 终端 (或 iTerm 如果使用iTerm2) - 启用 允许通知
- 如果应用程序未出现在通知设置中:
- 在终端中手动运行测试通知:
osascript -e 'display notification "Test" with title "Hello"'- 这应该会触发macOS提示或注册通知权限 - 然后再次检查系统首选项
- 检查对焦模式/请勿打扰:
- 确保未启用聚焦模式或请勿打扰 - 检查菜单栏中的控制中心
验证通知是否有效
使用前通过MCP从终端进行测试:
osascript -e 'display notification "Test message" with title "Test title"'如果显示通知,则MCP服务器应正常工作。
安装
通过Smithery安装
通过以下方式自动安装适用于Claude Desktop的Apple Notifier 史密瑟里:
npx -y @smithery/cli install apple-notifier-mcp --client claude手动安装
- 全局安装软件包:
npm install -g apple-notifier-mcp- 添加到MCP配置文件中:
对于克莱恩(cline_mcp_settings.json):
{
"mcpServers": {
"apple-notifier": {
"command": "apple-notifier-mcp"
}
}
}适用于克劳德桌面(claude_desktop_config.json):
{
"mcpServers": {
"apple-notifier": {
"command": "apple-notifier-mcp"
}
}
}特性
发送通知
显示具有可自定义内容的原生macOS通知。
参数:
title(必填):string-通知的标题message(必填):string-主要消息内容subtitle(可选):string-要显示的字幕sound(可选):boolean-是否播放默认通知声音(默认值:true)
显示提示
显示交互式对话框提示以获取用户输入。
参数:
message(必需):string-要在提示对话框中显示的文本defaultAnswer(可选):string-预填充的默认文本buttons(可选):string\[\]-自定义按钮标签(最多3个)icon(可选):“注意”|“停止”|“警告”-要显示的图标
文本转语音
使用macOS文本转语音功能。
参数:
text(必填):string-要说话的文本voice(可选):string-要使用的语音(默认为系统语音)rate(可选):number-语速(-50到50,默认为0)
拍摄屏幕截图
使用macOS屏幕截图捕获屏幕截图。
参数:
path(必填):string-保存屏幕截图的路径type(必填):“全屏”|“窗口”|“选择”-屏幕截图类型format(可选):“png”|“jpg”|“pdf”|“tiff”-图像格式hideCursor(可选):boolean-是否隐藏光标shadow(可选):boolean-是否包含窗口阴影(仅适用于窗口类型)timestamp(可选):boolean-在文件名中添加时间戳
文件选择
打开本机macOS文件选择器对话框。
参数:
prompt(可选):string-提示消息defaultLocation(可选):string-默认目录路径fileTypes(可选):object-文件类型过滤器(例如,{“public.image”:\[“png”,“jpg”\]})multiple(可选):boolean-允许选择多个文件
示例用法
// Send a notification
await client.use_mcp_tool("apple-notifier", "send_notification", {
title: "Hello",
message: "World",
sound: true
});
// Show a prompt
const result = await client.use_mcp_tool("apple-notifier", "prompt_user", {
message: "What's your name?",
defaultAnswer: "John Doe",
buttons: ["OK", "Cancel"]
});
// Speak text
await client.use_mcp_tool("apple-notifier", "speak", {
text: "Hello, world!",
voice: "Samantha",
rate: -20
});
// Take a screenshot
await client.use_mcp_tool("apple-notifier", "take_screenshot", {
path: "screenshot.png",
type: "window",
format: "png"
});
// Select files
const files = await client.use_mcp_tool("apple-notifier", "select_file", {
prompt: "Select images",
fileTypes: {
"public.image": ["png", "jpg", "jpeg"]
},
multiple: true
});贡献
看 贡献.md 用于开发设置和指南。
运行评估
evals包加载一个mcp客户端,然后运行index.ts文件,因此不需要在测试之间重建。您可以通过在npx命令前加前缀来加载环境变量。可以找到完整的文档 这里.
OPENAI_API_KEY=your-key npx mcp-eval src/evals/evals.ts src/index.ts许可证
MIT许可证-请参阅 许可证 文件以获取详细信息。
