
运行 Applescript 的 MCP 服务器,让你完全控制你的 Mac
概览
一个模型上下文协议(MCP)服务器,允许你运行 AppleScript 代码与 Mac 交互。该 MCP 有意设计得简单、直接、直观,且设置极少。 我简直不敢相信它竟然这么简单又强大。核心代码有<100行。 https://github.com/user-attachments/assets/b85e63ba-fb26-4918-8e6d-2377254ee388 * 运行 AppleScript 访问 Mac 应用程序和数据 * 与笔记、日历、联系人、消息等交互 * 使用 Spotlight 或 Finder 搜索文件 * 读写文件内容并执行 shell 命令 * 支持通过 SSH 进行远程执行 不需要克隆——直接从 git 仓库运行: 本地开发时,克隆仓库并用 UV 从源码运行: 它运行 linting、格式化、类型检查和测试,覆盖率达到 100% ——全部并行进行。 在 Docker 容器中运行时,您可以使用特殊的主机名 host.docker.internal 连接到你的 Mac 主机:
概述(AI 翻译)
概述
一个模型上下文协议(MCP)服务器,允许你运行 AppleScript 代码与 Mac 交互。该 MCP 有意设计得简单、直接、直观,且设置极少。
我简直不敢相信它这么简单又强大。核心代码
https://github.com/user-attachments/assets/b85e63ba-fb26-4918-8e6d-2377254ee388
特色
- 运行 AppleScript 访问 Mac 应用程序和数据
- 与笔记、日历、联系人、消息等互动
- 使用Spotlight或Finder搜索文件
- 读写文件内容并执行shell命令
- 通过SSH支持远程执行
示例提示
使用 Claude Desktop
Node.js
Python (UVX)
不需要克隆——直接从 git 仓库运行:
Python(本地开发)
本地开发时,克隆仓库并使用 uv 从源代码运行:
发展
布置
并行运行所有检查
它运行 linting、格式化、类型检查和测试,覆盖率达到 100% ——全部并行进行。
个别指令
Docker 使用
在 Docker 容器中运行时,您可以使用特殊的主机名 host.docker.internal 连接到您的 Mac 主机:
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
AppleScript MCP Server (Dual access: python and node.js)
Overview
A Model Context Protocol (MCP) server that lets you run AppleScript code to interact with Mac. This MCP is intentionally designed to be simple, straightforward, intuitive, and require minimal setup.
I can’t believe how simple and powerful it is. The core code is <100 line of code.
https://github.com/user-attachments/assets/b85e63ba-fb26-4918-8e6d-2377254ee388
Features
- Run AppleScript to access Mac applications and data
- Interact with Notes, Calendar, Contacts, Messages, and more
- Search for files using Spotlight or Finder
- Read/write file contents and execute shell commands
- Remote execution support via SSH
Example Prompts
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
Usage with Claude Desktop
Node.js
{
"mcpServers": {
"applescript_execute": {
"command": "npx",
"args": [
"@peakmojo/applescript-mcp"
]
}
}
}
Python (uvx)
No clone needed — run directly from the git repo:
{
"mcpServers": {
"applescript_execute": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/peakmojo/applescript-mcp",
"mcp-server-applescript"
]
}
}
}
Python (local development)
For local development, clone the repo and use uv to run from source:
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"
]
}
}
}
Development
Setup
安装
npx @peakmojo/applescript-mcp配置
{
"mcpServers": {
"applescript_execute": {
"command": "npx",
"args": [
"@peakmojo/applescript-mcp"
]
}
}
}