Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DEVILGE_ADB_PATHNoAbsolute path to the adb binary.adb (from PATH)
DEVILGE_LOG_LEVELNoOne of error, warn, info, debug.info
DEVILGE_FLOWS_ROOTNoWhere Maestro YAML flows live.<project>/devilge-flows/
DEVILGE_KTOR_LOG_TAGNoLogcat tag the HTTP-client logger writes under.HttpClient
DEVILGE_OUTPUTS_ROOTNoWhere screenshots / UI dumps land.<project>/.devilge-outputs/
DEVILGE_HTTP_LOG_FORMATNoWhich parser(s) to apply: ktor, okhttp, or auto.auto
DEVILGE_LOGCAT_MAX_LINESNoDefault cap for get_logcat. Hard upper bound: 5000.500
DEVILGE_MAESTRO_BIN_PATHNoAbsolute path to the maestro binary.auto-detected from PATH
DEVILGE_ALLOW_FLOW_SCRIPTSNoSet to true to allow runScript: blocks inside Maestro YAML.false
DEVILGE_ANDROID_PROJECT_ROOTYesAbsolute path to the Android/KMM project. All file reads are sandboxed under this directory.
DEVILGE_DEFAULT_DEVICE_SERIALNoDefault serial used when a tool call omits it.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
devilge_list_devicesA

Lists every Android device or emulator currently visible to ADB on this machine.

devilge_get_logcatA

Reads recent logcat output from a connected Android device or emulator using adb. Useful for diagnosing crashes, ANRs, runtime errors, and tracing application logs.

devilge_list_compose_previewsA

Statically scans the configured Android/KMM project for Jetpack Compose @Preview functions and returns their locations plus parsed annotation parameters.

devilge_get_compose_preview_sourceA

Returns the full source code of a @Preview composable, including its annotations and body.

devilge_get_project_structureA

Returns a high-level snapshot of the configured Android/KMM Gradle project: modules, types (android-app / kmm-shared / library), source sets, and key versions.

devilge_get_compose_previews_treeA

Returns every Jetpack Compose @Preview in the project organized as modules → files → functions → variants. Multiple @Preview annotations on the same Composable are grouped as variants of one function. Includes a totals summary by group and an orphans bucket for previews outside any known module.

devilge_get_network_callsA

Returns recent HTTP request/response pairs captured from the running Android app. Parses two formats from logcat: Ktor Logging plugin (tag "HttpClient" by default) and OkHttp HttpLoggingInterceptor (tag "OkHttp" by default — used by Retrofit). The format is auto-detected by content; configure via DEVILGE_HTTP_LOG_FORMAT if needed. Requires the app's HTTP logger to be active (Ktor LogLevel.HEADERS+ / OkHttp Level.HEADERS+; BODY/ALL recommended to capture bodies). Sensitive headers (Authorization, Cookie, Set-Cookie, X-API-Key, etc.) are redacted automatically.

devilge_resize_logcat_bufferA

Increase the device-side logcat ring buffer so that recent HTTP / app logs are not evicted within seconds. Applies to subsequent captures only — entries already lost are gone. Recommended whenever Ktor LogLevel.ALL produces dozens of lines per request.

devilge_run_gradle_taskA

Runs a Gradle task in the configured Android/KMM project (via the project's gradlew wrapper) and returns a structured summary: success flag, parsed compile errors (kotlinc/javac/kapt/ksp), JUnit test results from build/test-results, Android Lint findings, "What went wrong" failure blocks, plus the tail of stdout/stderr.

devilge_get_app_errorsA

Returns recent error-level logs for a specific Android app, filtered by its package name (resolved to PID via adb shell pidof). Multi-line stack traces are coalesced into a single entry with message + stackTrace[]. Default minLevel is "E"; default exclusions filter common Android system noise (Choreographer, OpenGLRenderer, etc.). Returns empty if the app is not running.

devilge_inspect_packagesA

Lists Android applicationIds installed on the device, optionally filtered by a substring. For each match, reports whether a process is currently running and its PID. Use this to discover the right packageName value before calling devilge_get_app_errors.

devilge_take_screenshotA

Captures the current device screen (adb exec-out screencap -p) and saves a PNG under the configured outputs directory. Returns the absolute path so the LLM client can read the image. Default outputs root: <projectRoot>/.devilge-outputs/screenshots/.

devilge_dump_uiA

Captures the current foreground UI tree using uiautomator dump. Returns a structured tree of nodes (text, resourceId, contentDescription, bounds, clickable, etc.). Useful for finding elements by text/ID before tapping, or for reasoning about layout state.

devilge_input_tapA

Sends a tap (adb shell input tap) at the given device pixel coordinates. Prefer the higher-level devilge_tap_text (Phase 13) when available — it is more resilient to layout changes than raw coordinates.

devilge_input_textA

Types the given text into whatever field currently has focus on the device (adb shell input text). Spaces are escaped to %s by adb. NUL bytes and newlines are rejected.

devilge_input_keyA

Sends a key event (adb shell input keyevent KEYCODE_<NAME>). Allowed keys: BACK, HOME, MENU, APP_SWITCH, POWER, ENTER, TAB, DEL, FORWARD_DEL, ESCAPE, DPAD_UP, DPAD_DOWN, DPAD_LEFT, DPAD_RIGHT, DPAD_CENTER, VOLUME_UP, VOLUME_DOWN, VOLUME_MUTE, PAGE_UP, PAGE_DOWN, MOVE_HOME, MOVE_END, SEARCH.

devilge_input_swipeA

Sends a swipe gesture (adb shell input swipe) from (x1,y1) to (x2,y2) over durationMs (default 300). Useful for scrolling lists, dismissing overlays, performing simple gestures.

devilge_set_input_visualizationA

Toggles the device-side developer options "Show touches" and "Pointer location". When enabled, every tap/swipe leaves a visible marker on screen and the live coords appear in a debug strip — useful to confirm input_tap/input_swipe are landing where expected. Persists until the device reboots. Recommended: enable once at start of a driving session, disable when done.

devilge_tap_textA

Internally dumps the UI, finds the unique node whose text or contentDescription matches, and taps its bounds center. Errors when 0 or >1 matches — the caller must disambiguate with a more specific text or use contains for substring match.

devilge_tap_resource_idA

Like devilge_tap_text but matches by resource-id. More stable across copy/locale changes than text matching when the project uses Modifier.testTag.

devilge_set_textA

Locates the input field associated with a label, taps to focus it, and types the given value. Heuristic: focused EditText → contentDescription match → text match → EditText after a label TextView. Returns the matched field summary.

devilge_wait_for_textA

Polls the UI dump until a node whose text or contentDescription matches appears, or the timeout elapses. Returns {matched, attempts, elapsedMs, matchedNode?}. Never throws — the caller branches on matched.

devilge_wait_for_resource_idA

Polls the UI dump until a node with the given resource-id appears, or timeout.

devilge_wait_for_idleA

Polls the UI dump and returns when N consecutive dumps have an identical structural digest, or the timeout elapses. Useful between a tap and the next action to absorb animations / asynchronous updates without sleeps.

devilge_launch_appA

Launches the app via am start -W. Returns cold-start metrics (waitTimeMs / totalTimeMs / thisTimeMs) when available. With clean=true, force-stops and wipes app data first. With deepLink, opens an arbitrary URI handled by the app. With activity, targets a specific component. Without either, devilge resolves the launcher activity automatically (falls back to monkey if resolution fails).

devilge_force_stop_appA

Runs am force-stop <pkg> — kills every process of the given app. Useful before relaunch to ensure a cold start, or when an app is hung.

devilge_clear_app_dataA

Runs pm clear <pkg> — wipes all app data including caches, databases, SharedPreferences, tokens. The app behaves like a fresh install on next launch. DESTRUCTIVE. Recommended only on dev emulators or wiped test devices, never on personal devices with logged-in apps.

devilge_run_instrumented_testsA

Runs :<module>:connectedDebugAndroidTest against an attached device, optionally filtered to a single class or class#method. Returns the same structured result as devilge_run_gradle_task (success, JUnit-parsed testResults, compile errors, build failures, raw output tail). Reuses the existing JUnitXmlParser to read androidTest results.

devilge_install_apkA

Installs an APK via adb install -r directly, bypassing Gradle. Much faster than run_gradle_task installDebug for the iterate-on-source-then-reinstall loop. Pass either apkPath (explicit file) or module (auto-locate <projectRoot>/<module>/build/outputs/apk/<variant>/*.apk). Recommended workflow: assemble once with run_gradle_task assembleDebug, then re-install with this tool on each iteration — saves the Gradle configuration overhead each time.

devilge_run_maestro_flowA

Executes a Maestro YAML flow from DEVILGE_FLOWS_ROOT (default: /devilge-flows/). Maestro is OPTIONAL — if not installed, this tool returns MAESTRO_NOT_INSTALLED with the install command (brew install maestro). When installed, runs maestro test <flow> with optional params injected as -e KEY=VALUE. runScript: blocks in the YAML are denied by default; set DEVILGE_ALLOW_FLOW_SCRIPTS=true to allow. MAESTRO_DISABLE_ANALYTICS is always injected.

devilge_list_maestro_flowsA

Lists every *.yaml/*.yml flow file under DEVILGE_FLOWS_ROOT, returning name, relative path, size and a 5-line preview. Works WITHOUT Maestro installed — useful to see what reusable flows exist before deciding whether to invest in installing Maestro.

devilge_validate_maestro_flowA

Statically validates a flow YAML: requires appId:, --- separator, at least one step, and flags runScript: blocks (denied unless DEVILGE_ALLOW_FLOW_SCRIPTS=true). Does NOT execute Maestro — works without the binary installed. Use this before run_maestro_flow to surface syntactic problems quickly.

devilge_batchA

Executes a sequence of devilge tools sequentially in a single MCP call. Stops on the first error. Use this to chain predictable steps such as tap → wait_for_idle → take_screenshot, reducing tool-call overhead and permission prompts in the host UI.

Rules: • Capped at 20 actions per call. • Cannot call itself (no nesting). • Cannot include destructive tools (devilge_clear_app_data, devilge_install_apk). Invoke those directly so the user always sees a dedicated confirmation prompt. • Each sub-tool's input is validated before its handler runs.

Returns the concatenated content of every successful step, prefixed with a step label, plus a summary line. On failure, sets isError=true and reports which step stopped the batch and why.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/Yercko/devilge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server