devlens-mcp 0.4.1 → 0.5.2

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 (131) hide show
  1. package/README.md +211 -35
  2. package/RELEASE_NOTES.md +3 -7
  3. package/dist/bin/cli.js +47 -13
  4. package/dist/bin/cli.js.map +1 -1
  5. package/dist/bin/setup.d.ts +14 -0
  6. package/dist/bin/setup.d.ts.map +1 -0
  7. package/dist/bin/setup.js +272 -0
  8. package/dist/bin/setup.js.map +1 -0
  9. package/dist/src/figma/figma-api.d.ts +108 -0
  10. package/dist/src/figma/figma-api.d.ts.map +1 -0
  11. package/dist/src/figma/figma-api.js +284 -0
  12. package/dist/src/figma/figma-api.js.map +1 -0
  13. package/dist/src/figma/figma-cache.d.ts +57 -0
  14. package/dist/src/figma/figma-cache.d.ts.map +1 -0
  15. package/dist/src/figma/figma-cache.js +266 -0
  16. package/dist/src/figma/figma-cache.js.map +1 -0
  17. package/dist/src/figma/figma-client.d.ts +62 -0
  18. package/dist/src/figma/figma-client.d.ts.map +1 -0
  19. package/dist/src/figma/figma-client.js +224 -0
  20. package/dist/src/figma/figma-client.js.map +1 -0
  21. package/dist/src/figma/figma-rate-limiter.d.ts +46 -0
  22. package/dist/src/figma/figma-rate-limiter.d.ts.map +1 -0
  23. package/dist/src/figma/figma-rate-limiter.js +153 -0
  24. package/dist/src/figma/figma-rate-limiter.js.map +1 -0
  25. package/dist/src/figma/figma-retry.d.ts +19 -0
  26. package/dist/src/figma/figma-retry.d.ts.map +1 -0
  27. package/dist/src/figma/figma-retry.js +57 -0
  28. package/dist/src/figma/figma-retry.js.map +1 -0
  29. package/dist/src/figma/figma-structure.d.ts +1 -1
  30. package/dist/src/figma/figma-structure.d.ts.map +1 -1
  31. package/dist/src/figma/figma-structure.js +11 -1
  32. package/dist/src/figma/figma-structure.js.map +1 -1
  33. package/dist/src/figma/figma-types.d.ts +54 -0
  34. package/dist/src/figma/figma-types.d.ts.map +1 -0
  35. package/dist/src/figma/figma-types.js +33 -0
  36. package/dist/src/figma/figma-types.js.map +1 -0
  37. package/dist/src/figma/url-parser.d.ts +40 -0
  38. package/dist/src/figma/url-parser.d.ts.map +1 -0
  39. package/dist/src/figma/url-parser.js +107 -0
  40. package/dist/src/figma/url-parser.js.map +1 -0
  41. package/dist/src/platform/device-manager.d.ts +5 -0
  42. package/dist/src/platform/device-manager.d.ts.map +1 -1
  43. package/dist/src/platform/device-manager.js +18 -0
  44. package/dist/src/platform/device-manager.js.map +1 -1
  45. package/dist/src/platform/device-pool.d.ts +105 -0
  46. package/dist/src/platform/device-pool.d.ts.map +1 -0
  47. package/dist/src/platform/device-pool.js +328 -0
  48. package/dist/src/platform/device-pool.js.map +1 -0
  49. package/dist/src/platform/device-profiles.d.ts +50 -0
  50. package/dist/src/platform/device-profiles.d.ts.map +1 -0
  51. package/dist/src/platform/device-profiles.js +155 -0
  52. package/dist/src/platform/device-profiles.js.map +1 -0
  53. package/dist/src/platform/ios/ios-device.d.ts +0 -2
  54. package/dist/src/platform/ios/ios-device.d.ts.map +1 -1
  55. package/dist/src/platform/ios/ios-device.js +8 -18
  56. package/dist/src/platform/ios/ios-device.js.map +1 -1
  57. package/dist/src/platform/ios/simctl.d.ts +0 -5
  58. package/dist/src/platform/ios/simctl.d.ts.map +1 -1
  59. package/dist/src/platform/ios/simctl.js +0 -4
  60. package/dist/src/platform/ios/simctl.js.map +1 -1
  61. package/dist/src/platform/simulator-factory.d.ts +85 -0
  62. package/dist/src/platform/simulator-factory.d.ts.map +1 -0
  63. package/dist/src/platform/simulator-factory.js +396 -0
  64. package/dist/src/platform/simulator-factory.js.map +1 -0
  65. package/dist/src/platform/system-resources.d.ts +44 -0
  66. package/dist/src/platform/system-resources.d.ts.map +1 -0
  67. package/dist/src/platform/system-resources.js +103 -0
  68. package/dist/src/platform/system-resources.js.map +1 -0
  69. package/dist/src/prototype/browser-engine.d.ts +62 -0
  70. package/dist/src/prototype/browser-engine.d.ts.map +1 -0
  71. package/dist/src/prototype/browser-engine.js +199 -0
  72. package/dist/src/prototype/browser-engine.js.map +1 -0
  73. package/dist/src/prototype/figma-navigator.d.ts +40 -0
  74. package/dist/src/prototype/figma-navigator.d.ts.map +1 -0
  75. package/dist/src/prototype/figma-navigator.js +95 -0
  76. package/dist/src/prototype/figma-navigator.js.map +1 -0
  77. package/dist/src/prototype/flow-reporter.d.ts +47 -0
  78. package/dist/src/prototype/flow-reporter.d.ts.map +1 -0
  79. package/dist/src/prototype/flow-reporter.js +255 -0
  80. package/dist/src/prototype/flow-reporter.js.map +1 -0
  81. package/dist/src/prototype/screen-analyzer.d.ts +31 -0
  82. package/dist/src/prototype/screen-analyzer.d.ts.map +1 -0
  83. package/dist/src/prototype/screen-analyzer.js +114 -0
  84. package/dist/src/prototype/screen-analyzer.js.map +1 -0
  85. package/dist/src/prototype/web-crawler.d.ts +31 -0
  86. package/dist/src/prototype/web-crawler.d.ts.map +1 -0
  87. package/dist/src/prototype/web-crawler.js +88 -0
  88. package/dist/src/prototype/web-crawler.js.map +1 -0
  89. package/dist/src/reports/cross-device-report.d.ts +84 -0
  90. package/dist/src/reports/cross-device-report.d.ts.map +1 -0
  91. package/dist/src/reports/cross-device-report.js +342 -0
  92. package/dist/src/reports/cross-device-report.js.map +1 -0
  93. package/dist/src/server.d.ts.map +1 -1
  94. package/dist/src/server.js +9 -1
  95. package/dist/src/server.js.map +1 -1
  96. package/dist/src/snapshot/formatter.d.ts +5 -13
  97. package/dist/src/snapshot/formatter.d.ts.map +1 -1
  98. package/dist/src/snapshot/formatter.js +19 -28
  99. package/dist/src/snapshot/formatter.js.map +1 -1
  100. package/dist/src/tools/interaction-tools.d.ts +6 -6
  101. package/dist/src/tools/interaction-tools.d.ts.map +1 -1
  102. package/dist/src/tools/interaction-tools.js +2 -12
  103. package/dist/src/tools/interaction-tools.js.map +1 -1
  104. package/dist/src/tools/metro-tools.d.ts +2 -2
  105. package/dist/src/tools/multi-device-tools.d.ts +133 -0
  106. package/dist/src/tools/multi-device-tools.d.ts.map +1 -0
  107. package/dist/src/tools/multi-device-tools.js +365 -0
  108. package/dist/src/tools/multi-device-tools.js.map +1 -0
  109. package/dist/src/tools/navigation-tools.d.ts.map +1 -1
  110. package/dist/src/tools/navigation-tools.js +1 -6
  111. package/dist/src/tools/navigation-tools.js.map +1 -1
  112. package/dist/src/tools/prototype-tools.d.ts +102 -0
  113. package/dist/src/tools/prototype-tools.d.ts.map +1 -0
  114. package/dist/src/tools/prototype-tools.js +391 -0
  115. package/dist/src/tools/prototype-tools.js.map +1 -0
  116. package/dist/src/tools/screenshot-tools.d.ts +7 -74
  117. package/dist/src/tools/screenshot-tools.d.ts.map +1 -1
  118. package/dist/src/tools/screenshot-tools.js +19 -286
  119. package/dist/src/tools/screenshot-tools.js.map +1 -1
  120. package/dist/src/tools/vqa-tools.d.ts +2 -2
  121. package/dist/src/tools/vqa-tools.d.ts.map +1 -1
  122. package/dist/src/tools/vqa-tools.js +4 -69
  123. package/dist/src/tools/vqa-tools.js.map +1 -1
  124. package/docs/figma-workflow.md +58 -6
  125. package/docs/installation-guide.md +302 -0
  126. package/docs/setup-guide.md +77 -79
  127. package/docs/tool-reference.md +152 -69
  128. package/install.sh +119 -0
  129. package/package.json +5 -2
  130. package/setup.sh +320 -0
  131. package/tsconfig.json +1 -1
@@ -1,6 +1,6 @@
1
1
  # DevLens Tool Reference
2
2
 
3
- Complete reference for all **37** DevLens MCP tools, organized by category.
3
+ Complete reference for all **43** DevLens MCP tools, organized by category.
4
4
 
5
5
  > **Tip:** Use `devlens_metro_status` at the start of every session to verify Metro is healthy before invoking Metro-dependent tools.
6
6
 
@@ -100,8 +100,6 @@ List all installed third-party apps.
100
100
  |-------|------|----------|-------------|
101
101
  | `mode` | "full" \| "incremental" | No | "full" (default) returns entire tree. "incremental" returns only changes since last snapshot. |
102
102
  | `validate` | boolean | No | When `true`, appends a **Validation Report** that flags zero-size elements, invisible nodes, and empty containers. Default: `false`. |
103
- | `scope` | "screen" \| "component" | No | "screen" (default) captures full tree. "component" captures only the subtree of `componentRef`. |
104
- | `componentRef` | string | No | Element ref to scope to (e.g., `"e5"`). Only used when `scope: "component"`. Reduces token usage for targeted checks. |
105
103
 
106
104
  **Example response:**
107
105
  ```
@@ -436,10 +434,6 @@ Returns similarity score, diff pixel count, and diff image (same format as `devl
436
434
  | `resizeStrategy` | "fit" \| "scale" \| "crop" | No | Dimension mismatch handling (default: "fit") |
437
435
  | `cropRef` | string | No | Crop device screenshot to element bounds |
438
436
  | `region` | {x, y, width, height} | No | Crop device screenshot to pixel region |
439
- | `layoutReport` | boolean | No | Run per-element layout analysis (default: `true`). Requires `devlens_snapshot` first. |
440
- | `depth` | "quick" \| "standard" \| "thorough" | No | `"quick"`: skip layout report, loose threshold. `"standard"` (default): normal behavior. `"thorough"`: per-element analysis + property summary. |
441
- | `excludeSystemBars` | "auto" \| "ios" \| "android" \| "none" | No | Exclude status/nav bar from comparison (default: `"auto"`). |
442
- | `preprocessReference` | boolean | No | Remove Figma artifacts — rounded corners, backgrounds (default: `true`). |
443
437
 
444
438
  > Provide either `figmaUrl`, or both `fileKey` and `nodeId`.
445
439
 
@@ -454,54 +448,6 @@ devlens_compare_with_figma(
454
448
 
455
449
  ---
456
450
 
457
- ### devlens_compare_properties
458
- **Per-component property comparison.** Compares ALL measurable design properties (text sizes, colors, spacing, dimensions, layout direction, padding) between a Figma design and the live device. Returns per-component mismatches with exact expected vs actual values.
459
-
460
- More detailed than pixel comparison — use after `devlens_compare_with_figma` to catch every property difference. Requires `devlens_snapshot` to have been called first.
461
-
462
- | Param | Type | Required | Description |
463
- |-------|------|----------|-------------|
464
- | `figmaUrl` | string | No | Full Figma URL |
465
- | `fileKey` | string | No | Figma file key (alternative to figmaUrl) |
466
- | `nodeId` | string | No | Figma node ID (use with fileKey) |
467
- | `includeColors` | boolean | No | Extract and compare colors from screenshot (default: `true`) |
468
- | `tolerances` | object | No | Override defaults: `{ dimensions: 2, fontSize: 0.2, color: 15, spacing: 2 }` |
469
-
470
- **Properties compared per component:**
471
-
472
- | Property | Source (Figma) | Source (Device) | Tolerance |
473
- |----------|----------------|-----------------|-----------|
474
- | Text content | `characters` | accessibility `text` | Exact |
475
- | Width / Height | `absoluteBoundingBox` | accessibility `bounds` | ±2px |
476
- | Font size | `style.fontSize` | height × 0.75 estimate | ±20% |
477
- | Fill color | `fills[0].color` | screenshot sampling | ΔE ≤ 15 |
478
- | Layout direction | `layoutMode` | inferred from children | Exact |
479
- | Item spacing | `itemSpacing` | measured child gaps | ±2px |
480
- | Padding | `padding*` | inferred from bounds | ±2px |
481
- | Corner radius | `cornerRadius` | — | Info only |
482
- | Opacity | `opacity` | — | Info only |
483
-
484
- **Example output:**
485
- ```
486
- === COMPONENT PROPERTY COMPARISON ===
487
- Compared: 47 properties | Match rate: 78% (37/47)
488
-
489
- CRITICAL (2):
490
- [e5] Screen > Header > Title
491
- fontSize: expected 24px, actual ~33px
492
- → Adjust font size from ~33px to 24px
493
-
494
- WARNING (3):
495
- [e8] Screen > Body > Card
496
- width: expected 358px, actual 390px
497
- → Adjust width from 390px to 358px
498
- [e12] Screen > Footer > TabBar
499
- itemSpacing: expected 0px, actual 12px
500
- → Adjust item spacing from 12px to 0px
501
- ```
502
-
503
- ---
504
-
505
451
  ## React Native / Metro (6)
506
452
 
507
453
  ### devlens_metro_status
@@ -705,6 +651,137 @@ Issues: 3 (0 critical, 2 major, 1 minor)
705
651
 
706
652
  ---
707
653
 
654
+ ## Prototype Explorer (3)
655
+
656
+ ### `devlens_check_prototype`
657
+
658
+ Smart prototype detection with bidirectional prompting. Accepts any URL (Figma design, Figma prototype, or web-hosted mock) and returns the type, screen count, and flow summary. Always includes an ACTION NEEDED prompt asking for the complementary link.
659
+
660
+ **Parameters:**
661
+ | Param | Type | Required | Description |
662
+ |-------|------|----------|-------------|
663
+ | `url` | string | yes | Any URL — Figma design, Figma prototype, or web prototype/mock |
664
+
665
+ **Bidirectional prompting:**
666
+ - Figma design link given → asks for prototype/mock URL
667
+ - Prototype/mock URL given → asks for Figma design link
668
+ - Having both = near-100% build accuracy
669
+
670
+ **Example:**
671
+ ```
672
+ devlens_check_prototype(url: "https://productprototype.vercel.app")
673
+ → "Web prototype detected! 12 screens found: /, /memories/, /ai-magic/, ...
674
+ ACTION NEEDED: Provide the Figma design link for exact specs."
675
+
676
+ devlens_check_prototype(url: "https://figma.com/design/ABC123/MyApp?node-id=10-200")
677
+ → "Figma design detected! Prototype connections found (8 screens).
678
+ ACTION NEEDED: Provide the prototype sharing link."
679
+ ```
680
+
681
+ ### `devlens_explore_prototype`
682
+
683
+ Full browser-based prototype exploration. Opens a headless Chrome browser, navigates through all screens, captures high-res screenshots, and extracts colours, typography, components, and flow connections.
684
+
685
+ **Parameters:**
686
+ | Param | Type | Required | Default | Description |
687
+ |-------|------|----------|---------|-------------|
688
+ | `prototypeUrl` | string | yes | — | Prototype URL (web or Figma /proto/) |
689
+ | `figmaUrl` | string | no | — | Figma design URL for enriched specs |
690
+ | `maxScreens` | number | no | 15 | Max screens to explore |
691
+ | `captureDelay` | number | no | 1500 | Wait ms after each navigation |
692
+ | `viewportWidth` | number | no | 390 | Viewport width (iPhone 14) |
693
+ | `viewportHeight` | number | no | 844 | Viewport height |
694
+ | `scrollCapture` | boolean | no | true | Capture scroll-position screenshots |
695
+ | `extractDesignTokens` | boolean | no | true | Extract colour/typography/spacing |
696
+
697
+ **Returns:** Flow report with per-screen screenshots (base64), colour palettes, typography, component inventory, flow diagram, and design tokens.
698
+
699
+ **Example:**
700
+ ```
701
+ devlens_explore_prototype(
702
+ prototypeUrl: "https://productprototype.vercel.app",
703
+ figmaUrl: "https://figma.com/design/XYZ/JioAICloud?node-id=5-100",
704
+ maxScreens: 20
705
+ )
706
+ ```
707
+
708
+ ### `devlens_prototype_screen`
709
+
710
+ Deep single-screen analysis for pixel-perfect implementation.
711
+
712
+ **Parameters:**
713
+ | Param | Type | Required | Default | Description |
714
+ |-------|------|----------|---------|-------------|
715
+ | `url` | string | yes | — | URL of the specific screen/route |
716
+ | `figmaUrl` | string | no | — | Figma design URL for exact specs |
717
+ | `viewportWidth` | number | no | 390 | Viewport width |
718
+ | `viewportHeight` | number | no | 844 | Viewport height |
719
+ | `scrollDepth` | number | no | 5000 | How far to scroll (px) |
720
+
721
+ **Returns:** Element-level detail: bounds, colours, text, nesting, interactive elements, component patterns.
722
+
723
+ ---
724
+
725
+ ## Multi-Device Testing (4)
726
+
727
+ ### devlens_list_profiles
728
+ List available device profiles with screen dimensions and scale factors.
729
+
730
+ | Param | Type | Required | Description |
731
+ |-------|------|----------|-------------|
732
+ | `platform` | string | No | Filter: `"ios"`, `"android"`, or `"all"` (default) |
733
+
734
+ **Returns:** Table of device profiles: ID, name, platform, screen dimensions, scale factor, and size category.
735
+
736
+ **Available profiles:**
737
+ - **iOS:** iPhone SE (375x667 @2x), iPhone 15 (393x852 @3x), iPhone 15 Pro Max (430x932 @3x), iPad mini (744x1133 @2x), iPad Pro 13" (1032x1376 @2x)
738
+ - **Android:** Pixel 4a (393x851 @2.75x), Pixel 7 (360x780 @3x), Pixel 7 Pro (412x892 @3.5x), Pixel Tablet (1280x800 @2x)
739
+
740
+ ---
741
+
742
+ ### devlens_boot_device
743
+ Boot a single simulator/emulator by profile ID.
744
+
745
+ | Param | Type | Required | Description |
746
+ |-------|------|----------|-------------|
747
+ | `profile` | string | Yes | Profile ID from `devlens_list_profiles` (e.g., `"iphone-15"`, `"pixel-7"`) |
748
+
749
+ **Returns:** Device ID and boot confirmation. DevLens-created devices are prefixed with `DevLens-` for easy identification and cleanup.
750
+
751
+ ---
752
+
753
+ ### devlens_multi_capture
754
+ Capture screenshots and snapshots across multiple devices with adaptive batching.
755
+
756
+ | Param | Type | Required | Description |
757
+ |-------|------|----------|-------------|
758
+ | `profiles` | string[] | No | Profile IDs to capture. Defaults to platform's test matrix (small + medium + large). |
759
+ | `platform` | string | No | `"ios"`, `"android"`, or `"both"` (default: `"ios"`) |
760
+ | `includeScreenshots` | boolean | No | Include screenshots (default: true) |
761
+ | `includeSnapshots` | boolean | No | Include accessibility snapshots (default: true) |
762
+ | `shutdownAfter` | boolean | No | Shutdown devices after capture (default: true) |
763
+
764
+ **Adaptive batching:** Automatically detects system RAM and CPU cores. On 16GB Macs, boots 2-3 iOS simulators per batch with delays between batches. On 32GB+ Macs, boots 4-6 at once. Android emulators use smaller batch sizes due to higher memory usage.
765
+
766
+ **Returns:** Cross-device report with:
767
+ - Per-device screenshots and snapshots
768
+ - Pixel similarity matrix (every device vs every other)
769
+ - Layout consistency analysis
770
+ - Responsive issue detection (missing elements, alignment drift)
771
+
772
+ ---
773
+
774
+ ### devlens_multi_shutdown
775
+ Shutdown and optionally delete all DevLens-created simulators/emulators.
776
+
777
+ | Param | Type | Required | Description |
778
+ |-------|------|----------|-------------|
779
+ | `deleteCreated` | boolean | No | Also delete DevLens-created simulator/AVD entries (default: false) |
780
+
781
+ **Returns:** List of devices shut down and/or deleted.
782
+
783
+ ---
784
+
708
785
  ## Quick Reference Table
709
786
 
710
787
  | # | Tool | Category | Key Params |
@@ -716,7 +793,7 @@ Issues: 3 (0 critical, 2 major, 1 minor)
716
793
  | 5 | `devlens_terminate_app` | App | appId |
717
794
  | 6 | `devlens_install_app` | App | path |
718
795
  | 7 | `devlens_list_apps` | App | — |
719
- | 8 | `devlens_snapshot` | Snapshot | mode?, validate?, scope?, componentRef? |
796
+ | 8 | `devlens_snapshot` | Snapshot | mode?, validate? |
720
797
  | 9 | `devlens_find_element` | Snapshot | text?, label?, type? |
721
798
  | 10 | `devlens_wait_for_element` | Snapshot | text?, label?, timeout? |
722
799
  | 11 | `devlens_wait_for_screen` | Snapshot | text?, label?, stableMs?, timeoutMs? |
@@ -733,16 +810,22 @@ Issues: 3 (0 critical, 2 major, 1 minor)
733
810
  | 22 | `devlens_compare_screenshot` | Visual | referenceImagePath?, referenceImageBase64?, cropRef?, region? |
734
811
  | 23 | `devlens_element_screenshot` | Visual | ref, filename? |
735
812
  | 24 | `devlens_compare_images` | Visual | imageA, imageB, threshold?, resizeStrategy? |
736
- | 25 | `devlens_compare_with_figma` | Visual | figmaUrl?, fileKey?, nodeId?, cropRef?, region?, depth?, excludeSystemBars? |
737
- | 26 | `devlens_compare_properties` | Visual | figmaUrl?, fileKey?, nodeId?, includeColors?, tolerances? |
738
- | 27 | `devlens_metro_status` | Metro | |
739
- | 28 | `devlens_metro_logs` | Metro | level?, since? |
740
- | 29 | `devlens_component_tree` | Metro | depth? |
741
- | 30 | `devlens_hot_reload` | Metro | |
742
- | 31 | `devlens_network_requests` | Metro | urlPattern? |
743
- | 32 | `devlens_dismiss_overlays` | Metro | suppressLogBox?, pressBack? |
744
- | 33 | `devlens_open_url` | Navigation | url |
745
- | 34 | `devlens_go_back` | Navigation | — |
746
- | 35 | `devlens_ds_context` | Design System | |
747
- | 36 | `devlens_analyze` | Analysis | scope, targetRefs?, referenceImagePath?, referenceImageBase64?, figmaUrl?, threshold? |
748
- | 37 | `devlens_vqa_validate` | VQA | figmaUrl?, fileKey?, nodeId?, scale?, checkCategories?, enableAutoFix?, preprocessReference? |
813
+ | 25 | `devlens_compare_with_figma` | Visual | figmaUrl?, fileKey?, nodeId?, cropRef?, region? |
814
+ | 26 | `devlens_metro_status` | Metro | |
815
+ | 27 | `devlens_metro_logs` | Metro | level?, since? |
816
+ | 28 | `devlens_component_tree` | Metro | depth? |
817
+ | 29 | `devlens_hot_reload` | Metro | |
818
+ | 30 | `devlens_network_requests` | Metro | urlPattern? |
819
+ | 31 | `devlens_dismiss_overlays` | Metro | suppressLogBox?, pressBack? |
820
+ | 32 | `devlens_open_url` | Navigation | url |
821
+ | 33 | `devlens_go_back` | Navigation | |
822
+ | 34 | `devlens_ds_context` | Design System | — |
823
+ | 35 | `devlens_analyze` | Analysis | scope, targetRefs?, referenceImagePath?, referenceImageBase64?, figmaUrl?, threshold? |
824
+ | 36 | `devlens_vqa_validate` | VQA | figmaUrl?, fileKey?, nodeId?, scale?, checkCategories?, enableAutoFix?, preprocessReference? |
825
+ | 37 | `devlens_check_prototype` | Prototype | url |
826
+ | 38 | `devlens_explore_prototype` | Prototype | prototypeUrl, figmaUrl?, maxScreens?, captureDelay?, viewportWidth?, viewportHeight?, scrollCapture?, extractDesignTokens? |
827
+ | 39 | `devlens_prototype_screen` | Prototype | url, figmaUrl?, viewportWidth?, viewportHeight?, scrollDepth? |
828
+ | 40 | `devlens_list_profiles` | Multi-Device | platform? |
829
+ | 41 | `devlens_boot_device` | Multi-Device | profile |
830
+ | 42 | `devlens_multi_capture` | Multi-Device | profiles?, platform?, includeScreenshots?, includeSnapshots?, shutdownAfter? |
831
+ | 43 | `devlens_multi_shutdown` | Multi-Device | deleteCreated? |
package/install.sh ADDED
@@ -0,0 +1,119 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # DevLens MCP — One-Command Installer
4
+ #
5
+ # Copy-paste this entire script into your terminal and press Enter.
6
+ # You'll be prompted for your Azure DevOps PAT once, then everything is automatic.
7
+ #
8
+ # What it does:
9
+ # - Authenticates npm with Azure Artifacts
10
+ # - Installs devlens-mcp globally
11
+ # - Configures Cursor IDE
12
+ # - Verifies everything works
13
+ #
14
+
15
+ set -e
16
+
17
+ GREEN='\033[0;32m'
18
+ YELLOW='\033[1;33m'
19
+ RED='\033[0;31m'
20
+ BLUE='\033[0;34m'
21
+ NC='\033[0m'
22
+
23
+ echo ""
24
+ echo -e "${BLUE}╔══════════════════════════════════════════╗${NC}"
25
+ echo -e "${BLUE}║ DevLens MCP — Quick Installer ║${NC}"
26
+ echo -e "${BLUE}╚══════════════════════════════════════════╝${NC}"
27
+ echo ""
28
+
29
+ # Check Node.js
30
+ if ! command -v node &>/dev/null; then
31
+ echo -e "${RED}✗ Node.js not found. Install from https://nodejs.org${NC}"
32
+ exit 1
33
+ fi
34
+
35
+ NODE_VERSION=$(node -v | sed 's/v//')
36
+ NODE_MAJOR=$(echo "$NODE_VERSION" | cut -d. -f1)
37
+ if [ "$NODE_MAJOR" -lt 18 ]; then
38
+ echo -e "${RED}✗ Node.js $NODE_VERSION — v18+ required${NC}"
39
+ exit 1
40
+ fi
41
+ echo -e "${GREEN}✓ Node.js $NODE_VERSION${NC}"
42
+
43
+ # Get PAT
44
+ echo ""
45
+ echo "Create a PAT at: https://dev.azure.com/JioOmni/_usersSettings/tokens"
46
+ echo "Required scope: Packaging → Read"
47
+ echo ""
48
+ read -rsp "Paste your Azure DevOps PAT: " PAT
49
+ echo ""
50
+
51
+ if [ ${#PAT} -lt 20 ]; then
52
+ echo -e "${RED}✗ PAT too short${NC}"
53
+ exit 1
54
+ fi
55
+
56
+ # Configure npm
57
+ echo ""
58
+ echo "Configuring npm..."
59
+ TOKEN=$(echo -n "$PAT" | base64)
60
+ REGISTRY_KEY="//pkgs.dev.azure.com/JioOmni/_packaging/devlens/npm/registry/"
61
+
62
+ npm config set "${REGISTRY_KEY}:username" "JioOmni" 2>/dev/null
63
+ npm config set "${REGISTRY_KEY}:_password" "$TOKEN" 2>/dev/null
64
+ npm config set "${REGISTRY_KEY}:email" "npm@jio.com" 2>/dev/null
65
+
66
+ echo -e "${GREEN}✓ npm authenticated${NC}"
67
+
68
+ # Install DevLens globally
69
+ echo ""
70
+ echo "Installing DevLens..."
71
+ if npm install -g devlens-mcp@latest --registry=https://pkgs.dev.azure.com/JioOmni/_packaging/devlens/npm/registry/ 2>&1 | grep -q "devlens-mcp@"; then
72
+ VERSION=$(devlens-mcp --version 2>/dev/null || echo "installed")
73
+ echo -e "${GREEN}✓ DevLens $VERSION installed${NC}"
74
+ else
75
+ echo -e "${RED}✗ Installation failed - check PAT permissions${NC}"
76
+ exit 1
77
+ fi
78
+
79
+ # Configure Cursor (global)
80
+ echo ""
81
+ echo "Configuring Cursor..."
82
+ CURSOR_CONFIG="$HOME/.cursor/mcp.json"
83
+ mkdir -p "$HOME/.cursor"
84
+
85
+ if [ -f "$CURSOR_CONFIG" ]; then
86
+ EXISTING=$(cat "$CURSOR_CONFIG")
87
+ else
88
+ EXISTING="{}"
89
+ fi
90
+
91
+ # Merge DevLens into existing config
92
+ cat > "$CURSOR_CONFIG" << EOF
93
+ $(node -e "
94
+ const config = JSON.parse(process.argv[1] || '{}');
95
+ if (!config.mcpServers) config.mcpServers = {};
96
+ config.mcpServers.devlens = {
97
+ command: 'devlens-mcp',
98
+ args: [],
99
+ env: { METRO_PORT: '8081' }
100
+ };
101
+ console.log(JSON.stringify(config, null, 2));
102
+ " "$EXISTING")
103
+ EOF
104
+
105
+ echo -e "${GREEN}✓ Cursor configured at $CURSOR_CONFIG${NC}"
106
+
107
+ # Done
108
+ echo ""
109
+ echo -e "${GREEN}╔══════════════════════════════════════════╗${NC}"
110
+ echo -e "${GREEN}║ Installation Complete! ║${NC}"
111
+ echo -e "${GREEN}╚══════════════════════════════════════════╝${NC}"
112
+ echo ""
113
+ echo "Next steps:"
114
+ echo " 1. Restart Cursor"
115
+ echo " 2. Open your React Native project"
116
+ echo " 3. Ask the AI: \"List running devices\""
117
+ echo ""
118
+ echo "Verify: devlens-mcp --version"
119
+ echo ""
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "devlens-mcp",
3
- "version": "0.4.1",
3
+ "version": "0.5.2",
4
4
  "description": "DevLens — Playwright-style MCP server for mobile development. Take screenshots, compare with Figma designs, interact with iOS Simulators & Android Emulators, and access Metro bundler logs.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "bin": {
8
- "devlens-mcp": "dist/bin/cli.js"
8
+ "devlens-mcp": "dist/bin/cli.js",
9
+ "devlens-setup": "dist/bin/setup.js"
9
10
  },
10
11
  "scripts": {
11
12
  "build": "tsc",
@@ -29,6 +30,7 @@
29
30
  "emulator",
30
31
  "simulator",
31
32
  "figma",
33
+ "prototype",
32
34
  "devtools",
33
35
  "testing"
34
36
  ],
@@ -42,6 +44,7 @@
42
44
  "fast-xml-parser": "^4.5.0",
43
45
  "pixelmatch": "^5.3.0",
44
46
  "pngjs": "^7.0.0",
47
+ "puppeteer": "^24.38.0",
45
48
  "sharp": "^0.33.0",
46
49
  "ws": "^8.18.0",
47
50
  "zod": "^3.23.0"