applescript-mcp

by joshrutkowski
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Allows interaction with macOS through AppleScript, including calendar management, clipboard operations, Finder integration, system notifications, system controls, and iTerm terminal integration

  • Required as a prerequisite for running the MCP server

  • Planned feature to allow opening pages in Safari, saving page content, and getting selected page/tab

applescript-mcp MCP サーバー

LLMアプリケーションがAppleScriptを介してmacOSと連携できるようにするモデルコンテキストプロトコル(CMP)サーバー。このサーバーは、AIアプリケーションがシステム機能の制御、ファイルの管理、通知の処理などを行うための標準化されたインターフェースを提供します。

特徴

  • 🗓️ カレンダー管理(イベント、リマインダー)
  • 📋 クリップボード操作
  • 🔍 Finder との統合
  • 🔔 システム通知
  • ⚙️ システムコントロール(音量、ダークモード、アプリ)
  • 📟 iTerm ターミナル統合
  • 📬 メール(新しいメールの作成、メールの一覧表示、メールの取得)
  • 🔄ショートカットの自動化
  • 💬 メッセージ(チャットの一覧表示、メッセージの取得、メッセージの検索、メッセージの送信)

計画されている機能

  • 🧭 Safari(Safariで開く、ページコンテンツを保存、選択したページ/タブを取得する)
  • ✅ リマインダー(作成、取得)
  • 🗒️ メモ(作成、取得、リスト)

前提条件

  • macOS 10.15以降
  • Node.js 18以降

利用可能なカテゴリ

カレンダー

指示説明パラメータ
addカレンダーイベントを作成titlestartDateendDate
list今日のイベントを一覧表示するなし

クリップボード

指示説明パラメータ
set_clipboardクリップボードにコピーcontent
get_clipboardクリップボードの内容を取得するなし
clear_clipboardクリップボードをクリアなし

ファインダ

指示説明パラメータ
get_selected_files選択したファイルを取得するなし
search_filesファイルを検索するquerylocation (オプション)
quick_lookプレビューファイルpath

通知

指示説明パラメータ
send_notification通知を表示titlemessagesound (オプション)
toggle_do_not_disturbDNDモードを切り替えるなし

システム

指示説明パラメータ
volumeシステム音量を設定するlevel (0~100)
get_frontmost_appアクティブアプリを入手なし
launch_appアプリケーションを開くname
quit_app応募を締め切るnameforce (オプション)
toggle_dark_modeダークモードを切り替えるなし

iTerm

指示説明パラメータ
paste_clipboardiTermに貼り付けなし
runコマンドを実行commandnewWindow (オプション)

ショートカット

指示説明パラメータ
run_shortcutショートカットを実行するnameinput (オプション)

郵便

指示説明パラメータ
create_emailMail.appで新しいメールを作成するrecipientsubjectbody
list_emailsメールボックスからメールを一覧表示するmailbox (オプション)、 count (オプション)、 unreadOnly (オプション)
get_email検索で特定のメールを取得するsubject (オプション)、 sender (オプション)、 dateReceived (オプション)、 mailbox (オプション)、 account (オプション)、 unreadOnly (オプション)、 includeBody (オプション)

メッセージ

指示説明パラメータ
list_chats利用可能なiMessageとSMSチャットを一覧表示するincludeParticipantDetails (オプション)
get_messagesメッセージアプリからメッセージを受け取るlimit (オプション、デフォルト: 100)
search_messages特定のテキストを含むメッセージを検索するsearchTextsender (オプション)、 chatId (オプション)、 limit (オプション、デフォルト:50)、 daysBack (オプション、デフォルト:30)
compose_message事前に入力されたメッセージまたは自動送信でメッセージアプリを開きますrecipient (必須)、 body (オプション)、 auto (オプション、デフォルト:false)

発達

設定

# Install dependencies npm install # Build the server npm run build # Launch MCP Inspector # See: https://modelcontextprotocol.io/docs/tools/inspector npx @modelcontextprotocol/inspector node path/to/server/index.js args...

新しい機能の追加

1. カテゴリファイルを作成する

src/categories/newcategory.tsを作成します:

import { ScriptCategory } from "../types/index.js"; export const newCategory: ScriptCategory = { name: "category_name", description: "Category description", scripts: [ // Scripts will go here ], };

2. スクリプトを追加する

{ name: "script_name", description: "What the script does", schema: { type: "object", properties: { paramName: { type: "string", description: "Parameter description" } }, required: ["paramName"] }, script: (args) => ` tell application "App" // AppleScript code using ${args.paramName} end tell ` }

3. 登録カテゴリー

src/index.tsを更新します:

import { newCategory } from "./categories/newcategory.js"; // ... server.addCategory(newCategory);

デバッグ

MCPインスペクターの使用

MCP Inspector は、サーバーのテストとデバッグのための Web インターフェイスを提供します。

npm run inspector

ログ記録

環境変数を設定してデバッグ ログを有効にします。

DEBUG=applescript-mcp* npm start

構成例

npm run buildを実行した後、 mcp.jsonファイルに以下を追加します。

{ "mcpServers": { "applescript-mcp-server": { "command": "node", "args": ["/path/to/applescript-mcp/dist/index.js"] } } }

よくある問題

  • 権限エラー: システム環境設定 > セキュリティとプライバシーを確認してください
  • スクリプトの失敗: スクリプトエディタアプリで直接スクリプトをテストする
  • 通信の問題: stdio ストリームがリダイレクトされていないか確認してください

リソース

貢献

  1. リポジトリをフォークする
  2. 機能ブランチを作成する
  3. 変更をコミットする
  4. ブランチにプッシュする
  5. プルリクエストを作成する

ライセンス

MITライセンス - 詳細はライセンスを参照

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

LLM アプリケーションが AppleScript を通じて macOS と対話できるようにします。

  1. Features
    1. Planned Features
  2. Prerequisites
    1. Available Categories
      1. Calendar
      2. Clipboard
      3. Finder
      4. Notifications
      5. System
      6. iTerm
      7. Shortcuts
      8. Mail
      9. Messages
    2. Development
      1. Setup
      2. Adding New Functionality
    3. Debugging
      1. Using MCP Inspector
      2. Logging
      3. Example configuration
      4. Common Issues
    4. Resources
      1. Contributing
        1. License
          ID: 0t5gydjcqw