|
1 | | -# @midscene/android-mcp |
| 1 | +# Midscene MCP |
2 | 2 |
|
3 | | -Midscene MCP Server for Android automation. |
4 | | - |
5 | | -## Installation |
6 | | - |
7 | | -```bash |
8 | | -npm install @midscene/android-mcp |
9 | | -``` |
10 | | - |
11 | | -## Prerequisites |
12 | | - |
13 | | -- Android Debug Bridge (ADB) installed and available in PATH |
14 | | -- At least one Android device connected via USB or emulator running |
15 | | - |
16 | | -## Usage |
17 | | - |
18 | | -### CLI Mode |
19 | | - |
20 | | -```bash |
21 | | -npx @midscene/android-mcp |
22 | | -``` |
23 | | - |
24 | | -### Programmatic API |
25 | | - |
26 | | -```typescript |
27 | | -import { AndroidMCPServer } from '@midscene/android-mcp'; |
28 | | - |
29 | | -const server = new AndroidMCPServer(); |
30 | | -await server.launch(); |
31 | | -``` |
32 | | - |
33 | | -## Available Tools |
34 | | - |
35 | | -### Action Space Tools |
36 | | - |
37 | | -Dynamically generated from AndroidAgent's action space: |
38 | | - |
39 | | -- `launch` - Launch an Android app or URL |
40 | | -- `tap` - Tap on UI elements |
41 | | -- `input` - Input text into fields |
42 | | -- `swipe` - Swipe gestures |
43 | | -- `back` - Android back button |
44 | | -- `home` - Android home button |
45 | | -- `recentApps` - Recent apps button |
46 | | -- `runAdbShell` - Execute ADB shell commands |
47 | | - |
48 | | -### Common Tools |
49 | | - |
50 | | -- `take_screenshot` - Capture screenshot of current screen |
51 | | -- `wait_for` - Wait until condition becomes true |
52 | | -- `assert` - Assert condition is true |
53 | | - |
54 | | -### Platform-Specific Tools |
55 | | - |
56 | | -- `android_connect` - Connect to a specific Android device by device ID |
57 | | -- `android_list_devices` - List all connected Android devices |
58 | | - |
59 | | -## Configuration |
60 | | - |
61 | | -Set environment variables in `.env`: |
62 | | - |
63 | | -```bash |
64 | | -OPENAI_API_KEY=your_api_key |
65 | | -MIDSCENE_MODEL_NAME=qwen3-vl-plus |
66 | | -``` |
67 | | - |
68 | | -## License |
69 | | - |
70 | | -MIT |
| 3 | +docs: https://midscenejs.com/mcp.html |
0 commit comments