← back to work
case study · /adb-mcp · open source

ADB MCP.

An open-source MCP server that gives AI assistants and MCP clients structured access to Android Debug Bridge through typed, validated tools. Built during my time at L&T to drive Android QA workflows from agents instead of raw shell glue.

open source MCP server 38 tools zod schemas node · typescript LTTS
↗ github ↗ medium ↗ linkedin

38 ADB tools, schema-validated.

devices
list, connect, disconnect, reboot, IP setup over WiFi
shell
arbitrary commands, with structured stdout/stderr
packages
install, uninstall, list, info, clear data, force-stop
files
push, pull, ls, rm, mkdir on /sdcard
screenshots
capture full or partial, save to host
logs & bugreports
logcat with filters, bugreport zip generation
intents
start activities, send broadcasts, deep-links
settings
global / system / secure read & write
+ more
input (tap, swipe, text), screen recording, dumpsys, am, pm

Stop turning Android workflows into shell glue.

Every Android QA project ends up with a folder full of run-on-device-X.sh, install-and-test.sh, capture-bugreport.sh. Each engineer writes their own. Each is fragile in a different way.

This puts an MCP layer in front of ADB so any agent (Codex, Claude, Cursor, custom) can:

  • Call a typed, validated tool instead of guessing at shell flags.
  • Get structured output back instead of stdout to grep.
  • Use MCP resources and prompt templates for common debugging flows.
  • Drive emulators and physical devices the same way (USB or WiFi).

What this unlocks for QA: AI-driven bug triage that opens the app, taps through a flow, captures logcat + screenshot + bugreport, and writes the structured artifact back to the ticket. All from one tool.

Schemas keep agents from drifting.

// example tool: install_apk
const installApkSchema = z.object({
  deviceId: z.string().regex(/^[A-Za-z0-9-_:.]+$/),
  apkPath:  z.string().refine(p => existsSync(p), 'apk not found'),
  reinstall: z.boolean().default(true),
  grantAllPermissions: z.boolean().default(false),
});

export const installApk = {
  name: 'install_apk',
  description: 'Install an APK on a specific device with optional reinstall and permission grants.',
  inputSchema: installApkSchema,
  handler: async (args) => { /* run adb install -r -g */ }
};

// every tool has a Zod schema · agents can't pass garbage in · errors are structured, not raw exit codes

LLM skill bundled in the repo.

The repo ships with a companion LLM skill (Markdown) that teaches an agent how to use the 38 tools coherently — "to triage a bug, first list devices, then install the apk, then drive the repro flow, then capture logcat + screenshot." Drop it into Claude Projects, Custom GPTs, Codex skills, or any MCP client that supports skill files.