NM

nim444/mcp-android-server-python

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

60 stars 13 forks Качество 66 Тренд 0MIT

nim444/mcp-android-server-python - кандидат на сервер MCP, импортированный из https://github.com/nim444/mcp-android-server-python.

Обзор

nim444/mcp-android-server-python - кандидат на сервер MCP, импортированный из https://github.com/nim444/mcp-android-server-python.

Обзор (машинный перевод)

Этот проект предоставляет сервер MCP (Model Context Protocol) для автоматизации устройств Android с помощью uiautomator2. Он предназначен для легкого подключения к агентам ИИ, таким как GitHub Copilot Chat, Claude или Open Interpreter, для управления устройствами Android с помощью естественного языка.

Модульная архитектура

Сервер был рефакторирован в чистую модульную архитектуру с инструментами, организованными по функциональности:

Преимущества модульной архитектуры

-Устойчивость: Легко добавлять / изменять / удалять инструменты, не касаясь основного сервера ** Организация**: Инструменты, логически сгруппированные по функциональности

  • ** Тестирование**: Отдельные модули инструментов могут тестироваться отдельно. Возобновляемость: Модули инструментов могут использоваться повторно в других проектах Масштабируемость: новые категории инструментов могут быть добавлены в виде отдельных модулей Чистый код: основной сервер сокращен с 1321 строки до 61 строки

Быстрая демонстрация


Требования

Python 3.13 или выше

  • Android Debug Bridge (adb) установлен и в PATH
  • Подключенное устройство Android с включенной отладкой USB
  • uiautomator2 совместимое Android устройство

Особенности

###Управление устройствами Умное обнаружение устройств: автоматически находит и подключается к доступным устройствам

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

MCP Android Agent

This project provides an MCP (Model Context Protocol) server for automating Android devices using uiautomator2. It’s designed to be easily plugged into AI agents like GitHub Copilot Chat, Claude, or Open Interpreter to control Android devices through natural language.

Modular Architecture

The server has been refactored into a clean, modular architecture with tools organized by functionality:

mcp-android-server-python/
├── server.py                    # Main server (61 lines - clean & focused)
├── server_original_backup.py    # Backup of original monolithic version
└── tools/                       # 🆕 Modular tools package
    ├── __init__.py             # Central registration & imports
    ├── device_tools.py         # Device connection & status tools
    ├── app_tools.py            # Application management tools
    ├── screen_tools.py         # Screen control & unlock tools
    ├── input_tools.py          # User input simulation (click, swipe, text)
    ├── inspection_tools.py     # UI inspection & screenshots
    └── advanced_tools.py       # Advanced features (toast, activity wait)

Benefits of Modular Architecture

  • Maintainability: Easy to add/modify/remove tools without touching main server
  • Organization: Tools grouped logically by functionality
  • Testing: Individual tool modules can be unit tested separately
  • Reusability: Tool modules can be reused in other projects
  • Scalability: New tool categories can be added as separate modules
  • Clean Code: Main server reduced from 1321 lines to 61 lines

Quick Demo


Requirements

  • Python 3.13 or higher
  • Android Debug Bridge (adb) installed and in PATH
  • Connected Android device with USB debugging enabled
  • uiautomator2 compatible Android device

Features

Device Management

  • Smart Device Detection: Automatically finds and connects to available devices
  • Comprehensive Device Info: Get serial, resolution, battery, WiFi IP, Android version
  • ADB Diagnostics: Check ADB availability and connection status
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "mcp-android": { "type": "stdio", "command": "bash", "args": [ "-c", "cd /path/to/mcp-adb && source .venv/bin/activate && uv run python server.py" ] } } }