Skip to main content
Glama

✨ ドロイドマインド 🤖

Python 3.13以上 ライセンス 状態 コードスタイル 型チェック

モデルコンテキストプロトコルを介してAIでAndroidデバイスを制御する

DroidMindは、AIアシスタントとAndroidデバイスをつなぐ強力な架け橋であり、自然言語による制御、デバッグ、システム分析を可能にします。Model Context Protocol(MCP)を実装することで、DroidMindはAIモデルがADBを介してAndroidデバイスと安全かつ構造化された方法で直接やり取りすることを可能にします。エージェントコーディングワークフローの一部としてDroidMindを使用することで、アシスタントはデバイスを直接操作しながらビルドとデバッグを行うことができます。

💫 機能

  • 📱デバイスコントロール- USBまたはTCP/IP経由でデバイスに接続し、シェルコマンドを実行し、再起動します

  • 📊システム分析- デバイスのプロパティを検査し、ハードウェア情報を表示し、システムログを分析します

  • 🔍ファイルシステムアクセス- ディレクトリの内容を参照し、デバイス上のファイルを管理します

  • 📷ビジュアル診断- 分析とデバッグのためにデバイスのスクリーンショットをキャプチャします

  • 📦アプリ管理- 接続されたデバイスでのアプリのインストール、アンインストール、起動、停止、データの消去

  • 🔄マルチデバイスサポート- 複数の接続されたデバイスを制御および切り替え

  • 👆 UI オートメーション- タップ、スワイプ、テキスト入力、キーの押下を通じてデバイスを操作します

  • 🔍アプリ検査- アプリのマニフェスト、共有設定、アプリ固有のログを表示

  • 🔒セキュリティフレームワーク- 包括的なコマンド検証でデバイスを保護

  • 💬 MCP 統合- Claude、Cursor、Cline などへのシームレスな接続

Related MCP server: MCP Android Agent

🚀 インストール

# Clone the repository
git clone https://github.com/hyperbliss/droidmind.git
cd droidmind

# Set up a virtual environment with UV
uv venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies with UV
uv sync

📋 前提条件

  • Python 3.13以上

  • USBデバッグが有効になっているAndroidデバイス

  • ADB (Android Debug Bridge) がインストールされ、PATH に設定されている

  • UV パッケージ マネージャー (依存関係管理に推奨)

  • ネットワーク制御の場合: ADB over TCP/IP が有効になっている Android デバイス

🔮 クイックスタート

DroidMindサーバーを実行する

DroidMind をサーバーとして実行し、MCP 経由で AI アシスタントを接続します。

# Start DroidMind as a network server
droidmind --transport sse

AIアシスタントと併用する

  1. DroidMind を SSE モードで起動します。

    droidmind --transport sse
  2. MCP プロトコル URI を使用して AI アシスタントを接続します。

    sse://localhost:4256/sse
  3. AI が自然言語を通じて Android デバイスを制御できるようになりました。

🛠️ 利用可能な MCP リソースとツール

リソース

  • devices://list - 接続されているすべてのデバイスを一覧表示します

  • device://{serial}/properties - 詳細なデバイスプロパティを取得する

  • logs://{serial}/logcat - デバイスから最新のログを取得します

  • logs://{serial}/anr - アプリケーション応答なし (ANR) のトレースを取得します

  • logs://{serial}/crashes - アプリケーションのクラッシュログを取得する

  • logs://{serial}/battery - バッテリーの統計と履歴を取得します

  • logs://{serial}/app/{package} - アプリケーション固有のログを取得する

  • fs://{serial}/list/{path} - デバイス上のディレクトリの内容を一覧表示します

  • fs://{serial}/read/{path} - デバイスからファイルの内容を読み取ります

  • fs://{serial}/stats/{path} - 詳細なファイル/ディレクトリ統計情報を取得します

  • app://{serial}/{package}/manifest - AndroidManifest.xml の内容を取得します

  • app://{serial}/{package}/data - アプリのデータディレクトリ内のファイルを一覧表示します

  • app://{serial}/{package}/shared_prefs - アプリの共有設定を取得する

ツール

  • devicelist - 接続されているすべての Android デバイスを一覧表示します

  • device_properties - 特定のデバイスの詳細なプロパティを取得します

  • device_logcat - デバイスから最新の logcat 出力を取得する

  • list_directory - デバイス上のディレクトリの内容を一覧表示する

  • connect_device - TCP/IP経由でデバイスに接続する

  • disconnect_device - Androidデバイスから切断する

  • shell_command - デバイス上でシェルコマンドを実行する

  • install_app - デバイスにAPKをインストールする

  • uninstall_app - デバイスからアプリをアンインストールする

  • start_app - デバイス上でアプリを起動する

  • stop_app - デバイス上のアプリを強制停止する

  • clear_app_data - アプリのデータとキャッシュを消去する

  • list_packages - デバイスにインストールされているパッケージを一覧表示します

  • get_app_manifest - アプリの AndroidManifest.xml の内容を取得する

  • get_app_permissions - アプリが要求した権限を取得する

  • get_app_activities - アプリで定義されたアクティビティを取得する

  • get_app_info - アプリの詳細情報を取得する

  • reboot_device - デバイスを再起動します(通常、リカバリ、またはブートローダー)

  • screenshot - デバイスからスクリーンショットを取得する

  • capture_bugreport - デバイスから包括的なバグレポートを生成します

  • dump_heap - メモリ分析のために実行中のプロセスからヒープダンプを作成する

  • push_file - デバイスにファイルをアップロードする

  • pull_file - デバイスからファイルをダウンロードする

  • delete_file - デバイスからファイルまたはディレクトリを削除する

  • create_directory - デバイス上にディレクトリを作成する

  • file_exists - デバイス上にファイルが存在するかどうかを確認する

  • read_file - デバイス上のファイルの内容を読み取る

  • write_file - デバイス上のファイルにテキストコンテンツを書き込む

  • file_stats - ファイルまたはディレクトリに関する詳細情報を取得します

  • tap - 特定の座標でデバイス画面をタップします

  • swipe - 画面上のある点から別の点へスワイプするジェスチャを実行します

  • input_text - キーボードから入力するのと同じようにデバイス上でテキストを入力します

  • press_key - ハードウェアキーまたはソフトウェアキー(例:HOME、BACK、VOLUME)を押します

  • start_intent - Androidインテントを使用してアプリアクティビティを開始する

📊 AIアシスタントクエリの例

AI アシスタントを DroidMind に接続して、次のクエリを試してください。

  • 「接続されているすべての Android デバイスを一覧表示し、そのプロパティを表示します」

  • 「192.168.1.100 で携帯電話に接続し、バッテリーの状態を確認してください」

  • 「Pixel のスクリーンショットを撮って、現在画面に表示されているものを見せてください」

  • 「デバイスの空きストレージ容量を確認してください」

  • 「デバイスのANRトレースとクラッシュログを表示してください」

  • 「最近のログを見て、エラーがあれば教えてください」

  • 「このAPKファイルをデバイスにインストールして、成功したかどうか教えてください」

  • 「携帯電話にインストールされているすべてのアプリのリストを表示してください」

  • 「デバイスをリカバリモードで再起動する」

  • 「私の携帯電話で実行されている Android のバージョンは何ですか?」

  • 「デバイスがルート化されているかどうかを確認し、セキュリティパッチレベルを教えてください」

  • 「com.android.settings のマニフェストファイルを表示してください」

  • 「アプリの共有設定を確認してください」

  • 「座標500,1000にある設定アイコンをタップしてください」

  • 「画面上部から下にスワイプして通知シェードを開きます」

  • 「現在のテキストフィールドにパスワードを入力してください」

  • 「ホーム画面に戻るには、戻るボタンを3回押します」

  • 「com.android.settings パッケージを起動して設定アプリを開きます」

🔒 セキュリティ機能

DroidMind には、AI アシスタントの表現力を維持しながらデバイスを保護する包括的なセキュリティ フレームワークが含まれています。

  • コマンド検証: すべてのシェルコマンドは安全なコマンドの許可リストに対して検証されます。

  • リスク評価: コマンドはリスクレベル (安全、低、中、高、重大) 別に分類されます。

  • コマンドサニタイズ: コマンドインジェクション攻撃を防ぐために入力がサニタイズされます

  • 保護されたパス: システムディレクトリと重要なパスは変更から保護されています

  • 包括的なログ記録: すべてのコマンドは監査のためにリスクレベルとともにログに記録されます。

  • 疑わしいパターンの検出: 潜在的に危険なパターンを持つコマンドはブロックされます

  • ADBコマンドセキュリティ:適切な非同期検証によるADB固有のコマンドの特別な処理

セキュリティシステムは、破壊的な操作を防ぎながら、一般的な操作は許可できる程度に許容されるように設計されています。リスクの高いコマンドは実行前にユーザーに警告を表示し、重要な操作は明示的なオーバーライドなしに完全にブロックされます。

💻 開発

DroidMind は、依存関係管理と開発ワークフローに UV を使用します。UV は、高速で信頼性の高い Python パッケージマネージャーおよびリゾルバーです。

# Update dependencies
uv sync

# Run tests
pytest

# Run linting
ruff check .

# Run type checking
mypy .

🤝 貢献する

貢献を歓迎します!お気軽にプルリクエストを送信してください。

  1. リポジトリをフォークする

  2. 機能ブランチを作成します( git checkout -b feature/amazing-feature )

  3. UVで開発環境をセットアップする

  4. 変更を加える

  5. テストとリンティングを実行する

  6. 変更をコミットします ( git commit -m 'Add some amazing feature' )

  7. ブランチにプッシュする ( git push origin feature/amazing-feature )

  8. プルリクエストを開く

📝 ライセンス

このプロジェクトは Apache ライセンスに基づいてライセンスされています。詳細については、LICENSE ファイルを参照してください。


ステファニー・ジェーンが作成🌠

DroidMind が役に立つと思ったら、 Monster Ultra Violet を買ってください⚡️

Available Tools

8 tools
android-appA

Perform various application management operations on an Android device.

This single tool consolidates various app-related actions. The 'action' parameter determines the operation.

Args: serial: Device serial number. action: The specific app operation to perform. ctx: MCP Context for logging and interaction. package (Optional[str]): Package name for the target application. Required by most actions. apk_path (Optional[str]): Path to the APK file (local to the server). Used by install_app. reinstall (Optional[bool]): Whether to reinstall if app exists. Used by install_app. grant_permissions (Optional[bool]): Whether to grant all requested permissions. Used by install_app. keep_data (Optional[bool]): Whether to keep app data and cache directories. Used by uninstall_app. activity (Optional[str]): Optional activity name to start. Used by start_app. extras (Optional[dict[str, str]]): Optional intent extras. Used by start_intent. include_system_apps (Optional[bool]): Whether to include system apps. Used by list_packages. include_app_name (Optional[bool]): Whether to include app labels (best-effort). Used by list_packages. include_apk_path (Optional[bool]): Whether to include APK paths. Used by list_packages. max_packages (Optional[int]): Max packages to return. Used by list_packages.

Returns: A string message indicating the result or status of the operation.


Available Actions and their specific argument usage:

  1. action="install_app"

    • Requires: apk_path

    • Optional: reinstall, grant_permissions

  2. action="uninstall_app"

    • Requires: package

    • Optional: keep_data

  3. action="start_app"

    • Requires: package

    • Optional: activity 3b. action="start_intent"

    • Requires: package, activity

    • Optional: extras

  4. action="stop_app"

    • Requires: package

  5. action="clear_app_data"

    • Requires: package

  6. action="list_packages"

    • Optional: include_system_apps, include_app_name, include_apk_path, max_packages

  7. action="get_app_manifest"

    • Requires: package

  8. action="get_app_permissions"

    • Requires: package

  9. action="get_app_activities"

    • Requires: package

  10. action="get_app_info"

    • Requires: package


Inputs: serial (required), action (required), package, apk_path, +9 more. Returns: result

android-deviceA

Perform various device management operations on Android devices.

This single tool consolidates various device-related actions. The 'action' parameter determines the operation.

Args: action: The specific device operation to perform. ctx: MCP Context for logging and interaction. serial (Optional[str]): Device serial number. Required by most actions except connect/list. ip_address (Optional[str]): IP address for 'connect_device' action. port (Optional[int]): Port for 'connect_device' action (default: 5555). mode (Optional[str]): Reboot mode for 'reboot_device' action (default: "normal").

Returns: A string message indicating the result or status of the operation.


Available Actions and their specific argument usage:

  1. action="list_devices"

    • No specific arguments required beyond ctx.

  2. action="connect_device"

    • Requires: ip_address

    • Optional: port

  3. action="disconnect_device"

    • Requires: serial

  4. action="reboot_device"

    • Requires: serial

    • Optional: mode (e.g., "normal", "recovery", "bootloader")

  5. action="device_properties"

    • Requires: serial


Inputs: action (required), serial, ip_address, port, +1 more. Returns: result

android-diagA

Perform diagnostic operations like capturing bug reports or heap dumps.

Args: ctx: MCP Context. serial: Device serial number. action: The diagnostic action to perform. output_path: Optional. Path to save the output file. For bugreport: host path for adb to write the .zip. If empty, a temp file is used & summarized. For dump_heap: local path to save the .hprof. If empty, a temp file is used. include_screenshots: For CAPTURE_BUGREPORT. Default True. package_or_pid: For DUMP_HEAP. App package name or process ID. native: For DUMP_HEAP. True for native (C/C++) heap, False for Java. Default False. timeout_seconds: Max time for the operation. If 0, action-specific defaults are used (bugreport: 300s, dump_heap: 120s).

Returns: A string message indicating the result or path to the output.

Inputs: serial (required), action (required), output_path, include_screenshots, +3 more. Returns: result

android-fileA

Perform file and directory operations on an Android device.

This single tool consolidates various file system actions. The 'action' parameter determines the operation.

Args: serial: Device serial number. action: The specific file operation to perform. See available actions below. ctx: MCP Context for logging and interaction. path (Optional[str]): General path argument on the device. Used by: list_directory, delete_file, create_directory, file_exists, file_stats. Can also be used by read_file and write_file as an alternative to 'device_path'. local_path (Optional[str]): Path on the DroidMind server machine. Used by: push_file (source), pull_file (destination). device_path (Optional[str]): Path on the Android device. Used by: push_file (destination), pull_file (source), read_file (source), write_file (destination). If 'path' is also provided for read/write, 'device_path' takes precedence. content (Optional[str]): Text content to write. Used by: write_file. max_size (Optional[int]): Maximum file size in bytes for read_file (default: 100KB). Used by: read_file.

Returns: Union[str, bool]: A string message indicating the result or status for most actions. Returns a boolean for the 'file_exists' action.


Available Actions and their specific argument usage:

  1. action="list_directory": Lists contents of a directory.

    • Requires: path (directory path on device).

    • Returns: Formatted string of directory contents.

  2. action="push_file": Uploads a file from the local server to the device.

    • Requires: local_path (source on server), device_path (destination on device).

    • Returns: String message confirming upload.

  3. action="pull_file": Downloads a file from the device to the local server.

    • Requires: device_path (source on device), local_path (destination on server).

    • Returns: String message confirming download.

  4. action="delete_file": Deletes a file or directory from the device.

    • Requires: path (path to delete on device).

    • Returns: String message confirming deletion.

  5. action="create_directory": Creates a directory on the device.

    • Requires: path (directory path to create on device).

    • Returns: String message confirming creation.

  6. action="file_exists": Checks if a file or directory exists on the device.

    • Requires: path (path to check on device).

    • Returns: True if exists, False otherwise.

  7. action="read_file": Reads the contents of a file from the device.

    • Requires: device_path (or path) for the file on device.

    • Optional: max_size (defaults to 100KB).

    • Returns: String containing file contents or error message.

  8. action="write_file": Writes text content to a file on the device.

    • Requires: device_path (or path) for the file on device, content (text to write).

    • Returns: String message confirming write.

  9. action="file_stats": Gets detailed statistics for a file or directory.

    • Requires: path (path on device).

    • Returns: Markdown-formatted string of file/directory statistics.


Inputs: serial (required), action (required), path, local_path, +3 more. Returns: result

android-logA

Perform various log retrieval operations on an Android device.

This single tool consolidates various log-related actions. The 'action' parameter determines the operation.

Args: serial: Device serial number. action: The specific log operation to perform. ctx: MCP Context for logging and interaction. package (Optional[str]): Package name for get_app_logs action. lines (int): Number of lines to fetch for logcat actions (default: 1000). filter_expr (Optional[str]): Logcat filter expression for get_device_logcat. buffer (Optional[str]): Logcat buffer for get_device_logcat (default: "main"). format_type (Optional[str]): Logcat output format for get_device_logcat (default: "threadtime"). max_size (Optional[int]): Max output size for get_device_logcat (default: 100KB).

Returns: A string message containing the requested logs or status.


Available Actions and their specific argument usage:

  1. action="get_device_logcat"

    • Optional: lines, filter_expr, buffer, format_type, max_size.

  2. action="get_app_logs"

    • Requires: package.

    • Optional: lines.

  3. action="get_anr_logs"

    • No specific arguments beyond serial and ctx.

  4. action="get_crash_logs"

    • No specific arguments beyond serial and ctx.

  5. action="get_battery_stats"

    • No specific arguments beyond serial and ctx.


Inputs: serial (required), action (required), package, lines, +4 more. Returns: result

android-screenshotA

Get a screenshot from a device.

Args: serial: Device serial number ctx: MCP context quality: JPEG quality (1-100, lower means smaller file size)

Returns: The device screenshot as an image

Inputs: serial (required), quality.

android-shellA

Run a shell command on the device.

Args: serial: Device serial number command: Shell command to run max_lines: Maximum lines of output to return (default: 1000) Use positive numbers for first N lines, negative for last N lines Set to None for unlimited (not recommended for large outputs) max_size: Maximum output size in characters (default: 100000) Limits total response size regardless of line count

Returns: Command output

Inputs: serial (required), command (required), max_lines, max_size. Returns: result

android-uiB

Perform various UI interaction operations on an Android device.

Args: ctx: MCP Context. serial: Device serial number. action: The UI action to perform. x: X coordinate (for tap). y: Y coordinate (for tap). start_x: Starting X coordinate (for swipe). start_y: Starting Y coordinate (for swipe). end_x: Ending X coordinate (for swipe). end_y: Ending Y coordinate (for swipe). duration_ms: Duration of the swipe in milliseconds (default: 300). text: Text to input (for input_text). keycode: Android keycode to press (for press_key). package: Package name (for start_intent). activity: Activity name (for start_intent). extras: Optional intent extras (for start_intent).

Returns: A string message indicating the result of the operation.

Inputs: serial (required), action (required), x, y, +10 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 8 tools

    Disambiguation3/5

    The top-level tools are clearly categorized, but the internal actions within each mega-tool can overlap (e.g., start_intent appears in both android-app and android-ui), causing potential ambiguity for an agent. Additionally, the bundling of many operations under one tool name makes it less obvious which tool handles a specific action.

    Naming Consistency5/5

    All tool names follow a consistent 'android-<category>' pattern, and internal actions use a uniform snake_case style. The naming is predictable and readable across the entire server.

    Tool Count4/5

    With 8 tools, the count is reasonable for an Android device management server. However, the bundling of many actions into each tool makes the surface feel slightly under-tooled, though still within the effective range.

    Completeness4/5

    The tool set covers major areas: app management, device control, diagnostics, file operations, logs, screenshots, shell, and UI. Some gaps exist (e.g., network or settings management), but the core workflows for common Android tasks are well addressed.

    Maintenance

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      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.
      60
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      A MCP server that enables AI assistants to control Android devices via ADB, supporting device info, screen control, input simulation, app management, shell execution, file transfer, and UI parsing.
      20
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that wraps Android ADB functionality into AI assistant tools, enabling device management, shell execution, file operations, app management, media capture, and log analysis via natural language.
      23 npm
      3
      MIT