Apple Shortcuts MCP Server 使用说明

项目简介

Apple Shortcuts MCP Server 是一个基于 Model Context Protocol (MCP) 构建的服务器,旨在让AI助手(如 Claude Desktop)安全地控制 macOS 快捷指令应用。通过这个服务器,AI助手可以列出可用的快捷指令并执行它们,从而实现各种自动化任务。

主要功能点

  • 列出快捷指令:允许AI助手获取当前 macOS 系统中安装的所有快捷指令名称。
  • 运行快捷指令:允许AI助手通过指定快捷指令名称和可选的输入参数来执行快捷指令,实现自动化操作。

安装步骤

  1. 安装 Node.js: 确保你的 macOS 系统上安装了 Node.js (v18 或更高版本)。你可以从 Node.js 官网 下载并安装。
  2. 安装 Claude Desktop: 确保你已经安装了 Claude Desktop 客户端,以便配置和使用 MCP 服务器。
  3. 克隆仓库: 打开终端,执行以下命令克隆 Apple Shortcuts MCP Server 仓库到本地:
    git clone [email protected]:recursechat/mcp-server-apple-shortcuts.git
  4. 安装依赖: 进入克隆下来的仓库目录,执行以下命令安装项目依赖:
    cd mcp-server-apple-shortcuts
    npm install
  5. 构建项目: 执行以下命令构建项目:
    npm run build

服务器配置

要让 Claude Desktop 连接到 Apple Shortcuts MCP Server,你需要配置 Claude Desktop 的 'mcpServers' 部分。以下是配置信息,请将这段 JSON 代码添加到 Claude Desktop 的配置文件中:

{
  "mcpServers": {
    "apple-shortcuts": {
      "command": "npx",
      "args": ["-y", "mcp-server-apple-shortcuts"]
      // command: 启动 MCP 服务器的命令,这里使用 npx 执行 mcp-server-apple-shortcuts 包
      // args:  命令参数,-y 表示自动确认安装 mcp-server-apple-shortcuts 包
    }
  }
}

如果你选择本地构建并运行服务器,可以使用以下配置,请将 '/path/to/mcp-server-apple-shortcuts' 替换为你本地仓库的实际路径:

{
  "mcpServers": {
    "apple-shortcuts": {
      "command": "npx",
      "args": ["/path/to/mcp-server-apple-shortcuts/build/index.js"]
      // command: 启动 MCP 服务器的命令,这里使用 npx 执行本地构建的 index.js 文件
      // args:  命令参数,指向本地构建的 index.js 文件路径
    }
  }
}

基本使用方法

配置完成后,你可以在 Claude Desktop 中通过自然语言指令与快捷指令进行交互。

  • 列出快捷指令: 你可以向 Claude 提问 "list shortcuts" 或 "列出快捷指令" 等,服务器会将可用的快捷指令列表返回给 Claude。
  • 运行快捷指令: 你可以要求 Claude 运行特定的快捷指令,例如 "run shortcut get word of the day" 或 "运行快捷指令 get word of the day"。 如果快捷指令需要输入参数,你可以尝试在指令中提供,例如 "run shortcut play a song with input jazz music"。

请注意,首次使用时可能需要允许 Claude Desktop 或 Apple Shortcuts MCP Server 访问快捷指令应用。

信息

分类

桌面与硬件