Skip to main content
Glama

applescript-mcp

applescript-mcp MCP サーバー

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

特徴

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

計画されている機能

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

前提条件

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

利用可能なカテゴリ

カレンダー

指示説明パラメータ
addカレンダーイベントを作成titlestartDateendDatecalendar (オプション)
list今日のイベントを一覧表示するなし
// Create a new calendar event Create a calendar event titled "Team Meeting" starting tomorrow at 2pm for 1 hour // List today's events What events do I have scheduled for today?

クリップボード

指示説明パラメータ
set_clipboardクリップボードにコピーcontent
get_clipboardクリップボードの内容を取得するなし
clear_clipboardクリップボードをクリアなし
// Copy text to clipboard Copy "Remember to buy groceries" to my clipboard // Get clipboard contents What's currently in my clipboard? // Clear clipboard Clear my clipboard

ファインダ

指示説明パラメータ
get_selected_files選択したファイルを取得するなし
search_filesファイルを検索するquerylocation (オプション)
quick_lookプレビューファイルpath
// Get selected files in Finder What files do I currently have selected in Finder? // Search for files Find all PDF files in my Documents folder // Preview a file Show me a preview of ~/Documents/report.pdf

通知

注意: 通知を送信するには、システム設定 > 通知 > スクリプト エディターで通知を有効にする必要があります。

指示説明パラメータ
send_notification通知を表示titlemessagesound (オプション)
toggle_do_not_disturbDNDモードを切り替えるなし
// Send a notification Send me a notification with the title "Reminder" and message "Time to take a break" // Toggle Do Not Disturb Turn on Do Not Disturb mode

システム

指示説明パラメータ
volumeシステム音量を設定するlevel (0~100)
get_frontmost_appアクティブアプリを入手なし
launch_appアプリケーションを開くname
quit_app応募を締め切るnameforce (オプション)
toggle_dark_modeダークモードを切り替えるなし
// Set system volume Set my Mac's volume to 50% // Get active application What app am I currently using? // Launch an application Open Safari // Quit an application Close Spotify // Toggle dark mode Switch to dark mode

iTerm

指示説明パラメータ
paste_clipboardiTermに貼り付けなし
runコマンドを実行commandnewWindow (オプション)
// Paste clipboard to iTerm Paste my clipboard contents into iTerm // Run a command in iTerm Run "ls -la" in iTerm // Run a command in a new iTerm window Run "top" in a new iTerm window

ショートカット

指示説明パラメータ
run_shortcutショートカットを実行するnameinput (オプション)
list_shortcuts利用可能なショートカットをすべて一覧表示するlimit (オプション)
// List available shortcuts List all my available shortcuts // List with limit Show me my top 5 shortcuts // Run a shortcut Run my "Daily Note in Bear" shortcut // Run a shortcut with input Run my "Add to-do" shortcut with input "Buy groceries"

郵便

指示説明パラメータ
create_emailMail.appで新しいメールを作成するrecipientsubjectbody
list_emailsメールボックスからメールを一覧表示するmailbox (オプション)、 count (オプション)、 unreadOnly (オプション)
get_email検索で特定のメールを取得するsubject (オプション)、 sender (オプション)、 dateReceived (オプション)、 mailbox (オプション)、 account (オプション)、 unreadOnly (オプション)、 includeBody (オプション)
// Create a new email Compose an email to john@example.com with subject "Meeting Tomorrow" and body "Hi John, Can we meet tomorrow at 2pm?" // List emails Show me my 10 most recent unread emails // Get a specific email Find the email from sarah@example.com about "Project Update"

メッセージ

指示説明パラメータ
list_chats利用可能なiMessageとSMSチャットを一覧表示するincludeParticipantDetails (オプション、デフォルト: false)
get_messagesメッセージアプリからメッセージを受け取るlimit (オプション、デフォルト: 100)
search_messages特定のテキストを含むメッセージを検索するsearchTextsender (オプション)、 chatId (オプション)、 limit (オプション、デフォルト:50)、 daysBack (オプション、デフォルト:30)
compose_message事前に入力されたメッセージまたは自動送信でメッセージアプリを開きますrecipient (必須)、 body (オプション)、 auto (オプション、デフォルト:false)
// List available chats Show me my recent message conversations // Get recent messages Show me my last 20 messages // Search messages Find messages containing "dinner plans" from John in the last week // Compose a message Send a message to 555-123-4567 saying "I'll be there in 10 minutes"

注記

指示説明パラメータ
createマークダウンのようなフォーマットでメモを作成するtitlecontentformat (書式設定オプションはオプション)
createRawHtml直接HTMLコンテンツを含むメモを作成するtitlehtml
listオプションで特定のフォルダからメモを一覧表示しますfolder (オプション)
getタイトルで特定のメモを取得するtitlefolder (オプション)
search特定のテキストを含むメモを検索するqueryfolder (オプション)、 limit (オプション、デフォルト:5)、 includeBody (オプション、デフォルト:true)
// Create a new note with markdown formatting Create a note titled "Meeting Minutes" with content "# Discussion Points\n- Project timeline\n- Budget review\n- Next steps" and format headings and lists // Create a note with HTML Create a note titled "Formatted Report" with HTML content "<h1>Quarterly Report</h1><p>Sales increased by <strong>15%</strong></p>" // List notes Show me all my notes in the "Work" folder // Get a specific note Show me my note titled "Shopping List" // Search notes Find notes containing "recipe" in my "Cooking" folder

ページ

指示説明パラメータ
create_documentプレーンテキストで新しいPages文書を作成するcontent
// Create a new Pages document Create a Pages document with the content "Project Proposal\n\nThis document outlines the scope and timeline for the upcoming project."

建築

applescript-mcp サーバーは TypeScript を使用して構築されており、モジュール アーキテクチャに従います。

コアコンポーネント

  1. AppleScriptFramework ( framework.ts ): 次の機能を果たすメイン サーバー クラス:
    • MCPプロトコル通信を管理する
    • ツールの登録と実行を処理する
    • ログ機能を提供する
    • AppleScriptコマンドを実行する
  2. カテゴリ( src/categories/*.ts ): 機能別に整理されたモジュール式のスクリプト コレクション:
    • 各カテゴリには関連するスクリプト(カレンダー、システム、メモなど)が含まれています。
    • カテゴリはindex.tsでフレームワークに登録されます。
  3. ( src/types/index.ts ): 以下を定義する TypeScript インターフェース:
    • ScriptDefinition : 個々のスクリプトの構造
    • ScriptCategory : 関連スクリプトのコレクション
    • LogLevel : 標準のログレベル
    • FrameworkOptions : 構成オプション

実行フロー

  1. クライアントはMCPプロトコル経由でツール要求を送信します
  2. サーバーは適切なカテゴリとスクリプトを識別します
  3. スクリプトコンテンツが生成される(静的または関数を介して動的)
  4. AppleScriptはmacOSのosascriptコマンドを介して実行されます
  5. 結果がクライアントに返されます

ログシステム

このフレームワークには、次のような包括的なログ システムが含まれています。

  • stderr と MCP ログプロトコルの両方にログを記録します。
  • 複数の重大度レベル (デバッグ、情報、警告、エラーなど) をサポートします
  • トラブルシューティングのための詳細な実行情報を提供します

発達

設定

# 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);

高度なスクリプト開発

より複雑なスクリプトの場合は、次のことが可能です。

  1. 動的スクリプト生成を使用する:
    script: (args) => { // Process arguments and build script dynamically let scriptContent = `tell application "App"\n`; if (args.condition) { scriptContent += ` // Conditional logic\n`; } scriptContent += `end tell`; return scriptContent; }
  2. 複雑なデータの処理:
    // Example from Notes category function generateNoteHtml(args: any): string { // Process markdown-like syntax into HTML let processedContent = content; if (format.headings) { processedContent = processedContent.replace(/^# (.+)$/gm, '<h1>$1</h1>'); // ... } return processedContent; }

デバッグ

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

local-only server

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

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

  1. 特徴
    1. 計画されている機能
  2. 前提条件
    1. 利用可能なカテゴリ
      1. カレンダー
      2. クリップボード
      3. ファインダ
      4. 通知
      5. システム
      6. iTerm
      7. ショートカット
      8. 郵便
      9. メッセージ
      10. 注記
      11. ページ
    2. 建築
      1. コアコンポーネント
      2. 実行フロー
      3. ログシステム
    3. 発達
      1. 設定
      2. 新しい機能の追加
      3. 高度なスクリプト開発
    4. デバッグ
      1. MCPインスペクターの使用
      2. ログ記録
      3. 構成例
      4. よくある問題
    5. リソース
      1. 貢献
        1. ライセンス

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            Enables LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment
            Last updated -
            10
            327
            85
            JavaScript
            MIT License
            • Apple
          • A
            security
            F
            license
            A
            quality
            Enables LLMs to perform web browsing tasks, take screenshots, and execute JavaScript using Puppeteer for browser automation.
            Last updated -
            4
            15,502
            1
            JavaScript
          • A
            security
            F
            license
            A
            quality
            Enables browser automation for LLMs on Linux display servers, supporting web interaction, screenshots, and JavaScript execution in a real browser.
            Last updated -
            7
            5
            4
            JavaScript
            • Linux
          • -
            security
            A
            license
            -
            quality
            A comprehensive toolkit that enhances LLM capabilities through the Model Context Protocol, allowing LLMs to interact with external services including command-line operations, file management, Figma integration, and audio processing.
            Last updated -
            17
            Python
            Apache 2.0
            • Linux
            • Apple

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/joshrutkowski/applescript-mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server