Skip to main content
Glama

phantom-mcp

Claude CodeがiOSシミュレーター、Androidエミュレーター、および実機を視覚的に確認・制御できるようにするMCPサーバーです。ターミナルを離れることなくモバイルアプリをテストするための24種類のツールを提供します。

Claudeは、iOSおよびAndroid上で、スクリーンショットの撮影、画面の読み取り、タップ、スクロール、フィールド入力、アサーションの検証、ビデオ録画を自動的に実行できます。

テストセッションごとに、スクリーンショット付きのテストレポートが自動的に生成されます。


アーキテクチャ

Claude Code
    | MCP protocol (stdio)
    v
Phantom (Node.js TypeScript)
    |                       |
    v                       v
iOS                      Android
  xcrun simctl             ADB
  WebDriverAgent           UIAutomator
  (localhost:8100)         (adb shell)
    |                       |
    v                       v
Simulateur / iPhone    Emulateur / Device

Related MCP server: mobile-device-mcp

前提条件

ツール

用途

確認方法

macOS 13+

すべて

-

Xcode 15+

iOS

xcode-select -p

Node.js 18+

すべて

node --version

Appium 3+

iOS (WDA)

appium --version

xcuitest driver

iOS (WDA)

appium driver list --installed

Android SDK

Android

adb version


インストール

オプションA — npm (推奨)

# 1. Installer le package
npm install -g phantom-mcp

# 2. Installer Appium + driver iOS
npm install -g appium
appium driver install xcuitest

# 3. Enregistrer dans Claude Code
claude mcp add -s user phantom -- npx phantom-mcp

オプションB — ソースからビルド

git clone https://github.com/nthimpulse/phantom-mcp.git
cd phantom-mcp
npm install
npm run build
claude mcp add -s user phantom -- node "$(pwd)/build/index.js"

24種類のツール

デバイス管理

ツール

説明

list_devices

すべてのデバイス(iOSシミュレーター、Androidエミュレーター、実機)を一覧表示

set_device

アクティブなデバイスを選択。オフの場合は自動起動。デバイスの自動準備(skip_setupで無効化可能)

prepare_device

デバイスをクリーンな状態にする:クリップボードのクリア、ステータスバーのオーバーライド、キーボードの非表示、iOSのQWERTY強制

観測

ツール

説明

screenshot

アクティブなデバイスのスクリーンショットを撮影

get_ui_tree

各要素のインデックス [N] を含むアクセシビリティツリーを取得

wait_for_element

要素が表示されるまで待機(タイムアウト付き)

scroll_until_visible

要素が見つかるまでスクロール

アサーション

ツール

説明

assert_visible

テキストが画面上に存在することを確認

assert_not_visible

テキストが画面上に存在しないことを確認

インタラクション

ツール

説明

tap

タップ(インデックス、座標、またはテキスト指定)。ターゲットが隠れている場合はキーボードを自動的に閉じる

long_press

長押し(コンテキストメニュー用)

type_text

テキスト入力。クリアオプションおよび入力後の値検証オプション付き

swipe

スワイプ(上/下/左/右)

dismiss_keyboard

ソフトキーボードを閉じる(表示されていない場合は何もしない)

ナビゲーション

ツール

説明

deep_link

URL / ディープリンクを開く

デバイス操作

ツール

説明

shake

シェイクをシミュレート

rotate

画面の向きを変更(縦/横)

video_record

ビデオ録画の開始/停止

アプリのライフサイクル

ツール

説明

launch_app

バンドルID / パッケージ名でアプリを起動

kill_app

アプリを終了

分析 & 自動化 (Tier 3)

ツール

説明

accessibility_audit

アクセシビリティ監査:ラベルの欠落、タップターゲットが小さすぎる、altテキストのない画像などを検出

test_report

自動テストレポート:startで追跡開始、endでMarkdownを生成。各アクションは自動的に記録される

visual_diff

2つのスクリーンショットをピクセル単位で比較し、視覚的なリグレッションを検出

multi_device

1つのコマンドで複数のデバイスに対して同じアクションを実行


自動化の仕組み

デバイスの選択

Phantomはデバイスを自動的に起動することはありません。選択を求めます:

  1. デバイスが1つだけアクティブな場合、自動的にそれを使用します

  2. 複数のデバイスがある場合、set_deviceで選択を求めます

  3. デバイスがない場合、利用可能なデバイスのリストを表示します

WDAの自動起動 (iOS)

WebDriverAgentは、iOSツールが初めて必要としたときに自動的に起動します。初回起動時は約60〜90秒(Xcodeビルドのため)かかりますが、その後は即座に起動します。

ADBマルチデバイス (Android)

すべてのADBコマンドは、-s <serial>を介して選択されたデバイスをターゲットにします。マルチデバイスでの混乱はありません。

テキスト入力 (AZERTY対応)

入力には仮想キーボードではなく、pbcopy + Cmd+V(貼り付け)を使用します。これは即座に実行され、すべてのキーボードレイアウト(AZERTY、QWERTYなど)で機能します。

自動テストレポート

各アクション(タップ、入力、スワイプ、アサーションなど)は、スクリーンショットとともに自動的に記録されます。テスト終了時に、/tmp/phantom-report-xxx/にMarkdownレポートが生成されます。


セキュリティ

  • すべてのシステムコマンドはexecFileを経由します(シェルは使用しません)

  • バンドルID、UDID、パッケージ名、AVD名、URLなどの入力は正規表現で検証されます

  • iOSの述語(Predicate)はエスケープされます(インジェクション対策)

  • Androidのテキストはデバイスシェル用にエスケープされます

  • as anyexec()シェルは一切使用していません


設定

オプションの環境変数:

  • PHANTOM_WDA_PATH — WebDriverAgentへのパス(デフォルト: ~/.appium/...)

  • PHANTOM_WDA_URL — WDAのURL(デフォルト: http://localhost:8100)


貢献

ローカル環境のセットアップ、新しいツールの追加パターン、命名規則、PRワークフローについてはCONTRIBUTING.mdを参照してください。

以下も参照してください:


トラブルシューティング

WDAがループしてクラッシュする

MobAIや他のツールがポート8100を使用しています。

lsof -i :8100
pkill -f "MobAI"

「デバイスが利用できません」

xcrun simctl list devices available   # iOS
adb devices -l                        # Android

WDAが起動しない

cd ~/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent
xcodebuild -project WebDriverAgent.xcodeproj \
  -scheme WebDriverAgentRunner \
  -destination "platform=iOS Simulator,name=iPhone 17 Pro" \
  test

ADBが見つからない

ls ~/Library/Android/sdk/platform-tools/adb

プロジェクト構造

phantom/
  src/
    index.ts                Point d'entree MCP (24 tools)
    platforms/
      types.ts              Interfaces communes
      ios/
        simctl.ts            Wrapper xcrun simctl
        wda.ts               Client WDA + auto-launch
      android/
        adb.ts               Wrapper ADB complet
    tools/                   24 tools (21 fichiers)
    utils/
      device-manager.ts      Detection + routing multi-device
      xml.ts                 Parser XML partage
  docs/
    README.md               Ce fichier
    TUTORIAL.md             Tuto pas-a-pas
    FLOWS.md                Exemples de flows de test
Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (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

  • A
    license
    -
    quality
    F
    maintenance
    An MCP server that provides comprehensive tools for managing iOS simulators, including device control, app lifecycle management, and UI automation. It enables developers to boot devices, install apps, capture screenshots, and simulate user interactions through natural language commands.
    3
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    MCP server that gives AI coding assistants the ability to see and interact with mobile devices. 49 tools for Android/iOS — AI-powered visual analysis (Claude + Gemini), smart tap/type by description, Flutter widget tree inspection, video recording, and test script generation. 4-tier element search with <1ms local matching. Free tier included, zero setup via npx.
    49
    79
    3
    Business Source 1.1
  • A
    license
    -
    quality
    D
    maintenance
    MCP server for cross-platform mobile automation (iOS/Android) using accessibility trees and screenshots, enabling agents to interact with apps on simulators, emulators, and physical devices.
    7
    Apache 2.0
  • A
    license
    -
    quality
    D
    maintenance
    An MCP server for mobile automation that enables LLMs to interact with Android and iOS devices through screenshot, tap, swipe, log analysis, and app lifecycle management.
    24
    2
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server for Appcircle mobile CI/CD platform.

  • Augments MCP Server - A comprehensive framework documentation provider for Claude Code

  • Hosted Amazon Seller and Vendor MCP server for Claude, ChatGPT, Cursor, Codex, Gemini, Copilot.

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/nthImpulse/phantom-mcp'

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