Mobile Device Farm MCP
Provides ADB-based tools to control Android devices: list devices, capture screenshots, inspect UI hierarchy, tap/swipe/type, send key events, install APKs, clear app data, grant permissions, push/pull files, toggle Wi-Fi, record video, open deep links, and analyze logs and performance.
Provides simctl-based tools to control booted iOS Simulators: capture screenshots, launch and terminate apps, install/uninstall apps, add media, send push notifications, open deep links, record video, and analyze logs and performance.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Mobile Device Farm MCP Take a screenshot of the Android device and show me the current screen."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Mobile Device Farm MCP ππ±
A Model Context Protocol (MCP) server that gives AI agents direct control over Android devices (via ADB) and iOS Simulators (via simctl). Perform automated testing, bug reproduction, and performance profiling directly from your AI agent.
π Quick Start (via npx)
The easiest way to start the server is using npx. No installation required:
npx -y mobile-device-farm-mcpAdd it to your Claude Desktop configuration:
{
"mcpServers": {
"device-farm": {
"command": "npx",
"args": ["-y", "mobile-device-farm-mcp"]
}
}
}Related MCP server: scrcpy-mcp
π οΈ Tools & Capabilities
The server provides a comprehensive suite of tools categorized by platform.
π Common Tools (Cross-Platform)
list_devices(platform): See all connected Android devices and booted iOS Simulators.test_performance(packageName, durationSec, platform): Measure average/max CPU and Memory usage over time.open_deep_link(url, deviceId, platform): Open a URL or Deep Link on the target device.record_video(deviceId, durationSec, platform): Record a short video of the screen (up to 60s).analyze_logs(deviceId, mode): Fetch and filter logs bycrash,anr, ornetwork.
π€ Android Tools (ADB)
adb_screenshot(deviceId): Capture the screen as a base64 image.adb_get_ui_hierarchy(deviceId): Get the raw XML structure of the current screen (essential for finding element coordinates).adb_tap(x, y)/adb_swipe(x1, y1, x2, y2): Simulate touch interactions.adb_input_text(text): Type text into the focused field.adb_key_event(keycode): Send hardware keys (HOME, BACK, ENTER).adb_install(apkPath)/adb_clear_app_data(packageName): Manage app lifecycle.adb_grant_permissions(packageName, permissions): Bypass system permission dialogs.adb_push(localPath, remotePath)/adb_pull(remotePath, localPath): File management.adb_wifi(enabled): Toggle WiFi to test offline behavior.
π iOS Tools (Simulators)
ios_screenshot(deviceId): Capture Simulator screen.ios_launch(bundleId)/ios_terminate(bundleId): Start or force-quit apps.ios_install(appPath)/ios_uninstall(bundleId): Install/Remove apps.ios_add_media(localPath): Add photos or videos to the Simulator library.ios_push_notification(bundleId, payload): Send a test push notification (APNs JSON).
π§ AI Agent Workflows (Examples)
π΅οΈ Example 1: Finding a Button via UI Hierarchy
Instead of guessing coordinates, the agent can use the UI hierarchy:
Agent calls:
adb_get_ui_hierarchy()Result:
<node text="Submit" bounds="[450,1200][630,1300]" ... />Agent calls:
adb_tap({ x: 540, y: 1250 })(clicks the center of the bounds).
π₯ Example 2: Reproducing a Crash
Agent calls:
adb_clear_app_data({ packageName: "com.myapp" })Agent calls:
record_video({ durationSec: 15 })Agent performs interactions...
Agent calls:
analyze_logs({ mode: "crash" })to get the stack trace.
π¬ Prompting Examples
Once the server is connected, you can talk to your AI agent like a human mobile engineer:
Smoke Test: "Install the latest APK from the 'builds' folder, launch it, and take a screenshot to make sure it doesn't crash on start."
Bug Hunt: "Check the Android logs for any FATAL EXCEPTIONS related to the package 'com.example.app' in the last 500 lines."
Deep Linking: "Open the deep link 'myapp://settings/profile' on the iOS simulator and tell me if the Profile page is displayed."
Performance: "Run a 30-second performance test on 'com.android.chrome' and give me a summary of its average CPU and Memory usage."
UI Inspection: "I need to click the 'Login' button but I don't know the coordinates. Inspect the UI hierarchy and find it for me."
π§ Mobile Tester Skill
To teach your AI agent how to effectively use these tools for complex testing (like smoke tests and chaos engineering), load the Mobile Tester Skill.
How to use:
Gemini CLI: Run
gemini skill add skills/mobile-tester.md.Other Agents: Copy the content of
skills/mobile-tester.mdinto your agent's system prompt.
π§ Prerequisites
Android:
adbmust be installed and authorized (adb devices).iOS: macOS with Xcode and Command Line Tools installed (
xcode-select --install). Simulators must be booted to be detected.
π License
MIT
Available Tools
32 toolsadb_clear_app_dataB
Clear app data and cache (reset to fresh install state).
Inputs: packageName (required), deviceId.
adb_force_stopC
Force stop an application (kill process).
Inputs: packageName (required), deviceId.
adb_get_ui_hierarchyB
Get the current UI hierarchy (XML) to inspect elements and find coordinates.
Inputs: deviceId.
adb_grant_permissionsC
Grant runtime permissions to an app.
Inputs: packageName (required), permissions (required), deviceId.
adb_input_textC
Input text into the currently focused field (ADB).
Inputs: text (required), deviceId.
adb_installC
Install an APK on an Android device.
Inputs: apkPath (required), deviceId.
adb_key_eventC
Send a key event (e.g., HOME, BACK, ENTER) to the device.
Inputs: keycode (required), deviceId.
adb_logcatC
Get recent logs from an Android device (last N lines).
Inputs: lines, filter, deviceId.
adb_network_statusB
Check if the device has internet connectivity (pings Google DNS).
Inputs: deviceId.
adb_pullC
Pull a file from an Android device.
Inputs: localPath (required), remotePath (required), deviceId.
adb_pushC
Push a file to an Android device.
Inputs: localPath (required), remotePath (required), deviceId.
adb_revoke_permissionsC
Revoke runtime permissions from an app.
Inputs: packageName (required), permissions (required), deviceId.
adb_screenshotC
Capture a screenshot from an Android device (returns base64 PNG).
Inputs: deviceId.
adb_shellC
Run a raw ADB shell command (use carefully).
Inputs: command (required), deviceId.
adb_swipeC
Simulate a swipe gesture on Android screen.
Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +2 more.
adb_tapC
Simulate a tap on Android screen coordinates.
Inputs: x (required), y (required), deviceId.
adb_wifiC
Enable or disable WiFi on the device.
Inputs: enabled (required), deviceId.
analyze_logsC
Get logs filtered by mode (crash, anr, network).
Inputs: mode, lines, deviceId.
get_app_vitalsC
Get performance stats (CPU, Memory) and check for recent crashes/ANRs.
Inputs: packageName (required), deviceId.
get_device_infoB
Get Android device details (Battery, Resolution, SDK, Model).
Inputs: deviceId.
ios_add_mediaB
Add photos or videos to the Simulator photo library.
Inputs: deviceId (required), localPath (required).
ios_installB
Install an .app bundle on an iOS Simulator.
Inputs: appPath (required), deviceId (required).
ios_launchB
Launch an installed app on iOS Simulator.
Inputs: bundleId (required), deviceId (required).
ios_push_notificationC
Send a remote push notification to an app on the Simulator.
Inputs: payload (required), bundleId (required), deviceId (required).
ios_screenshotA
Capture a screenshot from an iOS Simulator (returns base64 PNG).
Inputs: deviceId (required).
ios_terminateC
Terminate a running app on iOS Simulator.
Inputs: bundleId (required), deviceId (required).
ios_uninstallC
Uninstall an app from iOS Simulator.
Inputs: bundleId (required), deviceId (required).
list_devicesB
List all connected Android devices (ADB) and iOS Simulators (xcrun).
Inputs: platform.
open_deep_linkC
Open a deep link or URL on the device.
Inputs: url (required), deviceId, platform.
record_videoC
Record a short video of the device screen.
Inputs: deviceId (required), platform, durationSec.
run_monkeyC
Run a Chaos Monkey stress test (Android only).
Inputs: packageName (required), events, deviceId.
test_performanceC
Run a performance test on an app, measuring CPU and memory over time.
Inputs: packageName (required), deviceId, platform, durationSec.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 32 tools
Most tools target distinct resource+action pairs (e.g., adb_tap vs adb_swipe vs adb_input_text), and platform prefixes aid selection. A few pairs overlap meaningfully: test_performance vs get_app_vitals both report CPU/memory, and analyze_logs vs adb_logcat both retrieve logs, but descriptions provide enough differentiation.
Most names follow verb_noun and platform prefixes (adb_, ios_) are used, but the convention is applied inconsistently: several Android-only tools are unprefixed (test_performance, get_app_vitals, run_monkey, get_device_info), while similar Android operations use adb_. The result is readable but mixed.
32 tools exceeds the 25-tool threshold and includes many platform-specific duplicates that could be unified (adb_screenshot/ios_screenshot, adb_install/ios_install, adb_grant_permissions/revoke_permissions). The breadth of a two-platform device farm justifies some count, but the surface feels bloated rather than tightly scoped.
Core automation is covered (install, UI interaction, screenshots, logs, performance, permissions), but notable app-lifecycle gaps exist on Android: there is no adb_launch_app, adb_terminate_app, or adb_uninstall_app equivalent to the iOS tools, and adb_shell is the only workaround. Cross-platform parity is also missing for push notifications and media injection.
Maintenance
Related MCP Connectors
Let AI agents control Android and iOS devices on Mobilerun Cloud: screen, input, apps, workflows.
Give your AI agent a real cloud Android phone: push APKs, drive it, get screenshots and logs.
Cloud Android devices for AI agents: install an APK, read the screen, tap, type, read logcat.
Let your AI agent control real iPhones: screenshots, tap, swipe, type and open apps.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI agents to automate Android and iOS devices, including emulators and physical devices, by capturing screenshots, reading UI accessibility trees, performing touch and text input, and managing app lifecycle and logs.184MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to visually perceive and directly control Android devices via ADB and screen-control tooling, including screenshots, taps, swipes, typing, app management, UI inspection, file transfer, shell commands, and audio/video streaming.801 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to see and control Android devices through ADB and scrcpy, supporting screenshots, input, app management, UI automation, shell/file access, and audio/video streaming.801 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to see and control Android devices through ADB and screen mirroring, supporting screen capture, touch input, app management, UI element finding, file transfer, shell commands, clipboard access, and audio/video streaming.801 npmMIT