Skip to main content
Glama

macos-ui-mcp

Claude がネイティブ macOS アプリの UI を、構築中に検査・操作できるようにする Playwright 風のツール — 画面収録の許可は不要です。

画面をキャプチャする代わりに、アプリ自身が自分をレンダリングします。デバッグ専用の小さな Swift パッケージ(swift-harness/)が、アプリのビューツリーとプロセス内 PNG レンダラーを localhost HTTP で公開します。MCP サーバー(src/)がそれを Claude が呼び出せるツールに変換します:list_windowsget_ui_treescreenshotclicktypewait_forinvoke_action

設計の根拠、アーキテクチャ比較、プロジェクトの目標については IDEA.md を参照してください。

Claude Code ──MCP(stdio)──> macos-ui-mcp server ──HTTP──> AppMCPHarness (in your app, DEBUG only)

レイアウト

パス

内容

src/

MCP サーバー(TypeScript)

src/contract.ts

ハーネスの HTTP ワイヤーフォーマット(型 + zod スキーマ)

test/

vitest スイート + インメモリのモックハーネス。e2e.test.ts は実際のアプリを操作します

swift-harness/

macOS アプリ用のドロップイン参照ハーネス

showcase/

ハーネスをリンクする最小限の AppKit アプリ — e2e テストで使用

Related MCP server: Desktop Pilot MCP

使い方

1. ハーネスを macOS アプリに追加する(DEBUG ビルドのみ)

swift-harness/README.md を参照してください。AppDelegate に 1 行追加するだけです:

#if DEBUG
AppMCP.start()   // opens http://127.0.0.1:8787
#endif

2. MCP サーバーをビルドする

npm install
npm run build

3. Claude Code に登録する

// .mcp.json
{
  "mcpServers": {
    "macos-ui-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/macos-ui-mcp/dist/index.js"],
      "env": { "MACOS_UI_MCP_HARNESS_URL": "http://127.0.0.1:8787" }
    }
  }
}

これで、デバッグビルドでアプリを実行している状態で、Claude に get_ui_treescreenshot を呼び出すよう依頼できます — 画面収録のプロンプトは表示されません。

開発

npm test           # 38 unit tests, no real app needed (mock harness); e2e is skipped
npm run typecheck
npm run dev         # run the server against a live harness

npm run test:e2e    # builds showcase/, launches it, runs the real tools against the
                    # real Swift harness. Needs a logged-in macOS GUI session.

npm run test:e2e が目標の証明です:get_ui_tree がコントロールを認識すること、screenshot が実際のプロセス内 PNG を返すこと、click / type がライブ UI を変更すること — すべて画面収録の許可なしで確認できます。

セレクター文法

clicktypescreenshotwait_for で使用します:

形式

一致条件

#save

id が save のノード(アプリ内で .accessibilityIdentifier("save") で設定)

Button "Save"

ロールが button かつ ラベルが Save

"Save"

ラベルが Save の任意のノード

Button

ロールが button の任意のノード

click / type は曖昧なセレクター(複数一致)を拒否し、候補の id を報告します。

ステータス

  • v0.1 — macOS / AppKit。7 つのツールすべて実装済み。38 のユニットテスト + 実際の Swift ハーネスを通じて showcase/ アプリを操作する 5 ケースのエンドツーエンドテスト。検証済み:ツリー、プロセス内 PNG スナップショット、タップ、テキスト設定、アクションフック — 画面収録オフ。

  • 未対応 — SwiftUI ネイティブツリー(現時点では AppKit イントロスペクションのみ)、Windows アダプター、Accessibility API によるサードパーティアプリの検査。

ライセンス

MIT © 2026 Thang Duong

Install Server
A
license - permissive license
A
quality
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 Servers

View all related MCP servers

Related MCP Connectors

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

  • Live browser debugging for AI assistants — DOM, console, network via MCP.

  • Search, read, and write your Apple Notes from ChatGPT/Claude via a local Mac agent + MCP relay.

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/thangduonghuu/macos-ui-mcp'

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