loading…
Search for a command to run...
loading…
Enables the execution of AppleScript and JavaScript for Automation (JXA) on macOS to control applications, system events, and shell commands. It provides native
Enables the execution of AppleScript and JavaScript for Automation (JXA) on macOS to control applications, system events, and shell commands. It provides native automation capabilities with a security layer that permits most operations while specifically blocking file deletion commands.
macOS の osascript(AppleScript / JavaScript for Automation)を実行できる MCP サーバーです。
.mcpb ファイルをダウンロードClaude Desktop の設定ファイル(~/Library/Application Support/Claude/claude_desktop_config.json)に追加:
{
"mcpServers": {
"osascript": {
"command": "node",
"args": ["/path/to/osascript-mcp/server/index.js"],
"env": {
"OSASCRIPT_TIMEOUT": "30000",
"OSASCRIPT_LOG_SCRIPTS": "true"
}
}
}
}
tell application "Finder" to get name of every disk
Application("System Events").processes().map(p => p.name())
以下の操作は全て許可されています:
do shell script "ls -la ~/Desktop"
do shell script "whoami"
do shell script "curl -s https://api.github.com"
do shell script "cat ~/.zshrc"
tell application "Finder" to get name of every disk
tell application "Finder" to get every file of desktop
tell application "Finder" to open folder "Documents" of home
tell application "System Events" to get name of every process
tell application "System Events" to keystroke "hello"
tell application "System Events" to key code 36 -- Enter
tell application "Safari" to get URL of current tab of window 1
tell application "Music" to get name of current track
tell application "Calendar" to get events of calendar 1
以下の削除操作のみがブロックされます:
-- これらはブロックされます
do shell script "rm test.txt"
do shell script "rm -rf ~/test"
do shell script "rmdir testdir"
-- これらはブロックされます
tell application "Finder" to delete file "test.txt" of desktop
move file "test.txt" to trash
empty trash
| オプション | 説明 | デフォルト |
|---|---|---|
timeout |
スクリプト実行タイムアウト(ミリ秒) | 30000 |
log_scripts |
スクリプトをログ出力するか | true |
# 依存関係インストール
npm install
# ローカルテスト
npm start
# MCPB パッケージ作成
npm install -g @anthropic-ai/mcpb
mcpb validate manifest.json
mcpb pack .
# 許可されるスクリプトのテスト
echo 'tell application "Finder" to get name of every disk' | node server/index.js
# サーバーの直接実行(デバッグ用)
node server/index.js
このサーバーは「最小限のセキュリティ」設計を採用しています:
ls, curl, cat など)keystroke, key code)rm, delete, trash などの削除操作より厳格なセキュリティが必要な場合は、server/index.js の BLOCKED_PATTERNS を編集してください。
MIT
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"osascript-mcp-server": {
"command": "npx",
"args": []
}
}
}