@mobilenext/mobile-mcp 0.0.34 → 0.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -0
- package/lib/android.js +4 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -67,6 +67,47 @@ How we help to scale mobile automation:
|
|
|
67
67
|
- 📊 **Deterministic tool application**: Reduces ambiguity found in purely screenshot-based approaches by relying on structured data whenever possible.
|
|
68
68
|
- 📺 **Extract structured data**: Enables you to extract structred data from anything visible on screen.
|
|
69
69
|
|
|
70
|
+
## 🔧 Available MCP Tools
|
|
71
|
+
|
|
72
|
+
<details>
|
|
73
|
+
<summary>📱 <strong>Click to expand tool list</strong> - List of Mobile MCP tools for automation and development</summary>
|
|
74
|
+
|
|
75
|
+
> For detailed implementation and parameter specifications, see [`src/server.ts`](src/server.ts)
|
|
76
|
+
|
|
77
|
+
### Device Management
|
|
78
|
+
- **`mobile_list_available_devices`** - List all available devices (simulators, emulators, and real devices)
|
|
79
|
+
- **`mobile_get_screen_size`** - Get the screen size of the mobile device in pixels
|
|
80
|
+
- **`mobile_get_orientation`** - Get the current screen orientation of the device
|
|
81
|
+
- **`mobile_set_orientation`** - Change the screen orientation (portrait/landscape)
|
|
82
|
+
|
|
83
|
+
### App Management
|
|
84
|
+
- **`mobile_list_apps`** - List all installed apps on the device
|
|
85
|
+
- **`mobile_launch_app`** - Launch an app using its package name
|
|
86
|
+
- **`mobile_terminate_app`** - Stop and terminate a running app
|
|
87
|
+
- **`mobile_install_app`** - Install an app from file (.apk, .ipa, .app, .zip)
|
|
88
|
+
- **`mobile_uninstall_app`** - Uninstall an app using bundle ID or package name
|
|
89
|
+
|
|
90
|
+
### Screen Interaction
|
|
91
|
+
- **`mobile_take_screenshot`** - Take a screenshot to understand what's on screen
|
|
92
|
+
- **`mobile_save_screenshot`** - Save a screenshot to a file
|
|
93
|
+
- **`mobile_list_elements_on_screen`** - List UI elements with their coordinates and properties
|
|
94
|
+
- **`mobile_click_on_screen_at_coordinates`** - Click at specific x,y coordinates
|
|
95
|
+
- **`mobile_double_tap_on_screen`** - Double-tap at specific coordinates
|
|
96
|
+
- **`mobile_long_press_on_screen_at_coordinates`** - Long press at specific coordinates
|
|
97
|
+
- **`mobile_swipe_on_screen`** - Swipe in any direction (up, down, left, right)
|
|
98
|
+
|
|
99
|
+
### Input & Navigation
|
|
100
|
+
- **`mobile_type_keys`** - Type text into focused elements with optional submit
|
|
101
|
+
- **`mobile_press_button`** - Press device buttons (HOME, BACK, VOLUME_UP/DOWN, ENTER, etc.)
|
|
102
|
+
- **`mobile_open_url`** - Open URLs in the device browser
|
|
103
|
+
|
|
104
|
+
### Platform Support
|
|
105
|
+
- **iOS**: Simulators and real devices via native accessibility and WebDriverAgent
|
|
106
|
+
- **Android**: Emulators and real devices via ADB and UI Automator
|
|
107
|
+
- **Cross-platform**: Unified API works across both iOS and Android
|
|
108
|
+
|
|
109
|
+
</details>
|
|
110
|
+
|
|
70
111
|
## 🏗️ Mobile MCP Architecture
|
|
71
112
|
|
|
72
113
|
<p align="center">
|
package/lib/android.js
CHANGED
|
@@ -43,8 +43,9 @@ const node_fs_1 = require("node:fs");
|
|
|
43
43
|
const xml = __importStar(require("fast-xml-parser"));
|
|
44
44
|
const robot_1 = require("./robot");
|
|
45
45
|
const getAdbPath = () => {
|
|
46
|
+
const exeName = process.env.platform === "win32" ? "adb.exe" : "adb";
|
|
46
47
|
if (process.env.ANDROID_HOME) {
|
|
47
|
-
return node_path_1.default.join(process.env.ANDROID_HOME, "platform-tools",
|
|
48
|
+
return node_path_1.default.join(process.env.ANDROID_HOME, "platform-tools", exeName);
|
|
48
49
|
}
|
|
49
50
|
if (process.platform === "win32" && process.env.LOCALAPPDATA) {
|
|
50
51
|
const windowsAdbPath = node_path_1.default.join(process.env.LOCALAPPDATA, "Android", "Sdk", "platform-tools", "adb.exe");
|
|
@@ -52,14 +53,14 @@ const getAdbPath = () => {
|
|
|
52
53
|
return windowsAdbPath;
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
if (process.env.HOME) {
|
|
56
|
+
if (process.platform === "darwin" && process.env.HOME) {
|
|
56
57
|
const defaultAndroidSdk = node_path_1.default.join(process.env.HOME, "Library", "Android", "sdk", "platform-tools", "adb");
|
|
57
58
|
if ((0, node_fs_1.existsSync)(defaultAndroidSdk)) {
|
|
58
59
|
return defaultAndroidSdk;
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
// fallthrough, hope for the best
|
|
62
|
-
return
|
|
63
|
+
return exeName;
|
|
63
64
|
};
|
|
64
65
|
const BUTTON_MAP = {
|
|
65
66
|
"BACK": "KEYCODE_BACK",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mobilenext/mobile-mcp",
|
|
3
3
|
"mcpName": "io.github.mobile-next/mobile-mcp",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.36",
|
|
5
5
|
"description": "Mobile MCP",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"zod-to-json-schema": "3.24.6"
|
|
32
32
|
},
|
|
33
33
|
"optionalDependencies": {
|
|
34
|
-
"@mobilenext/mobilecli": "0.0.
|
|
34
|
+
"@mobilenext/mobilecli": "0.0.38"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@eslint/eslintrc": "^3.2.0",
|