苹果通知器

@turlockmike/apple-notifier-mcp
1 Stars 385 次浏览 turlockmike 更新于 2026-08-23

一个简单的MCP服务器,可以在mac设备上发送通知。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "apple-notifier": {
      "command": "apple-notifier-mcp"
    }
  }
}

可用工具 (5 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

send_notification 4 个参数 需填 2 项

Send a notification on macOS using osascript

必填参数:title、message

prompt_user 4 个参数 需填 1 项

Display a dialog prompt to get user input

必填参数:message

speak 3 个参数 需填 1 项

Speak text using macOS text-to-speech

必填参数:text

take_screenshot 6 个参数 需填 2 项

Take a screenshot using macOS screencapture

必填参数:path、type

select_file 4 个参数

Open native file picker dialog

该工具无需必填参数,直接调用即可

服务介绍

Apple Notifier MCP 服务器

smithery 徽章
通过任何与 MCP 兼容的客户端(如 Claude Desktop 或 Cline)发送原生 macOS 通知并与系统对话框交互。

前提条件

  • macOS
  • Node.js >= 18
  • 一个与 MCP 兼容的客户端(Claude Desktop, Cline)

安装

通过 Smithery 安装

要通过 Smithery 自动为 Claude Desktop 安装 Apple Notifier:

npx -y @smithery/cli install apple-notifier-mcp --client claude

手动安装

  1. 全局安装包:
npm install -g apple-notifier-mcp
  1. 添加到你的 MCP 配置文件中:

对于 Cline (cline_mcp_settings.json):

{
  "mcpServers": {
    "apple-notifier": {
      "command": "apple-notifier-mcp"
    }
  }
}

对于 Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "apple-notifier": {
      "command": "apple-notifier-mcp"
    }
  }
}

功能

发送通知

显示具有可自定义内容的原生 macOS 通知。

参数:

  • title (必需): 字符串 - 通知的标题
  • message (必需): 字符串 - 主消息内容
  • subtitle (可选): 字符串 - 要显示的副标题
  • sound (可选): 布尔值 - 是否播放默认通知声音 (默认: true)

显示提示

显示交互式对话框提示以获取用户输入。

参数:

  • message (必需): 字符串 - 在提示对话框中显示的文本
  • defaultAnswer (可选): 字符串 - 预填充的默认文本
  • buttons (可选): 字符串[] - 自定义按钮标签 (最多3个)
  • icon (可选): 'note' | 'stop' | 'caution' - 要显示的图标

文本转语音

使用 macOS 的文本转语音功能。

参数:

  • text (必需): 字符串 - 要朗读的文本
  • voice (可选): 字符串 - 使用的声音 (默认为系统声音)
  • rate (可选): 数字 - 语速 (-50 到 50, 默认为 0)

截图

使用 macOS 的截图工具捕获屏幕截图。

参数:

  • path (必需): 字符串 - 保存截图的路径
  • type (必需): 'fullscreen' | 'window' | 'selection' - 截图类型
  • format (可选): 'png' | 'jpg' | 'pdf' | 'tiff' - 图像格式
  • hideCursor (可选): 布尔值 - 是否隐藏光标
  • shadow (可选): 布尔值 - 是否包含窗口阴影 (仅适用于窗口类型)
  • timestamp (可选): 布尔值 - 将时间戳添加到文件名

文件选择

打开原生 macOS 文件选择器对话框。

参数:

  • prompt (可选): 字符串 - 提示信息
  • defaultLocation (可选): 字符串 - 默认目录路径
  • fileTypes (可选): 对象 - 文件类型过滤器 (例如,{"public.image": ["png", "jpg"]})
  • multiple (可选): 布尔值 - 允许多文件选择

示例用法

// 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
});

贡献

有关开发设置和指南,请参阅 CONTRIBUTING.md

许可证

MIT 许可证 - 详情请参阅 LICENSE 文件。

相关 MCP 服务