MA

martingeidobler/android-mcp-server

浏览器自动化

本页由 AI 翻译,技术细节请以原文为准。 查看原文

76 stars 12 forks 质量 77 趋势 1MIT

martingeidobler/android-mcp-server 是从 https://github.com/martingeidobler/android-mcp-server. 导入的 MCP 服务器候选

概览

martingeidobler/android-mcp-server 是从 https://github.com/martingeidobler/android-mcp-server. 导入的 MCP 服务器候选

概述(AI 翻译)

MCP服务器,通过ADB控制Android模拟器和设备。赋予AI助手查看、交互和调试Android应用的能力——截图、点选元素、读取日志并记录漏洞。

npm 包 |GitHub |问题

^ 为了更好地观看,已加快。更多演示和测试案例。

特色

  • 25 个工具 用于完整安卓设备控制
  • **智能压缩截图捕捉(基于锐利,最大1280px)
  • UI 树检查 — 读取元素层级,包含边界、文本、资源 ID 和状态
  • 触控自动化 — 点击、滑动、滚动、输入文字、按硬件键
  • 元素定位 — 通过资源ID、文本或内容描述查找并点选元素
  • 应用生命周期 — 安装APK,启动应用,检查当前活动
  • Logcat集成 — 按包、日志级别或时间戳过滤
  • 设备管理 — 列出设备,启动模拟器,获取设备信息
  • 复合动作 — tap_and_wait 将点击 + 定点 + UI 树组合成一次循环
  • 持久的 ADB 壳 — 重用单个 shell 会话以加快命令执行速度
  • 设备信息缓存 — 每会话查询一次设备属性

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Android MCP Server

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

^ 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 actions — tap_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
在 GitHub 查看完整 README

安装

npx -y android-mcp-server
新手?先看 mcpskill.org 教程 →

配置

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