mobile-use-mcp
Allows coding agents to observe and operate Android devices through ADB and uiautomator2, providing tools for screenshot capture, UI hierarchy inspection, tap, long press, swipe, text input, key presses, app lifecycle management, and URL opening.
Click on "Install 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-use-mcpdescribe 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-use-mcp
mobile-use-mcp is a local stdio MCP server that lets coding agents such as Codex and
Claude Code observe and operate Android devices through ADB and uiautomator2.
The server contains no LLM and requires no model API key. The host agent interprets screenshots and UI elements, plans actions, and calls MCP tools directly.
Capabilities
Discover, select, and disconnect Android physical devices and emulators
Return screenshots as native MCP image content
Encode original-resolution screenshots as PNG or quality-controlled JPEG
Return compact or full UIAutomator accessibility hierarchies with query and pagination
Tap or long press using bounds, resource ID, or text fallbacks
Swipe using validated screen coordinates
Type and clear text in the focused field
Press a bounded set of Android keys
List, launch, and terminate apps
Diagnose App launch attempts and foreground blockers
Open HTTP and HTTPS URLs
Record bounded Android screen videos with automatic segment rollover
Detect unauthorized, offline, disconnected, and ambiguous device states
Related MCP server: Android Mobile MCP
Non-goals and safety boundaries
The initial release intentionally excludes:
iOS, IDB, and WebDriverAgent
Embedded LLMs or model provider configuration
Arbitrary ADB shell access
APK installation or app uninstall
Clearing app data, rebooting, shutting down, or factory reset
Cloud devices, BrowserStack, Limrun, and telemetry
The server never automatically uninstalls software from the connected device. Screenshots and UI text can contain sensitive information and are returned to the host agent, so use a trusted agent and model environment.
The MCP initialize response includes service instructions that tell compatible host agents to use
these tools for natural-language requests involving a physical Android phone or mobile App, such
as opening an App, browsing content, reading comments, collecting visible data, tapping, swiping,
typing, screenshots, and screen recording. Users normally should not need to name mobile-use or
ADB explicitly, although tool selection ultimately remains under the host agent's control.
Requirements
macOS, Linux, or Windows with Python 3.12+
Android SDK platform-tools with
adbonPATHA physical Android device with USB debugging enabled, or an Android emulator
Optional:
ffmpegonPATHto merge recordings longer than one Android segment
Confirm ADB connectivity before starting:
adb devices -lExpected online state:
List of devices attached
ABC123 device product:... model:... transport_id:1If the state is unauthorized, unlock the phone and accept the USB debugging prompt. If it is
offline, reconnect the device or restart the ADB server.
Installation
Clone the repository and install the locked environment:
git clone https://github.com/NeoAgentman/mobile-use-mcp.git
cd mobile-use-mcp
uv syncThe MCP server entry point is:
uv run mobile-use-mcpIt uses stdio and is intended to be started by an MCP client, not used as an interactive CLI.
Codex configuration
Add the local server with the Codex CLI, replacing the path with your clone location:
codex mcp add mobile-use -- \
uv --directory /absolute/path/to/mobile-use-mcp run mobile-use-mcpEquivalent ~/.codex/config.toml configuration:
[mcp_servers.mobile-use]
command = "uv"
args = [
"--directory",
"/absolute/path/to/mobile-use-mcp",
"run",
"mobile-use-mcp",
]Start a new Codex task after adding the server so the tool list is refreshed.
Claude Code configuration
Add the same stdio server to Claude Code:
claude mcp add --scope user mobile-use -- \
uv --directory /absolute/path/to/mobile-use-mcp run mobile-use-mcpUse --scope project instead if the configuration should only apply to one project.
Recommended agent workflow
Call
android_list_devices.Call
android_connect, specifying a serial when more than one device is online.Call
android_snapshotto receive the screenshot and current UI elements.Prefer a target containing bounds plus resource ID or text.
Perform one action.
Call
android_snapshotagain to verify the resulting state.If an action fails, use the returned selector attempts and refresh the snapshot.
android_wait is only a fixed delay. It does not wait for a condition or inspect whether an
element appeared, and it invalidates the cached snapshot. Always observe again afterward.
Example instruction for the host agent:
Use the mobile-use MCP tools to open Android Settings, navigate to About phone,
and report the device model. Observe the screen again after every action.Tools
Device lifecycle
Tool | Purpose |
| List online, offline, and unauthorized ADB devices |
| Select and initialize one device |
| Read current MCP session state |
| Release the active session |
Observation
Tool | Purpose |
| Screenshot plus compact or full UI elements and truncation metadata |
| Screenshot plus basic metadata |
| Page and query elements from one cached snapshot |
| Current package and activity |
| Filter third-party package names |
android_snapshot defaults to detail_level="compact", returns at most 200 elements, and reports
snapshot_id, total_elements, returned_elements, truncated, and next_offset; no truncation
is silent. The default max_text_length=500 is applied separately to each node's text and content
description, including in full mode. Increase it up to 2000 when reading long-form content.
When truncated=true, first query or page the same snapshot with android_get_ui_elements; use
detail_level="full" only as an explicit large-output fallback. interactive_only=true keeps only
clickable, focusable, or scrollable nodes, so leave it false when reading static content such as
articles, product descriptions, prices, tables, or comments.
android_snapshot and android_screenshot support image_format and image_quality.
Screenshots always keep the original device resolution. The default is JPEG quality 60; use
image_format="png" when small text, tables, icons, or other visual details require the original
lossless image. Every JPEG response includes a quality_notice and machine-readable
lossless_fallback with the exact PNG retry arguments. Screenshot base64 is not duplicated in
structured JSON. Use android_snapshot when UI text or targets are needed; use
android_screenshot for visual-only inspection without a pageable hierarchy.
Use android_get_ui_elements with the returned snapshot_id to page the exact same hierarchy.
Its default page size is 100. It supports offset, limit, a case-insensitive query across
text, content description, resource ID, class, and package, plus exact package and interactive-only
filters. Filters are applied before pagination; reset offset to zero when changing a filter:
{
"snapshot_id": "s-...",
"query": "校招",
"package": "com.taobao.idlefish",
"offset": 0,
"limit": 50
}Only the latest snapshot is cached. Actions, waiting, reconnecting, and disconnecting invalidate
it; an expired ID returns SNAPSHOT_NOT_FOUND and instructs the agent to observe again.
Actions
Tool | Purpose |
| Tap using bounds, resource ID, or text fallbacks |
| Long press a target |
| Swipe between validated pixel coordinates |
| Optionally focus a target, then type text |
| Optionally focus a target, then clear text with a delete-key fallback |
| Press back/home/enter/delete/tab/menu/volume keys |
| Launch a package and poll until foreground |
| Force-stop a package |
| Open an HTTP or HTTPS URL |
| Start a bounded screen recording with automatic segment rollover |
| Stop, pull, and optionally merge recording segments |
| Sleep for a bounded fixed delay and invalidate the cached snapshot |
android_launch_app reports every launch attempt, polling count, and the last foreground App. A
permission controller, chooser, or other foreground blocker is reported separately from an App
that remains in an indeterminate loading state.
Recordings are limited to 5–1800 seconds. Device-side temporary files use randomized names and are
removed after transfer. Android's per-recording time limit is handled with 170-second segments. If
ffmpeg is available, multiple segments are losslessly concatenated; otherwise the tool returns
the segment paths and a warning. Returned paths are local to the MCP host and may contain sensitive
screen content.
Target selection
Tap and long-press tools accept a target object:
{
"bounds": {"x": 20, "y": 100, "width": 280, "height": 80},
"resource_id": "com.example:id/continue",
"resource_id_index": 0,
"text": "Continue",
"text_index": 0
}The server tries selectors in this order:
Valid on-screen bounds
Resource ID and occurrence index
Exact case-insensitive text/content description and occurrence index
Target does not accept content_description, class_name, or package fields. To act on a
snapshot node whose accessible label is in content_description, pass that value through the
target's text field. class_name and package are available as query filters through
android_get_ui_elements, not as action selectors. Bounds use original device pixels and become
stale after the UI changes.
Failure responses include every attempted selector and recommend taking a fresh snapshot.
Error model
Expected operational failures return structured data instead of internal tracebacks:
{
"success": false,
"error_code": "DEVICE_DISCONNECTED",
"message": "Android device 'ABC123' is no longer connected and ready.",
"suggestion": "Reconnect the device, verify `adb devices -l`, then call android_connect again.",
"data": {}
}Stable error codes include:
ADB_UNAVAILABLEDEVICE_NOT_FOUNDDEVICE_UNAUTHORIZEDDEVICE_OFFLINEDEVICE_DISCONNECTEDMULTIPLE_DEVICESNOT_CONNECTEDINVALID_TARGETELEMENT_NOT_FOUNDINVALID_COORDINATESOPERATION_FAILEDTIMEOUTUNSUPPORTEDSNAPSHOT_NOT_FOUND
Development and verification
Install development dependencies:
uv sync --devRun all non-device checks:
uv run ruff check .
uv run ruff format --check .
uv run pyright
uv run pytestInspect the live stdio MCP schema:
npx -y @modelcontextprotocol/inspector --cli \
uv --directory "$PWD" run mobile-use-mcp \
--method tools/listTests marked android require a connected device or emulator:
MOBILE_USE_ANDROID_SERIAL=ABC123 uv run pytest -m androidDevice tests are excluded from the default test run and require an explicit serial so the test suite never selects and operates a connected phone accidentally.
See COMPATIBILITY.md for current Codex, Claude Code, MCP client, and real
device verification results.
Known limitations
Custom-rendered Canvas/game interfaces may not expose useful accessibility elements; coordinate actions can still be selected from the screenshot.
Screen recording availability and supported resolution depend on the Android device's built-in
screenrecordimplementation.UI elements are snapshots, not stable DOM nodes. Observe again after navigation, animation, or scrolling. Only the latest
snapshot_idcan be paged, and state-changing operations invalidate it deliberately.detail_level="full"can produce a large tool result. Prefer pagination and query first.max_text_lengthis a per-node limit, not a total response budget; full mode does not disable it.interactive_only=trueintentionally hides most static text nodes and should not be used for long-form reading or content extraction.Screenshots always use the phone's original resolution. JPEG is lossy by default; retry with PNG when the returned quality notice indicates that visual detail may be insufficient.
android_type_textandandroid_clear_textaccept an optional target. Without one, they operate on the currently focused field.App discovery currently returns package names rather than localized display names.
Screenshot tools return visible pixels as MCP image content; they do not extract or download an App's original remote media file.
Physical-device and emulator compatibility still requires validation across Android versions, OEM ROMs, and input methods.
Attribution
Android controller and selector behavior is derived from
minitap-ai/mobile-use, licensed under the Apache
License 2.0. See LICENSE and NOTICE for attribution and license details.
Maintenance
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
- FlicenseBqualityDmaintenanceEnables AI agents to interact with Android devices through visual UI element detection and automated interactions. Provides comprehensive Android automation capabilities including touch gestures, text input, screenshots, and video recording via uiautomator2.Last updated124
- FlicenseAqualityCmaintenanceEnables AI agents to interact with Android devices through UI manipulation, screen capture, touch gestures, text input, and app management via ADB. Provides comprehensive mobile automation capabilities including element detection, navigation, and application control for Android device testing and interaction.Last updated95
- Alicense-qualityDmaintenanceEnables interaction with Android devices and emulators through ADB, allowing control actions like tapping, text input, screenshots, UI inspection, and app launching through natural language.Last updated338ISC
- Alicense-qualityBmaintenanceEnables AI assistants to interact with Android devices and emulators via ADB, providing tools for screenshots, UI inspection, touch and text input, app management, and device control.Last updated4515MIT
Related MCP Connectors
Control Android TV from any AI. 38 MCP tools: playback, recap, recommend, smart-home, schedules.
Provides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to i…
Generate images, GIFs, and PDFs from HTML, URLs, or templates — from your AI agent.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/NeoAgentman/mobile-use-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server