AM

anjos2/mcp-android-emulator

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

20 stars 3 forks 品質 72 トレンド 10MIT

MCP Server for Android Emulator interaction via ADB - enables AI assistants to control Android devices

概要

A Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with Android devices and emulators via ADB (Android Debug Bridge). - : Capture device screen as base64 images - : Get UI hierarchy (like DOM but for Android) - : Tap, swipe, scroll, pinch zoom, multi-tap gestures - : Type, clear, select all, set text in input fields - : Press BACK, HOME, ENTER, VOLUME, etc. - : Launch, install, force stop, clear data - : Get and set clipboard content - : Rotate screen, get device info - : Access logcat with filters and log levels - : Wait for elements, UI stability, assertions for testing - : Tap avoiding system bars, element bounds detection - Node.

README

以下は原文 README の抜粋です。原文を見る。

MCP Android Emulator

A Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with Android devices and emulators via ADB (Android Debug Bridge).

Features

  • Screenshots: Capture device screen as base64 images
  • UI Inspection: Get UI hierarchy (like DOM but for Android)
  • Touch Input: Tap, swipe, scroll, pinch zoom, multi-tap gestures
  • Text Input: Type, clear, select all, set text in input fields
  • System Keys: Press BACK, HOME, ENTER, VOLUME, etc.
  • App Management: Launch, install, force stop, clear data
  • Clipboard: Get and set clipboard content
  • Device Control: Rotate screen, get device info
  • Logs: Access logcat with filters and log levels
  • Wait & Assert: Wait for elements, UI stability, assertions for testing
  • Safe Interactions: Tap avoiding system bars, element bounds detection

Requirements

  • Node.js 18+
  • ADB (Android Debug Bridge) installed
  • One of the following:
    • Android Studio Emulator (AVD)
    • Redroid (Docker-based Android)
    • Genymotion
    • Physical Android device via USB/WiFi

Installation

npm install -g mcp-android-emulator

From source

git clone https://github.com/Anjos2/mcp-android-emulator.git
cd mcp-android-emulator
npm install
npm run build

Quick Start

1. Ensure ADB is working

adb devices
# Should show your device/emulator

2. Add to Claude Code

claude mcp add android-emulator -- npx mcp-android-emulator

3. Start using

Ask Claude: “Take a screenshot of the Android device”


Configuration

Environment Variables

Variable Default Description
ADB_PATH adb Path to ADB executable
SCREENSHOT_DIR /tmp/android-screenshots Directory for temporary screenshots

Claude Code Integration

Option 1: CLI command

claude mcp add android-emulator -- npx mcp-android-emulator

Option 2: Manual configuration

Edit ~/.claude.json:

{
  "mcpServers": {
    "android-emulator": {
      "command": "npx",
      "args": ["mcp-android-emulator"],
      "env": {
        "ADB_PATH": "/path/to/adb"
      }
    }
  }
}

Claude Desktop Integration

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "android-emulator": {
      "command": "npx",
      "args": ["mcp-android-emulator"],
      "env": {
        "ADB_PATH": "/path/to/adb"
      }
    }
  }
}

Available Tools (40 tools)

Screen Capture & UI

Tool Description
screenshot Capture screen as base64 PNG image
get_ui_tree Get UI element hierarchy with coordinates
GitHub で README 全文を見る

インストール

npx mcp-android-emulator
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "android-emulator": { "command": "npx", "args": ["mcp-android-emulator"], "env": { "ADB_PATH": "/path/to/adb" } } } }