replicant-mcp 1.6.2 → 1.6.4

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.
Files changed (47) hide show
  1. package/dist/adapters/ui-automator.d.ts +6 -6
  2. package/dist/adapters/ui-automator.js +19 -31
  3. package/dist/adapters/ui-fallback-find.js +44 -4
  4. package/dist/parsers/ui-dump.d.ts +1 -0
  5. package/dist/parsers/ui-dump.js +34 -2
  6. package/dist/schemas/derive.d.ts +8 -0
  7. package/dist/schemas/derive.js +19 -0
  8. package/dist/schemas/inputs.d.ts +9 -0
  9. package/dist/schemas/inputs.js +44 -0
  10. package/dist/server.js +3 -18
  11. package/dist/tools/adb-app.d.ts +6 -30
  12. package/dist/tools/adb-app.js +10 -29
  13. package/dist/tools/adb-device.d.ts +4 -12
  14. package/dist/tools/adb-device.js +4 -12
  15. package/dist/tools/adb-logcat.d.ts +5 -29
  16. package/dist/tools/adb-logcat.js +6 -14
  17. package/dist/tools/adb-shell.d.ts +8 -28
  18. package/dist/tools/adb-shell.js +10 -16
  19. package/dist/tools/cache.d.ts +9 -32
  20. package/dist/tools/cache.js +9 -25
  21. package/dist/tools/emulator-device.d.ts +4 -25
  22. package/dist/tools/emulator-device.js +5 -27
  23. package/dist/tools/gradle-build.d.ts +4 -16
  24. package/dist/tools/gradle-build.js +5 -14
  25. package/dist/tools/gradle-get-details.d.ts +7 -27
  26. package/dist/tools/gradle-get-details.js +11 -27
  27. package/dist/tools/gradle-list.d.ts +4 -13
  28. package/dist/tools/gradle-list.js +5 -13
  29. package/dist/tools/gradle-test.d.ts +4 -20
  30. package/dist/tools/gradle-test.js +9 -19
  31. package/dist/tools/index.d.ts +197 -0
  32. package/dist/tools/index.js +33 -0
  33. package/dist/tools/rtfm.d.ts +4 -12
  34. package/dist/tools/rtfm.js +10 -11
  35. package/dist/tools/ui-action.d.ts +18 -41
  36. package/dist/tools/ui-action.js +179 -35
  37. package/dist/tools/ui-capture.d.ts +7 -26
  38. package/dist/tools/ui-capture.js +9 -21
  39. package/dist/tools/ui-query.d.ts +13 -72
  40. package/dist/tools/ui-query.js +39 -46
  41. package/dist/types/errors.d.ts +1 -0
  42. package/dist/types/errors.js +1 -0
  43. package/dist/types/schemas/ui-output.d.ts +92 -6
  44. package/dist/types/schemas/ui-output.js +20 -0
  45. package/docs/contracts/replicant-mcp.contract.json +241 -57
  46. package/docs/contracts/tool-schema-tokens.json +67 -0
  47. package/package.json +9 -6
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "1.0",
3
- "generatedAt": "2026-03-09T18:40:20.027Z",
3
+ "generatedAt": "2026-04-27T21:43:15.187Z",
4
4
  "tools": {
5
5
  "cache": {
6
6
  "inputSchema": {
@@ -16,8 +16,8 @@
16
16
  ]
17
17
  },
18
18
  "key": {
19
- "type": "string",
20
- "description": "Key to clear (optional)"
19
+ "description": "Key to clear (optional)",
20
+ "type": "string"
21
21
  },
22
22
  "config": {
23
23
  "type": "object",
@@ -160,12 +160,12 @@
160
160
  "type": "object",
161
161
  "properties": {
162
162
  "category": {
163
- "type": "string",
164
- "description": "Category: build, adb, emulator, ui, cache"
163
+ "description": "Category: build, adb, emulator, ui, cache, index",
164
+ "type": "string"
165
165
  },
166
166
  "tool": {
167
- "type": "string",
168
- "description": "Tool name for specific docs"
167
+ "description": "Tool name (e.g., 'ui-query') for tool-specific docs",
168
+ "type": "string"
169
169
  }
170
170
  }
171
171
  },
@@ -456,23 +456,26 @@
456
456
  ]
457
457
  },
458
458
  "apkPath": {
459
- "type": "string",
460
- "description": "APK path"
459
+ "description": "APK path",
460
+ "type": "string"
461
461
  },
462
462
  "packageName": {
463
463
  "type": "string"
464
464
  },
465
465
  "limit": {
466
+ "description": "Default: 20, max: 100",
466
467
  "type": "number",
467
- "description": "Default: 20, max: 100"
468
+ "minimum": 1,
469
+ "maximum": 100
468
470
  },
469
471
  "filter": {
470
- "type": "string",
471
- "description": "Filter by name (case-insensitive)"
472
+ "description": "Filter by name (case-insensitive)",
473
+ "type": "string"
472
474
  },
473
475
  "offset": {
476
+ "description": "Pagination offset",
474
477
  "type": "number",
475
- "description": "Pagination offset"
478
+ "minimum": 0
476
479
  }
477
480
  },
478
481
  "required": [
@@ -616,8 +619,9 @@
616
619
  "type": "object",
617
620
  "properties": {
618
621
  "lines": {
619
- "type": "number",
620
- "description": "Default: 100"
622
+ "default": 100,
623
+ "description": "Default: 100",
624
+ "type": "number"
621
625
  },
622
626
  "package": {
623
627
  "type": "string"
@@ -642,10 +646,13 @@
642
646
  "type": "string"
643
647
  },
644
648
  "since": {
645
- "type": "string",
646
- "description": "e.g., '01-20 15:30:00.000'"
649
+ "description": "e.g., '01-20 15:30:00.000'",
650
+ "type": "string"
647
651
  }
648
- }
652
+ },
653
+ "required": [
654
+ "lines"
655
+ ]
649
656
  },
650
657
  "outputSchemas": {
651
658
  "AdbLogcatOutput": {
@@ -700,20 +707,22 @@
700
707
  "type": "string"
701
708
  },
702
709
  "timeout": {
703
- "type": "number",
704
- "description": "ms, default: 30000, max: 120000"
710
+ "description": "ms, default: 30000, max: 120000",
711
+ "type": "number"
705
712
  },
706
713
  "maxChars": {
714
+ "description": "Truncate output to N chars",
707
715
  "type": "number",
708
- "description": "Truncate output to N chars"
716
+ "minimum": 1
709
717
  },
710
718
  "summaryOnly": {
711
- "type": "boolean",
712
- "description": "Compact preview only"
719
+ "description": "Compact preview only",
720
+ "type": "boolean"
713
721
  },
714
722
  "previewChars": {
723
+ "description": "Preview length (default: 200)",
715
724
  "type": "number",
716
- "description": "Preview length (default: 200)"
725
+ "minimum": 1
717
726
  }
718
727
  },
719
728
  "required": [
@@ -786,8 +795,8 @@
786
795
  "type": "string"
787
796
  },
788
797
  "device": {
789
- "type": "string",
790
- "description": "e.g., 'pixel_7'"
798
+ "description": "e.g., 'pixel_7'",
799
+ "type": "string"
791
800
  },
792
801
  "systemImage": {
793
802
  "type": "string"
@@ -974,8 +983,8 @@
974
983
  ]
975
984
  },
976
985
  "module": {
977
- "type": "string",
978
- "description": "e.g., ':app'"
986
+ "description": "e.g., ':app'",
987
+ "type": "string"
979
988
  },
980
989
  "flavor": {
981
990
  "type": "string"
@@ -1048,12 +1057,12 @@
1048
1057
  "type": "string"
1049
1058
  },
1050
1059
  "filter": {
1051
- "type": "string",
1052
- "description": "e.g., '*LoginTest*'"
1060
+ "description": "e.g., '*LoginTest*'",
1061
+ "type": "string"
1053
1062
  },
1054
1063
  "taskName": {
1055
- "type": "string",
1056
- "description": "Task name for baseline operations. Defaults to operation name."
1064
+ "description": "Task name for baseline operations. Defaults to operation name.",
1065
+ "type": "string"
1057
1066
  }
1058
1067
  },
1059
1068
  "required": [
@@ -1222,8 +1231,8 @@
1222
1231
  ]
1223
1232
  },
1224
1233
  "module": {
1225
- "type": "string",
1226
- "description": "e.g., ':app'"
1234
+ "description": "e.g., ':app'",
1235
+ "type": "string"
1227
1236
  }
1228
1237
  },
1229
1238
  "required": [
@@ -1348,6 +1357,7 @@
1348
1357
  "type": "string"
1349
1358
  },
1350
1359
  "detailType": {
1360
+ "default": "all",
1351
1361
  "type": "string",
1352
1362
  "enum": [
1353
1363
  "logs",
@@ -1357,20 +1367,23 @@
1357
1367
  ]
1358
1368
  },
1359
1369
  "maxChars": {
1370
+ "description": "Truncate to N chars",
1360
1371
  "type": "number",
1361
- "description": "Truncate to N chars"
1372
+ "minimum": 1
1362
1373
  },
1363
1374
  "summaryOnly": {
1364
- "type": "boolean",
1365
- "description": "Return compact summary payload for logs/tasks/all detail types (ignored for errors)"
1375
+ "description": "Return compact summary payload for logs/tasks/all detail types (ignored for errors)",
1376
+ "type": "boolean"
1366
1377
  },
1367
1378
  "previewChars": {
1379
+ "description": "For summaryOnly with detailType logs/all: preview length in characters (default: 400)",
1368
1380
  "type": "number",
1369
- "description": "For summaryOnly with detailType logs/all: preview length in characters (default: 400)"
1381
+ "minimum": 1
1370
1382
  }
1371
1383
  },
1372
1384
  "required": [
1373
- "id"
1385
+ "id",
1386
+ "detailType"
1374
1387
  ]
1375
1388
  },
1376
1389
  "outputSchemas": {
@@ -1639,8 +1652,8 @@
1639
1652
  "type": "string"
1640
1653
  },
1641
1654
  "nearestTo": {
1642
- "type": "string",
1643
- "description": "Find elements nearest to this text (spatial proximity)"
1655
+ "description": "Find elements nearest to this text (spatial proximity)",
1656
+ "type": "string"
1644
1657
  }
1645
1658
  }
1646
1659
  },
@@ -1648,10 +1661,10 @@
1648
1661
  "type": "boolean"
1649
1662
  },
1650
1663
  "maxTier": {
1664
+ "description": "Max fallback tier (1-5). Use 3 to stop before visual/grid payloads.",
1651
1665
  "type": "number",
1652
1666
  "minimum": 1,
1653
- "maximum": 5,
1654
- "description": "Max fallback tier (1-5). Use 3 to stop before visual/grid payloads."
1667
+ "maximum": 5
1655
1668
  },
1656
1669
  "gridCell": {
1657
1670
  "type": "number",
@@ -1664,14 +1677,14 @@
1664
1677
  "maximum": 5
1665
1678
  },
1666
1679
  "compact": {
1667
- "type": "boolean",
1668
- "description": "Paginated flat list (default: true). false for full tree."
1680
+ "description": "Paginated flat list (default: true). false for full tree.",
1681
+ "type": "boolean"
1669
1682
  },
1670
1683
  "limit": {
1684
+ "description": "Default: 20",
1671
1685
  "type": "number",
1672
1686
  "minimum": 1,
1673
- "maximum": 100,
1674
- "description": "Default: 20"
1687
+ "maximum": 100
1675
1688
  },
1676
1689
  "offset": {
1677
1690
  "type": "number",
@@ -1699,6 +1712,45 @@
1699
1712
  "deviceId": {
1700
1713
  "type": "string"
1701
1714
  },
1715
+ "coordinateSpace": {
1716
+ "type": "string",
1717
+ "const": "device"
1718
+ },
1719
+ "scaleFactor": {
1720
+ "type": "number"
1721
+ },
1722
+ "deviceDimensions": {
1723
+ "type": "object",
1724
+ "properties": {
1725
+ "width": {
1726
+ "type": "number"
1727
+ },
1728
+ "height": {
1729
+ "type": "number"
1730
+ }
1731
+ },
1732
+ "required": [
1733
+ "width",
1734
+ "height"
1735
+ ],
1736
+ "additionalProperties": false
1737
+ },
1738
+ "imageDimensions": {
1739
+ "type": "object",
1740
+ "properties": {
1741
+ "width": {
1742
+ "type": "number"
1743
+ },
1744
+ "height": {
1745
+ "type": "number"
1746
+ }
1747
+ },
1748
+ "required": [
1749
+ "width",
1750
+ "height"
1751
+ ],
1752
+ "additionalProperties": false
1753
+ },
1702
1754
  "warning": {
1703
1755
  "type": "string"
1704
1756
  }
@@ -1706,7 +1758,9 @@
1706
1758
  "required": [
1707
1759
  "dumpId",
1708
1760
  "tree",
1709
- "deviceId"
1761
+ "deviceId",
1762
+ "coordinateSpace",
1763
+ "scaleFactor"
1710
1764
  ],
1711
1765
  "additionalProperties": false,
1712
1766
  "$defs": {
@@ -1795,6 +1849,45 @@
1795
1849
  "deviceId": {
1796
1850
  "type": "string"
1797
1851
  },
1852
+ "coordinateSpace": {
1853
+ "type": "string",
1854
+ "const": "device"
1855
+ },
1856
+ "scaleFactor": {
1857
+ "type": "number"
1858
+ },
1859
+ "deviceDimensions": {
1860
+ "type": "object",
1861
+ "properties": {
1862
+ "width": {
1863
+ "type": "number"
1864
+ },
1865
+ "height": {
1866
+ "type": "number"
1867
+ }
1868
+ },
1869
+ "required": [
1870
+ "width",
1871
+ "height"
1872
+ ],
1873
+ "additionalProperties": false
1874
+ },
1875
+ "imageDimensions": {
1876
+ "type": "object",
1877
+ "properties": {
1878
+ "width": {
1879
+ "type": "number"
1880
+ },
1881
+ "height": {
1882
+ "type": "number"
1883
+ }
1884
+ },
1885
+ "required": [
1886
+ "width",
1887
+ "height"
1888
+ ],
1889
+ "additionalProperties": false
1890
+ },
1798
1891
  "hint": {
1799
1892
  "type": "string"
1800
1893
  },
@@ -1810,7 +1903,9 @@
1810
1903
  "hasMore",
1811
1904
  "offset",
1812
1905
  "limit",
1813
- "deviceId"
1906
+ "deviceId",
1907
+ "coordinateSpace",
1908
+ "scaleFactor"
1814
1909
  ],
1815
1910
  "additionalProperties": false
1816
1911
  },
@@ -2137,6 +2232,26 @@
2137
2232
  "elementIndex": {
2138
2233
  "type": "number"
2139
2234
  },
2235
+ "selector": {
2236
+ "type": "object",
2237
+ "properties": {
2238
+ "resourceId": {
2239
+ "type": "string"
2240
+ },
2241
+ "text": {
2242
+ "type": "string"
2243
+ },
2244
+ "textContains": {
2245
+ "type": "string"
2246
+ },
2247
+ "className": {
2248
+ "type": "string"
2249
+ },
2250
+ "nearestTo": {
2251
+ "type": "string"
2252
+ }
2253
+ }
2254
+ },
2140
2255
  "text": {
2141
2256
  "type": "string"
2142
2257
  },
@@ -2150,14 +2265,14 @@
2150
2265
  ]
2151
2266
  },
2152
2267
  "amount": {
2268
+ "description": "Scroll fraction (0-1, default: 0.5)",
2153
2269
  "type": "number",
2154
2270
  "minimum": 0,
2155
- "maximum": 1,
2156
- "description": "Scroll fraction (0-1, default: 0.5)"
2271
+ "maximum": 1
2157
2272
  },
2158
2273
  "deviceSpace": {
2159
- "type": "boolean",
2160
- "description": "Treat x/y as device coordinates (skip scaling)"
2274
+ "description": "x/y in device-space (default true). Set false only for image-space coords.",
2275
+ "type": "boolean"
2161
2276
  }
2162
2277
  },
2163
2278
  "required": [
@@ -2191,6 +2306,27 @@
2191
2306
  },
2192
2307
  "deviceId": {
2193
2308
  "type": "string"
2309
+ },
2310
+ "matchedSelector": {
2311
+ "type": "object",
2312
+ "properties": {
2313
+ "resourceId": {
2314
+ "type": "string"
2315
+ },
2316
+ "text": {
2317
+ "type": "string"
2318
+ },
2319
+ "textContains": {
2320
+ "type": "string"
2321
+ },
2322
+ "className": {
2323
+ "type": "string"
2324
+ },
2325
+ "nearestTo": {
2326
+ "type": "string"
2327
+ }
2328
+ },
2329
+ "additionalProperties": false
2194
2330
  }
2195
2331
  },
2196
2332
  "required": [
@@ -2208,6 +2344,27 @@
2208
2344
  },
2209
2345
  "deviceId": {
2210
2346
  "type": "string"
2347
+ },
2348
+ "matchedSelector": {
2349
+ "type": "object",
2350
+ "properties": {
2351
+ "resourceId": {
2352
+ "type": "string"
2353
+ },
2354
+ "text": {
2355
+ "type": "string"
2356
+ },
2357
+ "textContains": {
2358
+ "type": "string"
2359
+ },
2360
+ "className": {
2361
+ "type": "string"
2362
+ },
2363
+ "nearestTo": {
2364
+ "type": "string"
2365
+ }
2366
+ },
2367
+ "additionalProperties": false
2211
2368
  }
2212
2369
  },
2213
2370
  "required": [
@@ -2234,6 +2391,9 @@
2234
2391
  },
2235
2392
  "amount": {
2236
2393
  "type": "number"
2394
+ },
2395
+ "container": {
2396
+ "type": "string"
2237
2397
  }
2238
2398
  },
2239
2399
  "required": [
@@ -2244,6 +2404,30 @@
2244
2404
  },
2245
2405
  "deviceId": {
2246
2406
  "type": "string"
2407
+ },
2408
+ "matchedSelector": {
2409
+ "type": "object",
2410
+ "properties": {
2411
+ "resourceId": {
2412
+ "type": "string"
2413
+ },
2414
+ "text": {
2415
+ "type": "string"
2416
+ },
2417
+ "textContains": {
2418
+ "type": "string"
2419
+ },
2420
+ "className": {
2421
+ "type": "string"
2422
+ },
2423
+ "nearestTo": {
2424
+ "type": "string"
2425
+ }
2426
+ },
2427
+ "additionalProperties": false
2428
+ },
2429
+ "warning": {
2430
+ "type": "string"
2247
2431
  }
2248
2432
  },
2249
2433
  "required": [
@@ -2272,12 +2456,12 @@
2272
2456
  "type": "boolean"
2273
2457
  },
2274
2458
  "maxDimension": {
2275
- "type": "number",
2276
- "description": "Max image dimension in pixels (default: 800). Higher = better quality, more tokens."
2459
+ "description": "Max image dimension in pixels (default: 800). Higher = better quality, more tokens.",
2460
+ "type": "number"
2277
2461
  },
2278
2462
  "raw": {
2279
- "type": "boolean",
2280
- "description": "Skip scaling, full device resolution."
2463
+ "description": "Skip scaling, full device resolution.",
2464
+ "type": "boolean"
2281
2465
  }
2282
2466
  },
2283
2467
  "required": [
@@ -0,0 +1,67 @@
1
+ {
2
+ "version": "1.0",
3
+ "generatedAt": "2026-04-27T21:43:15.349Z",
4
+ "charsPerToken": 4,
5
+ "instructionsChars": 137,
6
+ "schemaChars": 8536,
7
+ "totalChars": 8673,
8
+ "estimatedTokens": 2169,
9
+ "perTool": {
10
+ "cache": {
11
+ "chars": 542,
12
+ "estTokens": 136
13
+ },
14
+ "rtfm": {
15
+ "chars": 487,
16
+ "estTokens": 122
17
+ },
18
+ "adb-device": {
19
+ "chars": 361,
20
+ "estTokens": 91
21
+ },
22
+ "adb-app": {
23
+ "chars": 654,
24
+ "estTokens": 164
25
+ },
26
+ "adb-logcat": {
27
+ "chars": 576,
28
+ "estTokens": 144
29
+ },
30
+ "adb-shell": {
31
+ "chars": 602,
32
+ "estTokens": 151
33
+ },
34
+ "emulator-device": {
35
+ "chars": 571,
36
+ "estTokens": 143
37
+ },
38
+ "gradle-build": {
39
+ "chars": 419,
40
+ "estTokens": 105
41
+ },
42
+ "gradle-test": {
43
+ "chars": 591,
44
+ "estTokens": 148
45
+ },
46
+ "gradle-list": {
47
+ "chars": 368,
48
+ "estTokens": 92
49
+ },
50
+ "gradle-get-details": {
51
+ "chars": 744,
52
+ "estTokens": 186
53
+ },
54
+ "ui-query": {
55
+ "chars": 1081,
56
+ "estTokens": 271
57
+ },
58
+ "ui-action": {
59
+ "chars": 929,
60
+ "estTokens": 233
61
+ },
62
+ "ui-capture": {
63
+ "chars": 596,
64
+ "estTokens": 149
65
+ }
66
+ }
67
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicant-mcp",
3
- "version": "1.6.2",
3
+ "version": "1.6.4",
4
4
  "description": "Android MCP server for AI-assisted Android development",
5
5
  "mcpName": "io.github.thecombatwombat/replicant-mcp",
6
6
  "type": "module",
@@ -11,7 +11,9 @@
11
11
  "scripts": {
12
12
  "build": "tsc",
13
13
  "dev": "tsc --watch",
14
- "test": "vitest",
14
+ "test": "vitest --run",
15
+ "posttest": "npm run check:contracts",
16
+ "test:watch": "vitest",
15
17
  "test:unit": "vitest --run tests/services tests/adapters tests/tools",
16
18
  "test:integration": "vitest --run tests/integration",
17
19
  "test:coverage": "vitest --run --coverage",
@@ -22,13 +24,13 @@
22
24
  "lint": "eslint src/ tests/",
23
25
  "lint:fix": "eslint src/ tests/ --fix",
24
26
  "check-complexity": "bash scripts/check-complexity.sh",
25
- "validate": "npm run build && npm run lint && npm run check-complexity && npm run test -- --run",
26
- "prepublishOnly": "npm run build && npm test -- --run",
27
+ "validate": "npm run build && npm run lint && npm run check-complexity && npm test",
28
+ "prepublishOnly": "npm run build && npm test",
27
29
  "release": "bash scripts/release.sh",
28
30
  "release:minor": "bash scripts/release.sh minor",
29
31
  "release:major": "bash scripts/release.sh major",
30
- "generate:contracts": "tsx scripts/generate-contract.ts",
31
- "check:contracts": "tsx scripts/check-contracts.ts",
32
+ "generate:contracts": "tsx scripts/generate-contract.ts && tsx scripts/generate-token-snapshot.ts",
33
+ "check:contracts": "tsx scripts/check-contracts.ts && tsx scripts/check-token-snapshot.ts",
32
34
  "test:contracts": "tsx scripts/contract-test.ts"
33
35
  },
34
36
  "keywords": [
@@ -69,6 +71,7 @@
69
71
  "zod": "^4.3.5"
70
72
  },
71
73
  "devDependencies": {
74
+ "@anthropic-ai/mcpb": "^2.1.2",
72
75
  "@eslint/js": "^10.0.1",
73
76
  "@types/node": "^25.0.9",
74
77
  "@types/sharp": "^0.31.1",