Skip to main content
Glama
johnexzy

macos-computer-use

by johnexzy

🍏 macOS Computer Use (MCP Server)

License: MIT Platform Model Context Protocol

超高速でネイティブな Model Context Protocol (MCP) サーバー。macOS上でLLMや自律エージェントに完全な画面表示の確認とデスクトップ自動化機能を提供します。物理的なマウスやキーボードのフォーカスを奪うことはありません

AppleネイティブのCoreGraphicsVision OCR(VNRecognizeTextRequest、およびプロセスレベルの直接イベントルーティング(CGEvent.postToPid)を活用した、コンパイル済みSwiftコアを基盤としています。


⚡ 主な特長

  • 🎯 サブ30ミリ秒のApple Vision OCR(find_text / click_text: 盲目的な $(x, y)$ 座標推測は不要。エージェントはApple Neural Engineのアクセラレーションにより、ボタン、ラベル、テキストプレースホルダーを名前でピクセル精度で見つけます。

  • 🛡️ 非干渉のバックグラウンド実行: グローバルなmacOSハードウェアイベントタップから分離されています。クリック、スクロール、キー入力を特定のアプリケーションPIDに直接ターゲット設定できるため、IDEやブラウザで作業を続けながら操作できます。

  • 👁️ 仮想カーソルオーバーレイ(mark_cursor: エージェントのターゲット座標がスクリーンショットフレーム上に視覚的に描画されます(シアンのターゲットリング + マゼンタのパルスドット)。画面上の物理マウスは動かしません。

  • ⚡ リアクティブなUI同期(wait_for_text: 盲目のsleep()タイムアウトを、動的なオートコンプリートドロップダウン、モーダル、状態変化が出現した瞬間に解決する高速OCRポーリングループに置き換えます。

  • 🖼️ ウィンドウ分離スクリーンキャプチャ: ターゲットアプリケーションのバッファをバックグラウンドでクリーンにキャプチャします(screencapture -l <wid> -o -x)。ウィンドウを前面に表示したり、重なったウィンドウをキャプチャしたりしません。


🛠️ 公開ツール

ツール

説明

主要パラメータ

click_text

Apple Vision OCRを使用して任意のボタン、ラベル、UIテキストを見つけ、その正確な中心をスムーズにクリックします。

text, appName (optional), windowId (optional), button, clickCount, returnScreenshot

find_text

画面上またはウィンドウ固有のテキストを検査し、正確なバウンディングボックスと論理座標を返します。

text, appName (optional), windowId (optional)

wait_for_text

期待したテキストが表示されるまで(オートコンプリートドロップダウン、トースト、シート)、対象ウィンドウ/画面をリアクティブにポーリングします。

text, appName (optional), timeoutSeconds (default: 5.0)

screenshot

オプションの仮想カーソルレンダリングを備え、ディスプレイ全体または特定のバックグラウンドアプリケーションウィンドウをキャプチャします。

appName, windowId, maxWidth, format (jpeg | png), cursor ({x, y})

list_windows

開いているアプリケーションウィンドウ、プロセスID(pid)、タイトル、座標範囲を前面から背面へのZオーダーで一覧表示します。

appName (optional filter)

mouse_click

論理 (x, y) ポイントでクリックします(ウィンドウ相対およびPIDターゲットルーティングをサポート)。

x, y, appName, windowId, relativeCoords, button, clickCount

mouse_move

マウスカーソルを (x, y) 座標へスムーズに移動します。

x, y, appName, relativeCoords, smooth, duration

mouse_drag

マウスを (startX, startY) から (endX, endY) へスムーズにドラッグします。

startX, startY, endX, endY, duration

type_text

アクティブな入力フィールドにプレーンテキストを注入します(または、対象プロセスのキューに直接)。

text, appName (optional), windowId (optional)

press_key

修飾キーを伴う特殊キーまたはキーボードショートカットを押します。

key (return, space, tab, escape, c, etc.), modifiers (command, shift, option, control)

scroll

マウスホイールを垂直および水平にスクロールします。

x, y, deltaY, deltaX, appName, windowId

launch_app

macOSアプリケーションを起動するか、前面に表示します。

appName (e.g. Google Chrome, Safari, Finder, Slack, Notes)

get_active_app

現在アクティブな最前面アプリケーション名とウィンドウタイトルを返します。

None

run_applescript

macOSのアクセシビリティとUI階層の詳細な検査を行うカスタムAppleScriptを実行します。

script


🚀 インストールとセットアップ

1. 前提条件

  • macOS 13.0+(Apple SiliconまたはIntel)

  • Node.js 18+

  • Xcode Command Line Tools(ネイティブSwiftバイナリをコンパイルするため):

    xcode-select --install

2. クローンとビルド

git clone https://github.com/johnexzy/macos-computer-use.git
cd macos-computer-use
npm install

(postinstall スクリプトは、native_helper.swift を最適化されたネイティブバイナリに自動的にコンパイルします)。


🔒 必要なmacOS権限

デスクトップキャプチャと入力シミュレーションを許可するには、システム設定 > プライバシーとセキュリティ でホストアプリケーション(Terminal、iTerm2、Antigravity、Cursor、VS Code)に権限を付与してください:

  1. 画面収録とシステムオーディオ収録: screenshot とビジュアルOCRに必要です。

  2. アクセシビリティ: mouse_clicktype_textpress_key に必要です。


🔌 MCP設定

このサーバーをMCPクライアント設定に追加してください:

Antigravity / Claude Desktop / Cursor / Windsurf

mcp_config.json / claude_desktop_config.json に追加してください:

{
  "mcpServers": {
    "macos-computer-use": {
      "command": "node",
      "args": ["/absolute/path/to/macos-computer-use/server.mjs"]
    }
  }
}

🧪 ネイティブSwiftヘルパーを直接テストする

ターミナルからネイティブバイナリを直接テストできます:

# Display resolution and scaling
./native_helper size

# List active Chrome windows in Z-order
./native_helper list_windows "Google Chrome"

# Find a button or text on screen with Apple Vision OCR in ~30ms
./native_helper find_text "Search" "Google Chrome"

# Reactively wait for dynamic text to appear
./native_helper wait_for_text "quantum" "Google Chrome" nil 5.0

📄 ライセンス

MIT © John Oba

-
license - not tested
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.

  • MCP connector that lets ChatGPT list, search, and run your Apple Shortcuts via a local Mac agent

  • Let ChatGPT, Claude & Cursor use your Mac: email, calendar, iMessage, Teams, files. Local, free.

View all MCP Connectors

Latest Blog Posts

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/johnexzy/macos-computer-use'

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