关于 AppleScript MCP Server (Dual access: python and node.js)
AppleScript MCP Server 是一个通过 AppleScript 控制 Mac 的 MCP 服务,提供 Python 和 Node.js 两种接入方式。项目设计力求简单,安装配置成本低。
主要功能
- 01执行 AppleScript 访问 Mac 应用与数据
- 02支持备忘录、日历、通讯录、信息等应用
- 03通过 Spotlight 或 Finder 搜索文件
- 04读写文件内容并执行 shell 命令
- 05支持通过 SSH 远程执行
适用场景
- 01让 AI 助手创建提醒事项或日历日程
- 02通过自然语言整理文件和备忘录
- 03在 Docker 容器中远程控制宿主 Mac
MCP 相关
该项目是一个 MCP 服务,向 MCP 客户端(如 Claude Desktop)暴露 AppleScript 执行能力,客户端可借此操作本机应用和文件。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
AppleScript MCP 服务(双重访问:python 和 node.js)
概述
一个可让你运行 AppleScript 代码以与 Mac 交互的模型上下文协议(MCP)服务。这个 MCP 服务特意设计得简洁、直观且易于使用,并且只需极少的配置。
它简单又强大,令人难以置信。核心代码不到 100 行。
https://github.com/user-attachments/assets/b85e63ba-fb26-4918-8e6d-2377254ee388
功能
- 运行 AppleScript 以访问 Mac 应用和数据
- 与 Notes、Calendar、Contacts、Messages 等应用交互
- 使用 Spotlight 或 Finder 搜索文件
- 读取/写入文件内容并执行 shell 命令
- 支持通过 SSH 远程执行
示例提示词
Create a reminder for me to call John tomorrow at 10am
Add a new meeting to my calendar for Friday from 2-3pm titled "Team Review"
Create a new note titled "Meeting Minutes" with today's date
Show me all files in my Downloads folder from the past week
What's my current battery percentage?
Show me the most recent unread emails in my inbox
List all the currently running applications on my Mac
Play my "Focus" playlist in Apple Music
Take a screenshot of my entire screen and save it to my Desktop
Find John Smith in my contacts and show me his phone number
Create a folder on my Desktop named "Project Files"
Open Safari and navigate to apple.com
Tell me how much free space I have on my main drive
List all my upcoming calendar events for this week
在 Claude Desktop 中使用
Node.js
{
"mcpServers": {
"applescript_execute": {
"command": "npx",
"args": [
"@peakmojo/applescript-mcp"
]
}
}
}
Python(uvx)
无需克隆——直接从 git 仓库运行:
{
"mcpServers": {
"applescript_execute": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/peakmojo/applescript-mcp",
"mcp-server-applescript"
]
}
}
}
Python(本地开发)
如需本地开发,请克隆仓库并使用 uv 从源代码运行:
brew install uv
git clone https://github.com/peakmojo/applescript-mcp.git
{
"mcpServers": {
"applescript_execute": {
"command": "uv",
"args": [
"--directory",
"/path/to/your/repo",
"run",
"mcp-server-applescript"
]
}
}
}
开发
设置
brew install uv
uv sync --dev
并行运行所有检查
uv run check
此命令会并行运行 lint、格式化、类型检查和测试,测试覆盖率为 100%。
单独运行各项命令
uv run lint # ruff linter
uv run format # ruff auto-format
uv run typecheck # pyrefly type checker
uv run test # pytest with 100% coverage enforcement
Docker 使用方法
在 Docker 容器中运行时,可以使用特殊主机名 host.docker.internal 连接到 Mac 主机:
配置
{
"mcpServers": {
"applescript_execute": {
"command": "npx",
"args": [
"@peakmojo/applescript-mcp",
"--remoteHost", "host.docker.internal",
"--remoteUser", "yourusername",
"--remotePassword", "yourpassword"
]
}
}
}
这样 Docker 容器便可以在 Mac 主机系统上执行 AppleScript。请确保:
- Mac 已启用 SSH(系统设置 → 共享 → 远程登录)
- 你的用户拥有适当的权限
- 配置中提供了正确的凭据
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。