android-mcp-server

android-mcp-server

21-tool Android device control via ADB — screenshots with compression, UI tree inspection, touch automation, logcat, and compound actions like tap-and-wait.

Category
访问服务器

README

Android MCP Server

npm version npm downloads License: MIT android-mcp-server MCP server Awesome MCP Servers Socket
Badge

MCP server for controlling Android emulators and devices via ADB. Gives AI assistants the ability to see, interact with, and debug Android apps — taking screenshots, tapping elements, reading logs, and documenting bugs.

npm Package | GitHub | Issues

ezgif-3bbb68e918812643 ^ Sped up for better viewing. More demos and test cases.

Features

  • 25 tools for complete Android device control
  • Screenshot capture with intelligent compression (Sharp-based, max 1280px)
  • UI tree inspection — read element hierarchy with bounds, text, resource IDs, and state
  • Touch automation — tap, swipe, scroll, type text, press hardware keys
  • Element targeting — find and tap elements by resource-id, text, or content-desc
  • App lifecycle — install APKs, launch apps, inspect current activity
  • Logcat integration — filter by package, log level, or timestamp
  • Device management — list devices, start emulators, get device info
  • Compound actionstap_and_wait combines tap + settle + UI tree in one round trip
  • Persistent ADB shell — reuses a single shell session for faster command execution
  • Device info caching — queries device properties once per session
  • Multi-device support — target specific devices by ID
  • Zero app modifications — works with any Android app via ADB, no SDK integration needed

Prerequisites

  • Node.js 18+
  • Android SDK with platform-tools (ADB) and emulator
  • A running Android emulator or connected device

Finding your ANDROID_HOME

The server auto-discovers the SDK at ~/Library/Android/sdk (macOS) or via ANDROID_HOME. If your SDK is elsewhere, set ANDROID_HOME in the MCP config (see below).

To check:

# macOS
ls ~/Library/Android/sdk/platform-tools/adb

# Or find it via Android Studio: Settings > Languages & Frameworks > Android SDK

Setup

<details> <summary><b>Claude Code</b></summary>

claude mcp add --scope user android -- npx -y android-mcp-server

This registers the server globally so it's available in all projects. Use --scope project instead to limit it to the current project.

If your SDK is not in the default location:

claude mcp add --scope user --env ANDROID_HOME=/path/to/sdk android -- npx -y android-mcp-server

</details>

<details> <summary><b>Claude Desktop</b></summary>

Add to your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "android": {
      "command": "npx",
      "args": ["-y", "android-mcp-server"],
      "env": {
        "ANDROID_HOME": "/path/to/android/sdk"
      }
    }
  }
}

</details>

<details> <summary><b>VS Code</b></summary>

Add to your VS Code settings (.vscode/settings.json):

{
  "mcp": {
    "servers": {
      "android": {
        "command": "npx",
        "args": ["-y", "android-mcp-server"],
        "env": {
          "ANDROID_HOME": "/path/to/android/sdk"
        }
      }
    }
  }
}

</details>

<details> <summary><b>Cursor</b></summary>

Add to your Cursor MCP config (~/.cursor/mcp.json):

{
  "mcpServers": {
    "android": {
      "command": "npx",
      "args": ["-y", "android-mcp-server"],
      "env": {
        "ANDROID_HOME": "/path/to/android/sdk"
      }
    }
  }
}

</details>

<details> <summary><b>Windsurf</b></summary>

Add to your Windsurf MCP config (~/.codeium/windsurf/mcp_config.json):

{
  "mcpServers": {
    "android": {
      "command": "npx",
      "args": ["-y", "android-mcp-server"],
      "env": {
        "ANDROID_HOME": "/path/to/android/sdk"
      }
    }
  }
}

</details>

<details> <summary><b>Project config (.mcp.json)</b></summary>

Add to your project's .mcp.json (checked into version control so your team gets it too):

{
  "mcpServers": {
    "android": {
      "command": "npx",
      "args": ["-y", "android-mcp-server"],
      "env": {
        "ANDROID_HOME": "/path/to/android/sdk"
      }
    }
  }
}

</details>

<details> <summary><b>Build from source</b></summary>

git clone https://github.com/martingeidobler/android-mcp-server.git
cd android-mcp-server
npm install
npm run build
claude mcp add --scope user android -- node /path/to/android-mcp-server/dist/index.js

</details>

Available Tools

Device Management

Tool Description
list_devices List connected Android devices and emulators
list_avds List available Android Virtual Devices
start_emulator Start an AVD by name (waits up to 60s)

Screenshot & UI Analysis

Tool Description
screenshot Take screenshot for visual analysis. Optional save_path to save to disk
get_ui_tree Get UI element hierarchy with bounds, text, resource IDs, and state

Interaction

Tool Description
tap Tap at screen coordinates
tap_element Tap element by resource-id, text, or content-desc
tap_and_wait Tap element, wait for UI to settle, return new UI tree — single round trip
long_press Long press at coordinates (context menus, drag handles)
double_tap Double tap at coordinates
multi_tap Tap the same coordinates N times with a fixed interval (spam tapping)
tap_sequence Multi-step action chain: taps, waits, text input, key presses, swipes in any order
type_text Type text into focused input
press_key Press key (back, home, enter, tab, delete, menu, etc.)
swipe Swipe gesture between coordinates
scroll_to_element Scroll until element is visible
wait_for_element Wait for element to appear (with timeout)

Diagnostics

Tool Description
get_logs Get logcat output, filterable by package, log level, and time
clear_logs Clear logcat buffer (call before reproducing a bug for clean output)
get_device_info Get model, Android version, API level, screen size, DPI

App Management

Tool Description
launch_app Launch app by package name
install_apk Install APK file
get_current_activity Get foreground app and activity
pull_file Pull a file from the device to local filesystem
adb_shell Run arbitrary ADB shell command

Example Workflows

Bug documentation

<!-- TODO: Add GIF demo -->

"Clear the logs, open the settings screen, tap the save button, then show me the logs and a screenshot"

Claude will: clear_logslaunch_apptap_elementget_logs(package_name="com.example.app", level="E")screenshot(save_path="./bugs/settings-crash.png")

UI testing

<!-- TODO: Add GIF demo -->

"Navigate through the login flow and verify each screen matches the designs"

Claude will use screenshot + get_ui_tree to see and understand each screen, tap_element/type_text to interact, and its vision capabilities to compare against mockups or descriptions.

Smoke testing

<!-- TODO: Add GIF demo -->

"Install the APK, launch the app, and tap through the main screens to check nothing crashes"

Claude will: install_apklaunch_app → navigate with tap_elementget_logs(level="E") to check for errors after each screen.

Element interaction

<!-- TODO: Add GIF demo -->

"Open Settings, search for 'display', tap the first result, then go back"

Claude will: launch_app(package_name="com.android.settings")tap_and_wait(by="text", value="Search settings")type_text("display")tap_and_wait(by="text", value="Display")press_key(key="back")

Demos & Prompting Guide

  • DEMOS.md — copy-paste prompt scenarios you can try right now
  • PROMPTING.md — best practices, performance tips, and common pitfalls

How It Works

The server communicates over stdio using the Model Context Protocol. All device interaction goes through ADB — no modifications to your app are required. Screenshots are captured in memory, compressed, and returned as base64 images that the AI can see and analyze visually.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

MIT - see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选