OpenSource-Hub

mobile-mcp

アプリケーション

mobile-next/mobile-mcp

AI エージェントにモバイルデバイスを自動操作させる MCP サーバー。

概要

この MCP サーバーは、AI エージェントが iOS と Android アプリを構造化された方法で操作できるようにし、シミュレーター、エミュレーター、実機をサポートします。ネイティブのアクセシビリティツリーを優先的に使用してアプリを駆動し、必要に応じてスクリーンショットと座標タップにフォールバックします。アプリ管理、ジェスチャー、入力、画面録画、ログ、クラッシュレポートなどのツールも提供します。

README プレビュー

# Mobile Next - MCP server for Mobile Development and Automation | iOS, Android, Simulator, Emulator, and Real Devices\n\n**English** | [日本語](README.ja.md) | [简体中文](README.zh-CN.md)\n\nThis is an MCP Server that enables scalable mobile automation, development through a platform-agnostic interface, eliminating the need for distinct iOS or Android knowledge. You can run it on emulators, simulators, and real devices (iOS and Android).\n\nThis server allows Agents and LLMs to interact with native iOS/Android applications and devices through structured accessibility snapshots or coordinate-based taps based on screenshots.\n\n**Works with Claude Code, Codex, Gemini, GitHub Copilot, Antigravity** — or any MCP-compatible client.\n\nRun it against devices on your own machine, or against real iOS and Android devices in the cloud with **[Mobile Next Cloud](https://mobilenext.ai/cloud?utm_source=github&utm_medium=readme&utm_campaign=mobile-mcp&utm_content=intro)** — same tools, no local setup.\n\n\n  \n    \n  \n  \n    \n  \n  \n    \n  \n  \n    \n  \n  \n    \n  \n  \n    \n  \n\n\n\nhttps://github.com/user-attachments/assets/bb084777-beb3-4930-ae6f-8d3fe694ddde\n\n\n\n    \n        \n    \n\n\n### Main use cases\n\nHow we help to scale mobile automation:\n\n- 📲 Native app automation (iOS and Android) for testing or data-entry scenarios.\n- 📝 Scripted flows and form interactions without manually controlling simulators/emulators or real devices (iPhone, Samsung, Google Pixel etc)\n- 🧭 Automating multi-step user journeys driven by an LLM\n- 👆 General-purpose mobile application interaction for agent-based frameworks\n- 🤖 Enables agent-to-agent communication for mobile automation usecases, data extraction\n\n## Main Features\n\n- 🚀 **Accessibility-first — fast and cheap**: drives apps from the native accessibility tree (no vision model, no image tokens), falling back to screenshots + coordinates only when needed.\n- 📱 **One API, every target**: the same tools work across 

FAQ (2)

トラブル対応
ツール呼び出しが失敗した際に、@mobilenext/mobile-mcp が isError: true ではなく成功した MCP 結果を返すのはなぜですか?

これは @mobilenext/mobile-mcp 1.0.8 および 1.0.9 における既知のバグです。共有ツールハンドラーが ActionableError をキャッチし、isError: true を付けずにテキスト結果を返すため、MCP クライアントは失敗した操作(例: 存在しないデバイスで mobile_get_screen_size を呼び出した場合)を成功として扱ってしまいます。修正方法: PR #492 が含まれるリリースにアップグレードしてください。このリリースでは、createMcpServer() 内のハンドラーが新しくエクスポートされたヘルパー actionableErrorToolResult() を介して isError: true を返します。1.0.9 の回避策: 公開されている lib/server.js(ソースからビルドする場合は src/server.ts)にパッチを適用し、ActionableError の return オブジェクトに isError: true を追加して、次のようにします: return { content: [{ type: "text", text: ${error.message}. Please fix the issue and try again. }], isError: true };。この1行の修正が npm ci の実行後も維持されるよう、バージョンガード付きの postinstall スクリプトまたは patch-package を使用してください。

参照 Issue #489
トラブル対応
Amazon Q CLIをmobile-mcpと一緒に使用している場合、mobile_take_screenshotで保存されたスクリーンショットが開かないのはなぜですか?

mobile_take_screenshot ツールは、バイナリ PNG ではなく、base64 エンコードされたデータとして画像を返します。エージェントがその base64 テキストをそのまま .png ファイルに書き込むと、ファイルが破損し、OS から開くことができないと報告されます。修正方法: 保存する前に base64 ペイロードをデコードしてください。

オプション 1 – エージェントに明示的に指示する: 「mobile_take_screenshot を使用し、base64 の結果をデコードして、バイナリデータを /path/to/screenshot.png に書き込んでください。」

オプション 2 – ターミナルから手動でデコードする:
- Linux/macOS: base64 -d screenshot.txt > screenshot.png
- Python: python3 -c "import base64; open('screenshot.png','wb').write(base64.b64decode(open('screenshot.txt').read()))"

保存された内容が data:image/png;base64, で始まる場合は、デコードする前にそのプレフィックスを取り除いてください。デコード後、PNG はどの画像ビューアでも正常に開きます。

参照 Issue #83