Labsco
yamsergey logo

Dev Tools for Android (DTA) MCP

โ˜… 47

from yamsergey

MCP server which expose Android's app runtimes to coding agents.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

Development Tools for Android (DTA)

A toolkit that gives AI assistants direct access to Android devices through the Model Context Protocol. Your coding agent can see the screen, read network traffic, inspect layout trees, mock responses, and interact with the app โ€” from Android Studio, the terminal, or any MCP client.

Video overview

Article: Debugging Android Apps with AI

What Can Your Agent Do?

Screen Analysis

DTA returns the real UI hierarchy โ€” view classes, bounds, positions, layout parameters, Compose-specific data (composable names, recomposition counts), and DOM trees from WebViews and Chrome Custom Tabs. Unlike adb shell uiautomator dump which gives a semantic accessibility tree, your agent gets the full picture.

Network Analysis

Sidekick auto-records from app launch โ€” HTTP requests (OkHttp), WebSocket connections, Chrome Custom Tab traffic, and WebView network requests. No "start recording" button, no missed requests. Your agent can query the full history at any point.

Mocking

Create mock rules for HTTP and WebSocket from captured data or from scratch. Plug in custom adapters for programmatic control:

Sidekick.configure(
    SidekickConfig.builder()
        .httpMockAdapter { transaction, proposedResponse ->
            proposedResponse.withBody("""{"message": "mocked"}""")
        }
        .build()
)

Build & Launch

The run_app tool builds an APK with sidekick auto-injected, installs it, and launches the main activity โ€” all from a single MCP call. No manual Gradle setup. If the tool is blocked by your environment's sandbox, it returns the exact shell commands as a fallback.

Verification

The agent can tap, swipe, input text, and press keys โ€” then check the screen state and network traffic to confirm behavior. A full inspect-mock-interact-verify loop without leaving the conversation.

Android Studio Plugin

The DTA Inspector tool window provides four tabs:

TabFeatures
LayoutUI tree + device screenshot with hover highlighting, click-to-select, bidirectional selection sync
NetworkHTTP request table with headers, bodies, timing; Custom Tab + WebView traffic
WebSocketConnection list โ†’ message list โ†’ message detail
MCPEnable HTTP server, pick port, per-agent config snippets with copy-to-clipboard

The plugin auto-injects dta-sidekick into debug builds via a Gradle init script โ€” no changes to your project files.

Inspector Web Interface

dta-cli inspector-web

Open http://localhost:8080 for visual inspection with the same capabilities โ€” layout tree, network, WebSocket, mock rule editor.

The web inspector enables bidirectional communication between developer and agent โ€” select elements with a click instead of describing them in words.

MCP Transports

TransportCommandUse case
stdiodta-cli mcpClaude Desktop, Cursor, any stdio MCP client
HTTPdta-cli mcp serve --http --port 12321AS Gemini, Claude Code HTTP, any Streamable HTTP client
PluginEnable in MCP tabHTTP server embedded in AS, no CLI needed

Modules

ModuleDescription
dta-pluginAndroid Studio plugin (4-tab inspector + embedded daemon + MCP server)
dta-cliCLI interface (mcp, inspector-web, run, inspect commands)
dta-mcpMCP server (stdio + HTTP transport, tool definitions)
dta-daemonJavalin HTTP daemon (sidekick connection, CDP watcher, layout enrichment)
dta-sidekickIn-app inspection library (Android AAR, auto-init via AndroidX Startup)
tools-androidCore Gradle Tooling API integration
workspace-kotlinworkspace.json converter for Kotlin Language Server

CLI Reference

dta-cli --help
dta-cli <command> --help