/ 目錄 / 演練場 / applescript-mcp
● 社群 peakmojo ⚡ 即開即用

applescript-mcp

作者 peakmojo · peakmojo/applescript-mcp

Execute AppleScript from Claude to control any macOS app — Notes, Calendar, Finder, Messages, and more.

applescript-mcp gives Claude the ability to run arbitrary AppleScript on macOS, providing programmatic control over system apps and services. It can create calendar events, manage notes, search files via Spotlight, take screenshots, control media playback, and run shell commands. Available in Python and Node.js, with Docker support for remote execution via SSH.

為什麼要用

核心特性

即時演示

實際使用效果

applescript-mcp.replay ▶ 就緒
0/0

安裝

選擇你的客戶端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "applescript-mcp": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/peakmojo/applescript-mcp"
      ]
    }
  }
}

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "applescript-mcp": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/peakmojo/applescript-mcp"
      ]
    }
  }
}

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "applescript-mcp": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/peakmojo/applescript-mcp"
      ]
    }
  }
}

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "applescript-mcp": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/peakmojo/applescript-mcp"
      ]
    }
  }
}

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "applescript-mcp",
      "command": "TODO",
      "args": [
        "See README: https://github.com/peakmojo/applescript-mcp"
      ]
    }
  ]
}

Continue 使用伺服器物件陣列,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "applescript-mcp": {
      "command": {
        "path": "TODO",
        "args": [
          "See README: https://github.com/peakmojo/applescript-mcp"
        ]
      }
    }
  }
}

加入 context_servers。Zed 儲存後熱重載。

claude mcp add applescript-mcp -- TODO 'See README: https://github.com/peakmojo/applescript-mcp'

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: applescript-mcp

How to create calendar events with natural language using applescript-mcp

👤 Mac users who want to manage their calendar via Claude ⏱ ~5 min beginner

何時使用: You want to quickly create, modify, or query calendar events without opening Calendar.app.

前置條件
  • macOS with SSH enabled — System Settings → Sharing → Remote Login
  • applescript-mcp installed — npx -y @peakmojo/applescript-mcp or uvx applescript-mcp
步驟
  1. Create an event
    Create a calendar event titled 'Team Standup' for tomorrow at 10am, 30 minutes long, in my Work calendar.✓ 已複製
    → Confirmation that the event was created with date and time
  2. Query upcoming events
    What events do I have this week?✓ 已複製
    → List of calendar events with times and titles

結果: Calendar events created and queried without leaving the chat.

注意事項
  • AppleScript uses calendar names that must match exactly — List available calendars first before creating events
搭配使用: filesystem

Search and organize files on your Mac with applescript-mcp

👤 Mac power users looking for file management automation ⏱ ~10 min intermediate

何時使用: You need to find scattered files across your Mac and organize them.

前置條件
  • applescript-mcp running — npx -y @peakmojo/applescript-mcp
步驟
  1. Search for files
    Use Spotlight to find all PDF files on my Mac modified in the last week.✓ 已複製
    → List of file paths matching the criteria
  2. Organize results
    Move all those PDFs into ~/Documents/Recent-PDFs/, creating the folder if needed.✓ 已複製
    → Confirmation of files moved

結果: Files found via Spotlight and organized into a designated folder.

注意事項
  • Spotlight index may be incomplete — Ensure Spotlight indexing is enabled for the relevant drives in System Settings
搭配使用: filesystem

組合

與其他 MCP 搭配,撬動十倍槓桿

applescript-mcp + filesystem

Use AppleScript to find files via Spotlight, then filesystem MCP to read and process their contents

Find all .md files modified today using Spotlight, then read and summarize each one.✓ 已複製
applescript-mcp + github

Create calendar reminders for upcoming GitHub PR review deadlines

Check my open PR review requests on GitHub and create calendar reminders for any that are overdue.✓ 已複製

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
run_applescript script: str Execute any AppleScript command on the connected Mac 0

成本與限制

運行它的成本

API 配額
No external API — runs locally on macOS
每次呼叫 Token 數
200–1000 tokens per script execution
費用
Free
提示
Keep scripts focused on one task per call to minimize token usage from large outputs.

安全

權限、密鑰、影響範圍

憑證儲存: SSH credentials needed for remote execution — store in env vars, not in config files
資料出站: All execution is local to the Mac. No external network calls unless your script makes them.

故障排查

常見錯誤與修復

AppleScript execution failed — not authorized

Grant Terminal (or your MCP host) access in System Settings → Privacy & Security → Automation and Accessibility.

驗證: osascript -e 'tell application "Finder" to get name of every disk'
SSH connection refused

Enable Remote Login in System Settings → Sharing. Verify SSH credentials are correct.

驗證: ssh your-user@localhost 'echo ok'
Application not responding to AppleScript

Some apps have limited or no AppleScript support. Check the app's AppleScript dictionary in Script Editor.

驗證: Open Script Editor → File → Open Dictionary → select the app

替代方案

applescript-mcp 對比其他方案

替代方案何時用它替代權衡
filesystem MCPYou only need file read/write without controlling macOS appsMuch narrower scope but no system-level access risks

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills