New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@us-all/android-mcp-server

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@us-all/android-mcp-server

Android MCP server - ADB-based device management, UI automation, logcat, emulator control, and more

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Android MCP Server

Android MCP server — ADB-based device management, UI automation, logcat debugging, emulator control, and more via the Model Context Protocol.

한국어

Why This Server?

FeatureOther Android MCPsThis Server
UI Automation (tap, swipe, screenshot)
UI Hierarchy (accessibility tree)✓ (compact mode for token efficiency)
Logcat filtering & crash log extraction
Emulator lifecycle (AVD start/stop/snapshot)
File management (push/pull)
System info (battery, network, settings)
2-tier security (write + shell gating)
Pure ADB (no Appium/uiautomator2 dependency)
TypeScript + official MCP SDK

Quick Start

npx @us-all/android-mcp-server

2. Docker

docker run --rm \
  --device /dev/bus/usb \
  -e ANDROID_MCP_ALLOW_WRITE=true \
  ghcr.io/us-all/android-mcp-server:latest

3. Build from source

git clone <repo>
cd android-mcp-server
pnpm install
pnpm run build
pnpm start

Configuration

Environment Variables

VariableRequiredDefaultDescription
ANDROID_HOMENoauto-detectAndroid SDK path
ADB_PATHNoadb (PATH)Path to ADB binary
ANDROID_SERIALNoauto (single device)Target device serial number
ANDROID_MCP_ALLOW_WRITENofalseEnable write operations (install, tap, push, etc.)
ANDROID_MCP_ALLOW_SHELLNofalseEnable arbitrary shell command execution

Read-Only Mode (default)

By default, only read operations are permitted. Write operations (tap, install-app, push-file, etc.) return an error unless ANDROID_MCP_ALLOW_WRITE=true is set. Shell command execution requires a separate ANDROID_MCP_ALLOW_SHELL=true flag for additional security.

Claude Desktop

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "android": {
      "command": "npx",
      "args": ["@us-all/android-mcp-server"],
      "env": {
        "ANDROID_MCP_ALLOW_WRITE": "true"
      }
    }
  }
}

Claude Code

Add to your project's .mcp.json:

{
  "mcpServers": {
    "android": {
      "type": "stdio",
      "command": "npx",
      "args": ["@us-all/android-mcp-server"],
      "env": {
        "ANDROID_MCP_ALLOW_WRITE": "true",
        "ANDROID_MCP_ALLOW_SHELL": "true"
      }
    }
  }
}

Or from a local build:

{
  "mcpServers": {
    "android": {
      "type": "stdio",
      "command": "node",
      "args": ["dist/index.js"],
      "cwd": "/path/to/android-mcp-server",
      "env": {
        "ANDROID_MCP_ALLOW_WRITE": "true",
        "ANDROID_MCP_ALLOW_SHELL": "true"
      }
    }
  }
}

Tools (35)

Device (5)

ToolDescriptionR/W
list-devicesList connected devices and emulators with statusR
get-device-infoDevice model, brand, Android version, SDK, display infoR
get-device-propertiesSystem properties via getprop (filterable by prefix)R
connect-deviceConnect to device over TCP/IP (wireless ADB)W
disconnect-deviceDisconnect TCP/IP deviceW

Apps (6)

ToolDescriptionR/W
list-packagesList installed packages (filter by name, type: all/system/3rd-party)R
get-package-infoPackage version, SDK targets, install time, permissionsR
install-appInstall APK file on deviceW
uninstall-appUninstall app (optionally keep data)W
launch-appLaunch app by package name (or specific activity)W
stop-appForce stop an appW

UI Automation (7)

ToolDescriptionR/W
take-screenshotCapture screen as PNG image (returned as base64)R
dump-ui-hierarchyDump accessibility tree — compact mode returns interactive elements only with center coordinates for token efficiencyR
tapTap at (x, y) coordinatesW
long-pressLong press at (x, y) with configurable durationW
swipeSwipe gesture from (x1,y1) to (x2,y2)W
input-textType text (special characters escaped)W
press-keyKey event: BACK, HOME, ENTER, VOLUME_UP, etc.W

Logcat (4)

ToolDescriptionR/W
get-logcatGet recent logs with tag and priority filter (V/D/I/W/E/F)R
clear-logcatClear logcat bufferW
search-logcatSearch logs by text pattern (case-insensitive supported)R
get-crash-logsExtract crash/fatal logs, optionally filtered by packageR

Emulator (5)

ToolDescriptionR/W
list-avdsList available Android Virtual DevicesR
start-emulatorStart AVD (supports headless mode, data wipe)W
stop-emulatorStop a running emulatorW
list-snapshotsList emulator snapshotsR
load-snapshotLoad an emulator snapshotW

Files (4)

ToolDescriptionR/W
list-filesList files on device (supports recursive)R
pull-fileDownload file from device to local filesystemR
push-fileUpload local file to deviceW
delete-fileDelete file or directory on deviceW

System (3)

ToolDescriptionR/W
get-battery-infoBattery level, charging state, temperature, healthR
get-network-infoWiFi status, IP address, connectivity detailsR
change-settingModify system/secure/global settingsW

Shell (1)

ToolDescriptionR/W
execute-shellExecute arbitrary ADB shell command (requires ANDROID_MCP_ALLOW_SHELL)W

Architecture

┌──────────────────────────────────────────────────────┐
│                 Claude / AI Client                   │
└─────────────────────┬────────────────────────────────┘
                      │ MCP Protocol (stdio)
                      ▼
┌──────────────────────────────────────────────────────┐
│           android-mcp-server (index.ts)              │
│                                                      │
│  ┌─────────┐  ┌──────────────────────────────────┐   │
│  │config.ts│  │          tools/                   │   │
│  │ ADB path│  │  device.ts  ── 5 tools           │   │
│  │ serial  │  │  apps.ts    ── 6 tools           │   │
│  │ perms   │  │  ui.ts      ── 7 tools           │   │
│  └─────────┘  │  logcat.ts  ── 4 tools           │   │
│               │  emulator.ts── 5 tools           │   │
│  ┌─────────┐  │  files.ts   ── 4 tools           │   │
│  │ adb.ts  │  │  system.ts  ── 3 tools           │   │
│  │ wrapper │  │  shell.ts   ── 1 tool            │   │
│  └─────────┘  │  utils.ts   ── error handling    │   │
│               └──────────────────────────────────┘   │
└─────────────────────┬────────────────────────────────┘
                      │ child_process (execFile)
                      ▼
┌──────────────────────────────────────────────────────┐
│              ADB (Android Debug Bridge)              │
│                                                      │
│         USB / TCP-IP / Emulator connection            │
└─────────────────────┬────────────────────────────────┘
                      │
                      ▼
               Android Device

Tech Stack

  • Runtime: Node.js 18+
  • Language: TypeScript 5.x (strict mode, ESM)
  • MCP SDK: @modelcontextprotocol/sdk 1.27+
  • Validation: zod 4.x
  • XML Parser: fast-xml-parser (UI hierarchy parsing)
  • Android: ADB via child_process (no Appium, no uiautomator2)
  • Testing: vitest (fork pool isolation)
  • Package Manager: pnpm

Security

  • Read-only by default — All write operations blocked unless ANDROID_MCP_ALLOW_WRITE=true
  • Shell gating — Arbitrary shell commands require separate ANDROID_MCP_ALLOW_SHELL=true
  • Error sanitization — API keys, tokens, passwords redacted from all error outputs
  • Input validation — All parameters validated via zod schemas before execution
  • No ambient authority — No global state mutation; explicit device targeting via serial

Development

pnpm install          # Install dependencies
pnpm run dev          # Watch mode (tsc --watch)
pnpm run build        # Compile TypeScript → dist/
pnpm test             # Run unit tests
pnpm start            # Run MCP server

Adding a new tool

  • Define zod schema + async handler in src/tools/<category>.ts
  • Import and register with server.tool() in src/index.ts
  • Use wrapToolHandler() for consistent response formatting
  • Use assertWriteAllowed() for write operations
  • Run pnpm run build && pnpm test

Contributing

See CONTRIBUTING.md for development guidelines.

License

MIT

Keywords

mcp

FAQs

Package last updated on 28 Mar 2026

Related posts