macOS GUI Control MCP
Enables comprehensive control over macOS GUI elements including mouse, keyboard, window management, and screen capture. It allows for automated system interactions and script execution while maintaining safety by blocking potentially destructive deletion commands.
README
macOS GUI Control MCP - Full Power Edition
macOS のマウス、キーボード、画面キャプチャをフル制御できる MCP サーバー。 削除系コマンドのみブロック、それ以外は全機能使用可能。
機能一覧
| カテゴリ | 機能 | 詳細 |
|---|---|---|
| 🖱️ マウス | mouse_click |
指定座標をクリック |
mouse_double_click |
ダブルクリック | |
mouse_right_click |
右クリック | |
mouse_move |
カーソル移動 | |
mouse_drag |
ドラッグ操作 | |
mouse_scroll |
スクロール (上下左右) | |
mouse_get_position |
現在のカーソル位置取得 | |
| ⌨️ キーボード | keyboard_type |
テキスト入力 |
keyboard_press |
キー押下 (修飾キー対応) | |
keyboard_shortcut |
共通ショートカット実行 | |
| 📸 画面 | screen_capture |
スクリーンショット (全画面/領域) |
screen_get_size |
画面サイズ取得 | |
screen_get_color |
ピクセル色取得 | |
| 🪟 ウィンドウ | window_list |
開いているウィンドウ一覧 |
window_focus |
アプリをアクティブ化 | |
window_move |
ウィンドウ移動 | |
window_resize |
ウィンドウリサイズ | |
| 🚀 フルパワー | run_applescript |
AppleScript 実行 |
run_shell |
シェルコマンド実行 |
前提条件
1. cliclick インストール (必須)
brew install cliclick
# 確認
cliclick -V
2. macOS 権限設定
- システム設定 を開く
- プライバシーとセキュリティ → アクセシビリティ
- + ボタンで Claude を追加
- 同様に 画面収録 にも Claude を追加
3. Node.js 18+
node --version # v18.0.0 以上
ビルド
cd macOS-GUI-Control-MCP
# 依存関係インストール
npm install
# MCPB CLI インストール
npm install -g @anthropic-ai/mcpb
# パッケージ化
mcpb pack .
# → macos-control-1.0.0.mcpb が生成される
インストール方法
方法 A: Claude Desktop にインストール (推奨)
A-1. ダブルクリック (最も簡単)
macos-control-1.0.0.mcpbをダブルクリック- Claude Desktop が開いてインストールダイアログ表示
- インストール をクリック
A-2. 設定画面から
- Claude Desktop → 設定 → デスクトップアプリ → 拡張機能
- 展開済み拡張機能をインストール をクリック
.mcpbファイルを選択
方法 B: Claude Code で直接使用
~/.claude.json に以下を追加:
{
"mcpServers": {
"macos-control": {
"command": "node",
"args": ["/path/to/macOS-GUI-Control-MCP/server/index.js"],
"env": {
"TIMEOUT": "30000",
"LOG_OPERATIONS": "true"
}
}
}
}
動作確認
新しいチャットで以下を試してみてください:
スクリーンショット撮って
マウスの現在位置教えて
Safari を開いて
使用例
マウス操作
「座標 500, 300 をクリックして」
「マウスを 100, 100 から 500, 500 にドラッグして」
「現在のカーソル位置を教えて」
「下に3回スクロールして」
キーボード操作
「Hello World とタイプして」
「Cmd+C を押して」
「コピーのショートカットを実行して」
「Enter キーを押して」
画面操作
「スクリーンショット撮って」
「画面サイズ教えて」
「座標 100, 100 のピクセル色を取得して」
ウィンドウ操作
「開いてるウィンドウ一覧見せて」
「Safari をアクティブにして」
「Terminal を座標 0, 0 に移動して」
「Finder のウィンドウを 800x600 にリサイズして」
フルパワー機能
「シェルで ls -la を実行して」
「AppleScript で Music アプリの現在の曲を取得して」
「シェルで pwd を実行して」
ブロックされるコマンド (削除のみ)
以下のパターンは安全のためブロックされます:
シェルコマンド
rm,rm -rf,rm -rrmdirunlink
AppleScript
delete file,delete folder,delete itemmove ... to trashempty trash
キーボードショートカット一覧
keyboard_shortcut で使用可能なショートカット:
| ショートカット名 | キー |
|---|---|
copy |
Cmd+C |
paste |
Cmd+V |
cut |
Cmd+X |
undo |
Cmd+Z |
redo |
Cmd+Shift+Z |
save |
Cmd+S |
select_all |
Cmd+A |
find |
Cmd+F |
new |
Cmd+N |
open |
Cmd+O |
close |
Cmd+W |
quit |
Cmd+Q |
tab |
Cmd+T |
refresh |
Cmd+R |
環境変数
| 変数名 | 説明 | デフォルト |
|---|---|---|
TIMEOUT |
コマンドタイムアウト (ms) | 30000 |
LOG_OPERATIONS |
操作ログ出力 | true |
トラブルシューティング
cliclick が見つからない
brew install cliclick
アクセシビリティ権限エラー
- システム設定 → プライバシーとセキュリティ → アクセシビリティ
- Claude (またはターミナル) を追加
- アプリを再起動
画面収録権限エラー
- システム設定 → プライバシーとセキュリティ → 画面収録
- Claude (またはターミナル) を追加
- アプリを再起動
AppleScript エラー
一部の AppleScript 操作には追加の権限が必要な場合があります。 システム設定 → プライバシーとセキュリティ → オートメーション で許可を確認してください。
ライセンス
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.