Skip to main content
Glama

phantom-mcp

MCP server that allows Claude Code to see and control iOS simulators, Android emulators, and real devices. 24 tools to test mobile apps without leaving the terminal.

Claude can take screenshots, read the screen, tap, scroll, fill in fields, verify assertions, record videos — automatically, on iOS and Android.

A test report with screenshots is generated automatically at the end of each test session.


Architecture

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

Prerequisites

Tool

Required for

How to check

macOS 13+

all

-

Xcode 15+

iOS

xcode-select -p

Node.js 18+

all

node --version

Appium 3+

iOS (WDA)

appium --version

xcuitest driver

iOS (WDA)

appium driver list --installed

Android SDK

Android

adb version


Installation

# 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

Option B — from source

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"

The 24 tools

Device management

Tool

Description

list_devices

Lists all devices (iOS sims + Android emus + real devices)

set_device

Selects the active device. Auto-boots if off. Auto-prepares the device (opt-out via skip_setup)

prepare_device

Sets the device to a clean state: clear clipboard / status bar overrides / dismiss keyboard / force QWERTY iOS

Observation

Tool

Description

screenshot

Captures the active device screen

get_ui_tree

Accessibility tree with index [N] for each element

wait_for_element

Waits for an element to appear (with timeout)

scroll_until_visible

Scrolls until an element is found

Assertions

Tool

Description

assert_visible

Verifies that text IS on the screen

assert_not_visible

Verifies that text IS NOT on the screen

Interaction

Tool

Description

tap

Taps (by index, coordinates, or text). Auto-dismisses keyboard if target is obscured

long_press

Long press (context menus)

type_text

Text entry with clear option, and verify option to re-read the value after typing

swipe

Swipe (up/down/left/right)

dismiss_keyboard

Closes the soft keyboard (no-op if not visible)

Navigation

Tool

Description

deep_link

Opens a URL / deep link

Device actions

Tool

Description

shake

Simulates a shake

rotate

Changes orientation (portrait/landscape)

video_record

Starts/stops video recording

App lifecycle

Tool

Description

launch_app

Launches an app by bundle ID / package name

kill_app

Closes an app

Analysis & Automation (Tier 3)

Tool

Description

accessibility_audit

Accessibility audit: missing labels, tap targets too small, images without alt text

test_report

Automatic test report: start to begin tracking, end to generate the markdown. Each action is tracked automatically.

visual_diff

Compares two screenshots pixel by pixel to detect visual regressions

multi_device

Executes the same action on multiple devices in one command


Automatic operation

Device selection

Phantom never boots a device automatically. It asks you to choose:

  1. If only 1 device is active, it uses it automatically

  2. If multiple, it asks you to choose with set_device

  3. If none, it shows you the list of available devices

Auto-launch WDA (iOS)

WebDriverAgent is launched automatically on the first iOS tool that needs it. First launch ~60-90s (Xcode build), then instantaneous.

ADB multi-device (Android)

All ADB commands target the device selected via -s <serial>. No multi-device confusion.

Text entry (AZERTY compatible)

Entry uses pbcopy + Cmd+V (paste) instead of the virtual keyboard. It is instantaneous and works on all keyboard layouts (AZERTY, QWERTY, etc.).

Automatic test report

Each action (tap, type, swipe, assert...) is automatically recorded with a screenshot. At the end of the test, a markdown report is generated in /tmp/phantom-report-xxx/.


Security

  • All system commands go through execFile (no shell)

  • Inputs validated by regex: bundle IDs, UDIDs, package names, AVD names, URLs

  • iOS predicates escaped (anti-injection)

  • Android text escaped for the device shell

  • Zero as any, zero exec() shell


Configuration

Optional environment variables:

  • PHANTOM_WDA_PATH — path to WebDriverAgent (default: ~/.appium/...)

  • PHANTOM_WDA_URL — WDA URL (default: http://localhost:8100)


Contributing

See CONTRIBUTING.md for local setup, the pattern for adding a new tool, naming conventions, and the PR workflow.

See also:


Troubleshooting

WDA crash in a loop

MobAI or another tool is using port 8100.

lsof -i :8100
pkill -f "MobAI"

"No device available"

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

WDA does not start

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 not found

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

Project structure

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
    Not graded
    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
    Not graded
    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
    Not graded
    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