Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
ADB_PATHNoPath to the adb binary. Must match the version of any running adb server.adb
ADBMCP_TIMEOUT_MSNoDefault subprocess timeout (timeout_ms per call overrides it).30000
ADBMCP_ALLOWED_DEVICESNoComma-separated serial allowlist. Operations on other serials are refused. Unset means all devices are allowed.
ADBMCP_MAX_OUTPUT_BYTESNoHead+tail byte cap per call; the dropped middle is reported inline.65536
ADBMCP_PUSH_ALLOWED_ROOTSNoRemote roots push_file may write to./sdcard,/storage/emulated/0,/data/local/tmp
ADBMCP_LOGCAT_BUFFER_BYTESNoRing-buffer cap per logcat stream; overflow is reported as dropped_bytes.1048576
ADBMCP_CLEAR_ALLOWED_PACKAGESNoComma-separated package allowlist for clear_app_data. There is no allow-all mode: unset or empty refuses every clear.
ADBMCP_SHELL_ALLOWED_PREFIXESNoWhen set, a shell command must start with one of these comma-separated prefixes. Unset means no prefix restriction.
ADBMCP_SHELL_BLOCKED_PATTERNSNoComma-separated JavaScript regex sources tested against the whole shell command. Overriding replaces the defaults.reboot,su,rm -rf /,mkfs,wipe

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": true
}
resources
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_devicesA

List Android devices and emulators known to adb with their serial, connection state and model. Call this first to discover serials for the "device" parameter of other tools.

get_device_infoA

Read a curated set of build properties (model, Android version, SDK level, ABI) plus screen size and density for one device. Use it instead of shell getprop when you only need identity/build details.

shellA

Escape hatch: run an arbitrary command through adb shell on one device and return stdout/stderr. Powerful but not read-only — destructive commands are refused by default (reboot, su, mkfs, wipe, rm of / including split/reordered flags and the /* glob, and pipelines into sh/bash such as curl … | sh or … | sudo bash). This is a guardrail, not a sandbox: a deliberately obfuscated command can still get through. Prefer the dedicated tools (list_packages, install_apk, get_ui_hierarchy, …) when they cover the job. A non-zero remote exit code is reported as exit_code: N in the output. If the call times out, only the host-side adb client is killed; the command keeps running on the device (inherent to adb).

list_packagesA

List package names installed on one device (optionally filtered by a substring of the package name), e.g. filter "com.example" to find only the app you care about.

install_apkA

Install a local APK on one device via adb install. Fails with INSTALL_FAILED_* details from the device when the package cannot be installed.

uninstall_packageA

Remove an application from one device via adb uninstall. Destructive: the app is deleted from the device (use keep_data to keep its data directory).

grant_permissionA

Grant a runtime permission to an app (pm grant <package> <permission>). Destructive: it changes the permissions the app holds; revoke_permission reverses it. Only changeable runtime permissions work; on stock Android these can be granted to non-debuggable apps too, though some restricted permissions still reject the shell.

revoke_permissionA

Revoke a runtime permission from an app (pm revoke <package> <permission>). Destructive: the app loses the permission immediately and may fail until it is granted again.

clear_app_dataA

Delete all data stored by an app (pm clear <package>). Destructive and allowlist-gated: the server refuses unless the package is listed in ADBMCP_CLEAR_ALLOWED_PACKAGES (comma-separated); an unset or empty value refuses every clear.

logcat_snapshotA

Dump the current logcat buffer (adb logcat -d) from one device, optionally filtered to a log tag. Bounded output; use the stream tools when you need to watch logs over time.

start_logcat_streamA

Start a long-lived adb logcat process on one device and return a stream_id. Poll it with read_logcat_stream and release it with stop_logcat_stream. Streams are killed when the server shuts down.

read_logcat_streamA

Return buffered logcat output accumulated since the previous read of this stream. Output is capped per call; anything not returned stays buffered for the next read. Dropped bytes are reported when the ring buffer overflowed.

stop_logcat_streamA

Terminate a logcat stream and forget its stream_id. Up to max_bytes of output buffered but not yet read is returned in this result; any excess is discarded and reported.

screenshotA

Capture the current screen of one device (exec-out screencap -p) and return it as a PNG image. Follow up with get_ui_hierarchy when you need element coordinates instead of pixels.

pull_fileA

Copy a file from the device to the host machine (adb pull). Refuses to overwrite an existing host file unless overwrite is true. This writes to the host filesystem, so it is not a read-only tool.

push_fileA

Copy a file from the host machine to the device (adb push). For safety the remote path must be inside the configured allowed roots (default /sdcard, /storage/emulated/0, /data/local/tmp).

forward_portA

Create a port forward from the host to the device (adb forward), e.g. local "tcp:8080" to remote "tcp:8080". Use it to reach a device-side server (app HTTP server, debug port) from host-only test tooling.

remove_forwardA

Remove a port forward created with forward_port (adb forward --remove <local>).

reverse_portA

Create a reverse socket connection (adb reverse): the device listens on the remote spec and connections are forwarded to the local spec on the host machine. Use it to let device-side code (app under test, on-device scripts) reach a server running on your machine.

remove_reverseA

Remove a reverse socket connection created with reverse_port (adb reverse --remove <remote>).

list_forwardsA

List the forward socket connections of one device (adb forward --list) as a JSON array of {serial, local, remote} objects (empty array when there are none).

list_reversesA

List the reverse socket connections of one device (adb reverse --list) as a JSON array of {serial, remote, local} objects (empty array when there are none). remote is the device-side listen spec, local the host-side target.

connectA

Connect adb to a device over TCP/IP (adb connect <host>:<port>), e.g. "192.168.1.42:5555"; a successful connect adds the device to list_devices. Not device-scoped: the address selects the device, and no serial exists until the connection is established. IPv6 literals (e.g. "[::1]:5555") and a bare host without :port are not accepted; specify host:port explicitly. On Android 10+ enable Wireless debugging on the device first; on Android 11+ that also needs a one-time pairing first — call wireless_pair with the code from the Wireless debugging screen, then connect to the port shown there (the pairing port and this connect port are different).

disconnectA

Disconnect one TCP/IP-connected device (adb disconnect <host>:<port>) or, when address is omitted, every TCP/IP-connected device (adb disconnect). USB connections are unaffected. Not device-scoped: for a TCP/IP device the address itself is the serial.

wireless_pairA

Pair with an Android 11+ device for wireless debugging (adb pair <host>:<pair_port> <code>), using the pairing code from Settings > Developer options > Wireless debugging > "Pair device with pairing code". This is step one of a two-step flow: after "Successfully paired", call connect with the same host and the port shown on the main Wireless debugging screen — the temporary pairing port above is not that connect port. Pairing codes expire after a couple of minutes, so ask the user for a fresh code if this fails.

start_activityA

Launch an activity on one device (am start) either by component ("com.example/.MainActivity") or by intent action ("android.intent.action.VIEW" with optional data/extras). Use wait: true to block until the activity is reported as displayed.

launch_packageA

Launch an installed app by package id: resolve its LAUNCHER activity (cmd package resolve-activity --brief) and start it (am start -n, with -W when wait is true). Returns the resolved component so later calls can use start_activity without re-resolving. The monkey -p <package> 1 one-liner exists, but this keeps everyday launches off the shell escape hatch.

force_stop_appA

Stop all processes of a package on one device (am force-stop). Idempotent; safe to call when the app is not running.

get_ui_hierarchyA

Dump the current view hierarchy of one device as uiautomator XML (uiautomator dump), including bounds, resource ids, text and clickability. Use it to find stable selectors before driving the UI through shell (input tap/text). With to_file: true the XML is kept on the device at /data/local/tmp/adbmcp-ui-.xml and returned as {path, bytes} instead of inline text, so large dumps stay structurally valid; retrieve it with pull_file. Dumps accumulate at that prefix by design — remove them with the shell tool (rm ) after pulling.

tapA

Tap a point on the device screen (input tap X Y). Coordinates are device pixels: read them from get_ui_hierarchy bounds or get_device_info screen_size, and screenshot after the tap to verify the result (screenshot → decide → act loop). If the display is off, wake it first with key_event WAKEUP — input events are dropped while the screen is off.

swipeA

Swipe from (x1, y1) to (x2, y2) (input swipe X1 Y1 X2 Y2 [duration_ms]), e.g. to scroll a list or dismiss a card. duration_ms is the gesture time in milliseconds (device default 300 when omitted); a longer duration drags more slowly. Coordinates are device pixels; screenshot afterwards to verify the result.

type_textA

Type text into the focused input field (input text <text>). Spaces are encoded as %s (adb's space form) and shell metacharacters are quoted, so the text reaches the device intact; note that a literal "%s" in text still becomes a space on the device. Focus the field first (tap it), and screenshot to confirm what was typed.

key_eventA

Send one key event to the device (input keyevent <code>). Pass a named key (HOME, BACK, ENTER, DEL, MENU, POWER, VOLUME_UP, VOLUME_DOWN, TAB, ESCAPE, APP_SWITCH, WAKEUP, SLEEP) or a raw Android keycode 0-300. Use WAKEUP (or POWER) before driving a screen that may be off, and BACK/HOME to navigate.

dumpsys_queryA

Read a curated Android system service dump (dumpsys <service> [args...]): "battery" for charge/level, "activity" for tasks and activities, "window" for windows and display state, "connectivity" for network state. Output can be huge — "activity" especially — so it is capped (64 KB maximum) with a head+tail truncation marker where bytes were dropped; pass extra_args to narrow it (e.g. "activities" or "windows"). Other dumpsys services are intentionally not exposed; use shell for those.

adb_server_restartA

Recover from adb server version conflicts by running adb kill-server followed by adb start-server, then report the device list. Affects the shared adb server on this host (Android Studio and other tools use it too), so call it only when adb reports a server/version problem or a device is stuck.

Prompts

Interactive templates invoked by user choice

NameDescription
debug_crashCollect the evidence for an app crash: device info, filtered logcat, and reproduce the failure.
install_and_launchInstall a freshly built APK, launch it, and verify that it started without crashing.
capture_bug_reportGather device info, logs, screenshot and UI hierarchy for a bug report on one device.

Resources

Contextual data attached and managed by the client

NameDescription
devicesLive list of devices/emulators known to adb (serial, state, model, transport id), including whether ADBMCP_ALLOWED_DEVICES permits each serial. Re-read to refresh: device state is never cached.

TDQS

A3.9/5.0

Scored across 35 tools

Disambiguation4/5

Most tools have clearly distinct purposes, and the forward/reverse and logcat streaming tool groups are well differentiated by their descriptions. Minor ambiguity exists between start_activity and launch_package, and shell intentionally overlaps with many dedicated tools, but the descriptions explicitly guide correct selection.

Naming Consistency4/5

All names use snake_case, and most follow a verb_noun pattern (list_devices, install_apk, grant_permission, pull_file). A few deviate with noun-first or single-word names (logcat_snapshot, dumpsys_query, screenshot, shell), but the convention remains readable and consistent.

Tool Count3/5

35 tools is heavy for a single server. Each tool maps to a distinct adb operation, which justifies breadth, but some groups could be consolidated (e.g., forward/reverse families, logcat stream lifecycle), making the set borderline overloaded.

Completeness4/5

The surface covers device connection, app lifecycle, file transfer, logging, UI automation, shell, and dumpsys querying well. Minor gaps exist around device reboot, system settings, and screen recording, but most workflows can be completed with the available tools.

Maintenance

ActivityNo data
ResponsivenessSyncing