droid-mcp

v0.1.0
droid-mcp Checked 1 day ago Published 1 year ago

Android MCP server for device automation via ADB

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_devices

List connected Android devices and basic status via ADB.

select_device

Select a specific device by ID or auto-select the first available.

ParameterTypeDescription
params *

get_device_info

Get model, Android version, API level, screen size, and health checks.

get_ui_layout

Extract the current UI hierarchy (uiautomator dump). Note: For WebView-heavy apps like Chrome, prefer `take_screenshot` + coordinate interactions, as dumps may be slow/limited.

ParameterTypeDescription
params *

list_screen_elements

List visible, meaningful UI elements in an LLM-friendly format (type/text/label/id/bounds). For heavy WebView apps like Chrome, prefer `take_screenshot` and interact via coordinates.

find_elements

LLM-friendly element lookup. Provide one or more of text, resource_id, content_desc, or class_name to search the current UI dump. Defaults favor recall (partial match, enabled_only=True). Use exact_match for strict matching and index to disambiguate multiple results. Best practice: call find_elements first to inspect candidates, then call tap_element with the same selector + index.

ParameterTypeDescription
params *

tap_screen

Tap the screen at specific coordinates (pixels).

ParameterTypeDescription
params *

tap_element

Tap a UI element by selector. Intended for agents (Claude/Codex/Gemini) after a prior find_elements call. Accepts text/resource_id/content_desc and optional index to disambiguate. By default, clickable_only/enabled_only are False to improve recall; set them True when you need actionable controls. Prefer exact_match for deterministic taps.

ParameterTypeDescription
params *

swipe_screen

Swipe between two coordinates with a duration (ms).

ParameterTypeDescription
params *

swipe_direction

Swipe in a direction (up/down/left/right) from center; distance optional.

ParameterTypeDescription
params *

input_text

Type text into the currently focused input field. Optional clear.

ParameterTypeDescription
params *

press_key

Press a device key (e.g., BACK, HOME, ENTER, KEYCODE_*).

ParameterTypeDescription
params *

take_screenshot

Capture a screenshot to /sdcard and optionally pull to ./assets.

ParameterTypeDescription
params *

start_screen_recording

Start screen recording (mp4) with optional bitrate/size/time limits.

ParameterTypeDescription
params *

stop_screen_recording

Stop a specific or all active recordings and optionally pull files locally.

ParameterTypeDescription
params *

list_active_recordings

List active screen recordings (IDs, duration, device path).

get_logcat

Fetch recent logcat with tag/priority filters. Critical for LLMs: limit output size to protect context window. Always set max_lines (e.g., 50–200) and consider tag_filter plus priority (I/W/E) to reduce noise. Use clear_first only when you need a clean snapshot of new events.

ParameterTypeDescription
params *

start_log_monitoring

Start continuous logcat monitoring; optional file output in ./logs.

ParameterTypeDescription
params *

stop_log_monitoring

Stop a specific or all active log monitors; returns stats.

ParameterTypeDescription
params *

list_active_monitors

List active log monitors (IDs, duration, filter, entries processed).