Midscene provides a MCP server that allows AI assistants to control Android devices, automate mobile app testing tasks.
MCP (Model Context Protocol) is a standardized way for AI models to interact with external tools and capabilities. MCP servers expose a set of tools that AI models can invoke to perform various tasks. For Midscene, these tools allow AI models to connect to Android devices, launch apps, interact with UI elements, and more.
Add the Midscene MCP server to your MCP configuration, note that the MIDSCENE_MCP_ANDROID_MODE
environment variable is required:
For more information about configuring AI models, see Choosing an AI Model.
Midscene MCP provides the following Android device automation tools:
Category | Tool Name | Description |
---|---|---|
Device Management | midscene_android_list_devices | List all connected Android devices |
midscene_android_connect | Connect to a specific Android device | |
App Control | midscene_android_launch | Launch an app or open a webpage on Android device |
System Operations | midscene_android_back | Press the back button on Android device |
midscene_android_home | Press the home button on Android device | |
Page Interaction | midscene_aiTap | Click on an element described in natural language |
midscene_aiInput | Input text into a form field or element | |
midscene_aiKeyboardPress | Press a specific keyboard key | |
midscene_aiScroll | Scroll the page or a specific element | |
Verification and Observation | midscene_aiWaitFor | Wait for a condition to be true on the page |
midscene_aiAssert | Assert that a condition is true on the page | |
midscene_screenshot | Take a screenshot of the current page |
midscene_android_list_devices: List all connected Android devices available for automation
midscene_android_connect: Connect to an Android device via ADB
midscene_android_back: Press the back button on Android device
midscene_android_home: Press the home button on Android device
midscene_aiTap: Click on an element described in natural language
midscene_aiInput: Input text into a form field or element
midscene_aiKeyboardPress: Press a specific keyboard key
midscene_aiScroll: Scroll the page or a specific element
midscene_aiWaitFor: Wait for a condition to be true on the page
midscene_aiAssert: Assert that a condition is true on the page
midscene_screenshot: Take a screenshot of the current page
adb devices
to confirm the device is connectedmidscene_android_list_devices
in MCP to view available devicesUse the midscene_android_launch
tool with parameters that can be:
com.android.chrome
com.android.chrome/.MainActivity
https://www.example.com
Problem description
When users simultaneously use Midscene MCP in multiple local clients (Claude Desktop, Cursor MCP, etc.), port conflicts may occur causing server errors
Solution
After each task execution, a Midscene task report is generated. You can open this HTML report directly from the command line: