Skip to main content
Glama

Android ADB MCP Server

by landicefu

Android ADB MCP 服务器

模型上下文协议 (MCP) 服务器,使 AI 助手能够通过 Android 调试桥 (ADB) 与 Android 设备交互。该服务器弥合了 AI 功能与 Android 设备管理之间的差距,从而实现了 Android 开发和测试操作的无缝自动化。

⚙️ 快速设置

将服务器添加到您的 MCP 配置文件:

{ "mcpServers": { "android-adb": { "command": "npx", "args": ["-y", "@landicefu/android-adb-mcp-server"], "env": {}, "disabled": false, "alwaysAllow": [] } } }

配置位置

  • Claude 桌面~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
  • Cline/Roo 代码~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json (macOS)
  • 对于 Windows/Linux,检查等效的应用程序支持目录

配置完成后,重新启动您的AI助手以加载新的服务器配置。

📋 先决条件

  • 必须安装**ADB(Android 调试桥)**并将其添加到系统 PATH 中
  • 对于剪贴板功能:
    • macOSosascript (内置)
    • Windows :PowerShell(内置)
    • Linuxxclip (通过apt-get install xclip或同等方法安装)
  • Node.js 16.x 或更高版本

🚀 功能

  • 连接和管理多个 Android 设备
  • 在 Android 设备上执行 shell 命令
  • 安装和卸载应用程序
  • 在本地系统和 Android 设备之间推送和拉取文件
  • 在 Android 设备上启动应用程序
  • 截取屏幕截图并保存到本地或复制到剪贴板
  • 多设备连接时的智能设备选择

🛠️ 可用工具

工具描述必需参数可选参数
adb_devices列出已连接的设备没有任何没有任何
adb_shell执行shell命令commanddevice_id
adb_install安装APK文件pathdevice_id
adb_uninstall卸载应用程序package_namedevice_id
adb_list_packages列出已安装的软件包没有任何device_idfilter
adb_pull从设备中提取文件remote_pathlocal_pathdevice_id
adb_push将文件推送到设备local_pathremote_pathdevice_id
launch_app启动应用程序package_namedevice_id
take_screenshot_and_save截取并保存屏幕截图output_pathdevice_idformat
take_screenshot_and_copy_to_clipboard将屏幕截图保存到剪贴板没有任何device_idformat

设备管理

服务器智能处理设备选择:

  • 如果只连接一个设备,则会自动使用
  • 如果连接了多个设备,则必须指定device_id参数
  • 如果没有连接设备,则会返回错误

截图路径解析

当指定保存截图的output_path时,路径解析如下:

  • 绝对路径按原样使用
  • ~开头的路径扩展至用户的主目录
  • 相对路径是相对于用户主目录解析的

这可确保屏幕截图保存到 MCP 服务器具有写入权限的位置。

🔍 故障排除

常见问题

  1. “ADB 不可用”错误
    • 确保 ADB 已安装并位于系统 PATH 中
    • 通过在终端中运行adb version进行验证
  2. “未连接 Android 设备”错误
    • 检查您的设备是否已正确与adb devices连接
    • 确保您的设备上已启用 USB 调试
    • 尝试使用adb kill-server重新启动 ADB,然后使用adb start-server
  3. “已连接多个设备”错误
    • 在工具调用中指定device_id参数
    • 使用adb_devices工具获取可用设备列表
  4. 屏幕截图到剪贴板不起作用
    • 确保安装了所需的特定于平台的工具

🔧 其他安装方法

选项 1:从 npm 安装

# Install globally npm install -g @landicefu/android-adb-mcp-server # Or install locally in your project npm install @landicefu/android-adb-mcp-server

选项 2:从源手动安装

  1. 克隆存储库:
    git clone https://github.com/landicefu/android-adb-mcp-server.git cd android-adb-mcp-server
  2. 安装依赖项并构建:
    npm install npm run build
  3. 使用直接路径配置:
    { "mcpServers": { "android-adb": { "command": "node", "args": ["/path/to/android-adb-mcp-server/build/index.js"], "env": {}, "disabled": false, "alwaysAllow": [] } } }

📄 许可证

该项目根据 ISC 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

🤝 贡献

欢迎贡献代码!欢迎提交 Pull 请求。

  1. 分叉存储库
  2. 创建你的功能分支( git checkout -b feature/amazing-feature
  3. 提交您的更改( git commit -m 'Add some amazing feature'
  4. 推送到分支( git push origin feature/amazing-feature
  5. 打开拉取请求
-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

模型上下文协议服务器,使 AI 助手能够通过 ADB 与 Android 设备交互,从而实现自动化设备管理、应用程序安装、文件传输和屏幕截图。

  1. ⚙️ 快速设置
    1. 配置位置
  2. 📋 先决条件
    1. 🚀 功能
      1. 🛠️ 可用工具
        1. 设备管理
        2. 截图路径解析
      2. 🔍 故障排除
        1. 常见问题
      3. 🔧 其他安装方法
        1. 选项 1:从 npm 安装
        2. 选项 2:从源手动安装
      4. 📄 许可证
        1. 🤝 贡献

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol (MCP) server that enables AI assistants to control and interact with Android devices, allowing for device management, app debugging, system analysis, and UI automation through natural language commands.
            Last updated -
            29
            198
            Python
            Apache 2.0
            • Linux
            • Apple
          • -
            security
            F
            license
            -
            quality
            A comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.
            Last updated -
            3
            1
            TypeScript
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that enables AI agents to control and automate Android devices through natural language, supporting actions like app management, UI interactions, and device monitoring.
            Last updated -
            16
            Python
            MIT License
            • Apple
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that enables AI assistants to control Android TV devices, providing remote control functionality like navigation, playback control, app management, and device status monitoring.
            Last updated -
            4
            Python
            MIT License
            • Linux
            • Apple

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/landicefu/android-adb-mcp-server'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server