mobai-mcp 1.4.0 → 1.4.1

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 CHANGED
@@ -88,7 +88,7 @@ Configure according to your client's MCP server setup. The server uses stdio tra
88
88
 
89
89
  ### UI Automation
90
90
  - `get_screenshot` - Capture device screenshot
91
- - `get_ui_tree` - Get accessibility tree
91
+ - `get_ui_tree` - Get accessibility tree (supports text_regex and bounds filtering)
92
92
  - `tap` - Tap element by index or coordinates
93
93
  - `type_text` - Type text
94
94
  - `swipe` - Perform swipe gesture
package/dist/index.js CHANGED
@@ -208,6 +208,21 @@ const TOOLS = [
208
208
  type: "boolean",
209
209
  description: "Include keyboard elements in the tree (default: false). Useful for interacting with on-screen keyboards.",
210
210
  },
211
+ text_regex: {
212
+ type: "string",
213
+ description: "Regex to filter elements by text/value/contentDesc. Only matching elements are returned.",
214
+ },
215
+ bounds: {
216
+ type: "object",
217
+ description: "Filter to elements within a bounding rectangle",
218
+ properties: {
219
+ x: { type: "number", description: "Left X coordinate" },
220
+ y: { type: "number", description: "Top Y coordinate" },
221
+ w: { type: "number", description: "Width" },
222
+ h: { type: "number", description: "Height" },
223
+ },
224
+ required: ["x", "y", "w", "h"],
225
+ },
211
226
  },
212
227
  required: ["device_id"],
213
228
  },
@@ -802,6 +817,15 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
802
817
  params.set("onlyVisible", "false");
803
818
  if (args?.include_keyboard)
804
819
  params.set("includeKeyboard", "true");
820
+ if (args?.text_regex)
821
+ params.set("textRegex", args.text_regex);
822
+ if (args?.bounds) {
823
+ const b = args.bounds;
824
+ params.set("boundsX", String(b.x));
825
+ params.set("boundsY", String(b.y));
826
+ params.set("boundsW", String(b.w));
827
+ params.set("boundsH", String(b.h));
828
+ }
805
829
  const queryString = params.toString();
806
830
  const endpoint = `/devices/${args?.device_id}/ui-tree${queryString ? `?${queryString}` : ""}`;
807
831
  result = await makeRequest("GET", endpoint);
@@ -1198,7 +1222,7 @@ The DSL (Domain Specific Language) enables batch execution of multiple automatio
1198
1222
 
1199
1223
  | Action | Description | Key Fields |
1200
1224
  |--------|-------------|------------|
1201
- | observe | Get UI tree/screenshot/OCR | context, include (ui_tree, screenshot, installed_apps, ocr) |
1225
+ | observe | Get UI tree/screenshot/OCR | context, include (ui_tree, screenshot, installed_apps, ocr), filter ({text_regex, bounds}) |
1202
1226
  | tap | Tap element | predicate or coords |
1203
1227
  | type | Type text | text, predicate (if keyboard not open), dismiss_keyboard (default: false) |
1204
1228
  | press_key | Press keyboard key | key (return, tab, delete, etc.), context (optional: "web") |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobai-mcp",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "mcpName": "io.github.MobAI-App/mobai-mcp",
5
5
  "description": "MCP server for MobAI - AI-powered mobile device automation",
6
6
  "type": "module",
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/MobAI-App/mobai-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "1.2.1",
9
+ "version": "1.4.1",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "mobai-mcp",
14
- "version": "1.2.1",
14
+ "version": "1.4.1",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  }