devlens-mcp 0.3.0
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/.claude/settings.json +12 -0
- package/.claude/settings.local.json +17 -0
- package/INSTALLATION_GUIDE.md +354 -0
- package/QUICK_START.md +153 -0
- package/README.md +354 -0
- package/bin/cli.ts +22 -0
- package/bin/register.ts +96 -0
- package/dist/bin/cli.d.ts +3 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +20 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/bin/register.d.ts +10 -0
- package/dist/bin/register.d.ts.map +1 -0
- package/dist/bin/register.js +92 -0
- package/dist/bin/register.js.map +1 -0
- package/dist/src/config/devlens-config.d.ts +92 -0
- package/dist/src/config/devlens-config.d.ts.map +1 -0
- package/dist/src/config/devlens-config.js +70 -0
- package/dist/src/config/devlens-config.js.map +1 -0
- package/dist/src/index.d.ts +35 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +8 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/metro/cdp-client.d.ts +48 -0
- package/dist/src/metro/cdp-client.d.ts.map +1 -0
- package/dist/src/metro/cdp-client.js +127 -0
- package/dist/src/metro/cdp-client.js.map +1 -0
- package/dist/src/metro/log-collector.d.ts +30 -0
- package/dist/src/metro/log-collector.d.ts.map +1 -0
- package/dist/src/metro/log-collector.js +114 -0
- package/dist/src/metro/log-collector.js.map +1 -0
- package/dist/src/metro/metro-bridge.d.ts +56 -0
- package/dist/src/metro/metro-bridge.d.ts.map +1 -0
- package/dist/src/metro/metro-bridge.js +255 -0
- package/dist/src/metro/metro-bridge.js.map +1 -0
- package/dist/src/metro/network-inspector.d.ts +34 -0
- package/dist/src/metro/network-inspector.d.ts.map +1 -0
- package/dist/src/metro/network-inspector.js +100 -0
- package/dist/src/metro/network-inspector.js.map +1 -0
- package/dist/src/platform/android/adb.d.ts +50 -0
- package/dist/src/platform/android/adb.d.ts.map +1 -0
- package/dist/src/platform/android/adb.js +137 -0
- package/dist/src/platform/android/adb.js.map +1 -0
- package/dist/src/platform/android/android-device.d.ts +21 -0
- package/dist/src/platform/android/android-device.d.ts.map +1 -0
- package/dist/src/platform/android/android-device.js +94 -0
- package/dist/src/platform/android/android-device.js.map +1 -0
- package/dist/src/platform/android/ui-automator.d.ts +17 -0
- package/dist/src/platform/android/ui-automator.d.ts.map +1 -0
- package/dist/src/platform/android/ui-automator.js +126 -0
- package/dist/src/platform/android/ui-automator.js.map +1 -0
- package/dist/src/platform/device-manager.d.ts +28 -0
- package/dist/src/platform/device-manager.d.ts.map +1 -0
- package/dist/src/platform/device-manager.js +185 -0
- package/dist/src/platform/device-manager.js.map +1 -0
- package/dist/src/platform/device.d.ts +86 -0
- package/dist/src/platform/device.d.ts.map +1 -0
- package/dist/src/platform/device.js +7 -0
- package/dist/src/platform/device.js.map +1 -0
- package/dist/src/platform/ios/accessibility.d.ts +17 -0
- package/dist/src/platform/ios/accessibility.d.ts.map +1 -0
- package/dist/src/platform/ios/accessibility.js +159 -0
- package/dist/src/platform/ios/accessibility.js.map +1 -0
- package/dist/src/platform/ios/ios-device.d.ts +22 -0
- package/dist/src/platform/ios/ios-device.d.ts.map +1 -0
- package/dist/src/platform/ios/ios-device.js +97 -0
- package/dist/src/platform/ios/ios-device.js.map +1 -0
- package/dist/src/platform/ios/simctl.d.ts +54 -0
- package/dist/src/platform/ios/simctl.d.ts.map +1 -0
- package/dist/src/platform/ios/simctl.js +192 -0
- package/dist/src/platform/ios/simctl.js.map +1 -0
- package/dist/src/server.d.ts +3 -0
- package/dist/src/server.d.ts.map +1 -0
- package/dist/src/server.js +176 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/snapshot/formatter.d.ts +18 -0
- package/dist/src/snapshot/formatter.d.ts.map +1 -0
- package/dist/src/snapshot/formatter.js +86 -0
- package/dist/src/snapshot/formatter.js.map +1 -0
- package/dist/src/snapshot/ref-registry.d.ts +67 -0
- package/dist/src/snapshot/ref-registry.d.ts.map +1 -0
- package/dist/src/snapshot/ref-registry.js +169 -0
- package/dist/src/snapshot/ref-registry.js.map +1 -0
- package/dist/src/snapshot/snapshot-differ.d.ts +57 -0
- package/dist/src/snapshot/snapshot-differ.d.ts.map +1 -0
- package/dist/src/snapshot/snapshot-differ.js +153 -0
- package/dist/src/snapshot/snapshot-differ.js.map +1 -0
- package/dist/src/tools/app-tools.d.ts +71 -0
- package/dist/src/tools/app-tools.d.ts.map +1 -0
- package/dist/src/tools/app-tools.js +97 -0
- package/dist/src/tools/app-tools.js.map +1 -0
- package/dist/src/tools/device-tools.d.ts +53 -0
- package/dist/src/tools/device-tools.d.ts.map +1 -0
- package/dist/src/tools/device-tools.js +86 -0
- package/dist/src/tools/device-tools.js.map +1 -0
- package/dist/src/tools/ds-tools.d.ts +65 -0
- package/dist/src/tools/ds-tools.d.ts.map +1 -0
- package/dist/src/tools/ds-tools.js +314 -0
- package/dist/src/tools/ds-tools.js.map +1 -0
- package/dist/src/tools/interaction-tools.d.ts +248 -0
- package/dist/src/tools/interaction-tools.d.ts.map +1 -0
- package/dist/src/tools/interaction-tools.js +391 -0
- package/dist/src/tools/interaction-tools.js.map +1 -0
- package/dist/src/tools/metro-tools.d.ts +115 -0
- package/dist/src/tools/metro-tools.d.ts.map +1 -0
- package/dist/src/tools/metro-tools.js +270 -0
- package/dist/src/tools/metro-tools.js.map +1 -0
- package/dist/src/tools/navigation-tools.d.ts +36 -0
- package/dist/src/tools/navigation-tools.d.ts.map +1 -0
- package/dist/src/tools/navigation-tools.js +60 -0
- package/dist/src/tools/navigation-tools.js.map +1 -0
- package/dist/src/tools/screenshot-tools.d.ts +298 -0
- package/dist/src/tools/screenshot-tools.d.ts.map +1 -0
- package/dist/src/tools/screenshot-tools.js +565 -0
- package/dist/src/tools/screenshot-tools.js.map +1 -0
- package/dist/src/tools/snapshot-tools.d.ts +161 -0
- package/dist/src/tools/snapshot-tools.d.ts.map +1 -0
- package/dist/src/tools/snapshot-tools.js +479 -0
- package/dist/src/tools/snapshot-tools.js.map +1 -0
- package/dist/src/utils/image-preprocess.d.ts +49 -0
- package/dist/src/utils/image-preprocess.d.ts.map +1 -0
- package/dist/src/utils/image-preprocess.js +322 -0
- package/dist/src/utils/image-preprocess.js.map +1 -0
- package/dist/src/utils/retry.d.ts +21 -0
- package/dist/src/utils/retry.d.ts.map +1 -0
- package/dist/src/utils/retry.js +33 -0
- package/dist/src/utils/retry.js.map +1 -0
- package/dist/src/visual/comparator.d.ts +51 -0
- package/dist/src/visual/comparator.d.ts.map +1 -0
- package/dist/src/visual/comparator.js +119 -0
- package/dist/src/visual/comparator.js.map +1 -0
- package/dist/src/visual/layout-analyzer.d.ts +64 -0
- package/dist/src/visual/layout-analyzer.d.ts.map +1 -0
- package/dist/src/visual/layout-analyzer.js +198 -0
- package/dist/src/visual/layout-analyzer.js.map +1 -0
- package/dist/src/visual/screenshot.d.ts +17 -0
- package/dist/src/visual/screenshot.d.ts.map +1 -0
- package/dist/src/visual/screenshot.js +39 -0
- package/dist/src/visual/screenshot.js.map +1 -0
- package/docs/figma-workflow.md +289 -0
- package/docs/setup-guide.md +360 -0
- package/docs/tool-reference.md +622 -0
- package/package.json +57 -0
- package/src/config/devlens-config.ts +76 -0
- package/src/index.ts +5 -0
- package/src/metro/cdp-client.ts +160 -0
- package/src/metro/log-collector.ts +137 -0
- package/src/metro/metro-bridge.ts +307 -0
- package/src/metro/network-inspector.ts +134 -0
- package/src/platform/android/adb.ts +200 -0
- package/src/platform/android/android-device.ts +116 -0
- package/src/platform/android/ui-automator.ts +141 -0
- package/src/platform/device-manager.ts +229 -0
- package/src/platform/device.ts +110 -0
- package/src/platform/ios/accessibility.ts +189 -0
- package/src/platform/ios/ios-device.ts +116 -0
- package/src/platform/ios/simctl.ts +244 -0
- package/src/server.ts +228 -0
- package/src/snapshot/formatter.ts +102 -0
- package/src/snapshot/ref-registry.ts +230 -0
- package/src/snapshot/snapshot-differ.ts +220 -0
- package/src/tools/app-tools.ts +111 -0
- package/src/tools/device-tools.ts +96 -0
- package/src/tools/ds-tools.ts +395 -0
- package/src/tools/interaction-tools.ts +467 -0
- package/src/tools/metro-tools.ts +320 -0
- package/src/tools/navigation-tools.ts +71 -0
- package/src/tools/screenshot-tools.ts +698 -0
- package/src/tools/snapshot-tools.ts +585 -0
- package/src/utils/image-preprocess.ts +430 -0
- package/src/utils/retry.ts +51 -0
- package/src/visual/comparator.ts +191 -0
- package/src/visual/layout-analyzer.ts +283 -0
- package/src/visual/screenshot.ts +49 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(git remote set-url origin \"https://JioOmni@dev.azure.com/JioOmni/OmniAI/_git/mcp-devlens\")",
|
|
5
|
+
"Bash(git add README.md docs/setup-guide.md)",
|
|
6
|
+
"Bash(PAT=\"9Myzk2VeYmr8RfL9i7uJbfQvMWnqy7M5NVkB8cIDEB2u9njYt19yJQQJ99CBACAAAAAUmMaZAAASAZDO1XcC\")",
|
|
7
|
+
"Bash(GIT_TERMINAL_PROMPT=0 git -c credential.helper= pull --rebase origin main)",
|
|
8
|
+
"Bash(GIT_TERMINAL_PROMPT=0 git -c credential.helper= push -u origin main)",
|
|
9
|
+
"Bash(npm whoami)"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(wc:*)",
|
|
5
|
+
"Bash(npx tsc:*)",
|
|
6
|
+
"Bash(sips:*)",
|
|
7
|
+
"Bash(npm run build)",
|
|
8
|
+
"Bash(npm run register)",
|
|
9
|
+
"Bash(claude mcp list)",
|
|
10
|
+
"WebFetch(domain:github.com)",
|
|
11
|
+
"WebFetch(domain:developers.figma.com)",
|
|
12
|
+
"WebFetch(domain:sharp.pixelplumbing.com)",
|
|
13
|
+
"WebFetch(domain:forum.figma.com)",
|
|
14
|
+
"Bash(ls /Users/siddhant1.singh/StudioProjects/devlens/*.md)"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
# DevLens MCP - Installation Guide for Developers
|
|
2
|
+
|
|
3
|
+
## What is DevLens?
|
|
4
|
+
|
|
5
|
+
DevLens is a Playwright-style MCP (Model Context Protocol) server that gives AI agents the ability to **see, interact with, and verify** mobile apps running on simulators/emulators. It enables automated React Native development workflows with Figma design verification.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
Before installing DevLens, ensure you have:
|
|
12
|
+
|
|
13
|
+
- **Node.js** >= 18
|
|
14
|
+
- **For Android**: Android SDK with `adb` in PATH (installed via Android Studio)
|
|
15
|
+
- **For iOS** (macOS only): Xcode with Command Line Tools
|
|
16
|
+
- **React Native**: Metro bundler running (`npx react-native start`)
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Installation Methods
|
|
21
|
+
|
|
22
|
+
### Method 1: Cursor IDE (Recommended for Cursor users)
|
|
23
|
+
|
|
24
|
+
#### Step 1: Create or Edit MCP Configuration
|
|
25
|
+
|
|
26
|
+
Navigate to your project root and create/edit `.cursor/mcp.json`:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"mcpServers": {
|
|
31
|
+
"devlens": {
|
|
32
|
+
"command": "npx",
|
|
33
|
+
"args": ["devlens-mcp@latest"],
|
|
34
|
+
"env": {
|
|
35
|
+
"METRO_PORT": "8081",
|
|
36
|
+
"FIGMA_TOKEN": "figd_xxxxx"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
#### Step 2: Configure Environment Variables
|
|
44
|
+
|
|
45
|
+
| Variable | Required | Description |
|
|
46
|
+
|----------|----------|-------------|
|
|
47
|
+
| `METRO_PORT` | No | Metro bundler port (default: 8081) |
|
|
48
|
+
| `FIGMA_TOKEN` | Yes* | Figma personal access token (required for Figma comparison) |
|
|
49
|
+
| `DEVLENS_CONFIG` | No | Path to `devlens.config.json` for design system context |
|
|
50
|
+
| `DEVICE_ID` | No | Target specific device (defaults to first available) |
|
|
51
|
+
|
|
52
|
+
*Required only if using `devlens_compare_with_figma`
|
|
53
|
+
|
|
54
|
+
#### Step 3: Get Figma Token (if needed)
|
|
55
|
+
|
|
56
|
+
1. Go to https://www.figma.com/settings
|
|
57
|
+
2. Scroll to "Personal access tokens"
|
|
58
|
+
3. Click "Create new token"
|
|
59
|
+
4. Give it a name (e.g., "DevLens")
|
|
60
|
+
5. Required scope: **File content: Read**
|
|
61
|
+
6. Copy the token (starts with `figd_`)
|
|
62
|
+
7. Add to `mcp.json` as shown above
|
|
63
|
+
|
|
64
|
+
#### Step 4: Restart Cursor
|
|
65
|
+
|
|
66
|
+
Close and reopen Cursor IDE. DevLens tools will be available in the AI agent context.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
### Method 2: Claude Code CLI (Recommended for Claude Code)
|
|
71
|
+
|
|
72
|
+
#### One Command Install:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
claude mcp add devlens -- npx devlens-mcp@latest
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
This automatically configures DevLens in your Claude Code environment.
|
|
79
|
+
|
|
80
|
+
#### Manual Configuration:
|
|
81
|
+
|
|
82
|
+
If the command above doesn't work, edit `~/.config/claude/claude_desktop_config.json`:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"mcpServers": {
|
|
87
|
+
"devlens": {
|
|
88
|
+
"command": "npx",
|
|
89
|
+
"args": ["devlens-mcp@latest"],
|
|
90
|
+
"env": {
|
|
91
|
+
"METRO_PORT": "8081",
|
|
92
|
+
"FIGMA_TOKEN": "figd_xxxxx"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
### Method 3: Claude Desktop App
|
|
102
|
+
|
|
103
|
+
#### Step 1: Locate Config File
|
|
104
|
+
|
|
105
|
+
**macOS:**
|
|
106
|
+
```
|
|
107
|
+
~/Library/Application Support/Claude/claude_desktop_config.json
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Windows:**
|
|
111
|
+
```
|
|
112
|
+
%APPDATA%/Claude/claude_desktop_config.json
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Linux:**
|
|
116
|
+
```
|
|
117
|
+
~/.config/Claude/claude_desktop_config.json
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### Step 2: Edit Configuration
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"mcpServers": {
|
|
125
|
+
"devlens": {
|
|
126
|
+
"command": "npx",
|
|
127
|
+
"args": ["devlens-mcp@latest"],
|
|
128
|
+
"env": {
|
|
129
|
+
"METRO_PORT": "8081",
|
|
130
|
+
"FIGMA_TOKEN": "figd_xxxxx"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
#### Step 3: Restart Claude Desktop
|
|
138
|
+
|
|
139
|
+
Completely quit and restart the Claude Desktop app.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
### Method 4: Local Development (For Contributors)
|
|
144
|
+
|
|
145
|
+
If you want to modify DevLens or use it from source:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# Clone the repository
|
|
149
|
+
git clone https://dev.azure.com/JioOmni/OmniAI/_git/mcp-devlens
|
|
150
|
+
cd mcp-devlens
|
|
151
|
+
|
|
152
|
+
# Install dependencies
|
|
153
|
+
npm install
|
|
154
|
+
|
|
155
|
+
# Build the project
|
|
156
|
+
npm run build
|
|
157
|
+
|
|
158
|
+
# Auto-register with Claude Code (if installed)
|
|
159
|
+
npm run register
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
#### For Cursor (Local Development):
|
|
163
|
+
|
|
164
|
+
Create `.cursor/mcp.json` in your project:
|
|
165
|
+
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"mcpServers": {
|
|
169
|
+
"devlens": {
|
|
170
|
+
"command": "node",
|
|
171
|
+
"args": ["/absolute/path/to/mcp-devlens/dist/bin/cli.js"],
|
|
172
|
+
"env": {
|
|
173
|
+
"METRO_PORT": "8081",
|
|
174
|
+
"FIGMA_TOKEN": "figd_xxxxx"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Replace `/absolute/path/to/mcp-devlens` with your actual path.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Verification
|
|
186
|
+
|
|
187
|
+
### Test if DevLens is Working
|
|
188
|
+
|
|
189
|
+
1. Start your Android emulator or iOS simulator
|
|
190
|
+
2. Launch your React Native app
|
|
191
|
+
3. In Cursor/Claude, ask the AI: "List running devices"
|
|
192
|
+
4. The AI should use `devlens_list_devices` and show your device
|
|
193
|
+
|
|
194
|
+
### Example Commands to Test:
|
|
195
|
+
|
|
196
|
+
- "Take a screenshot of the app"
|
|
197
|
+
- "Show me the UI element tree"
|
|
198
|
+
- "What elements are on the screen?"
|
|
199
|
+
- "Compare the current screen with this Figma design: [URL]"
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Configuration Files
|
|
204
|
+
|
|
205
|
+
### Design System Context (Optional)
|
|
206
|
+
|
|
207
|
+
To enable `devlens_ds_context` for design token awareness, create `devlens.config.json` in your app root:
|
|
208
|
+
|
|
209
|
+
```json
|
|
210
|
+
{
|
|
211
|
+
"designSystem": {
|
|
212
|
+
"tokensFile": "src/theme/tokens.ts",
|
|
213
|
+
"componentsDir": "src/components/designSystem",
|
|
214
|
+
"usagePatterns": {
|
|
215
|
+
"include": ["src/**/*.tsx"],
|
|
216
|
+
"exclude": ["node_modules/**", "**/*.test.tsx"]
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Then set the environment variable:
|
|
223
|
+
|
|
224
|
+
```json
|
|
225
|
+
{
|
|
226
|
+
"mcpServers": {
|
|
227
|
+
"devlens": {
|
|
228
|
+
"command": "npx",
|
|
229
|
+
"args": ["devlens-mcp@latest"],
|
|
230
|
+
"env": {
|
|
231
|
+
"DEVLENS_CONFIG": "/absolute/path/to/your/app/devlens.config.json",
|
|
232
|
+
"METRO_PORT": "8081",
|
|
233
|
+
"FIGMA_TOKEN": "figd_xxxxx"
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Troubleshooting
|
|
243
|
+
|
|
244
|
+
### Issue: "No running simulators or emulators"
|
|
245
|
+
|
|
246
|
+
**Solution:** Start a device from Android Studio or Xcode before using DevLens.
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
# Android
|
|
250
|
+
emulator -avd <your_avd_name>
|
|
251
|
+
|
|
252
|
+
# iOS (macOS)
|
|
253
|
+
xcrun simctl boot <device_uuid>
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### Issue: "Could not connect to Metro bundler"
|
|
257
|
+
|
|
258
|
+
**Solution:** Ensure Metro is running:
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
npx react-native start
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Check that `METRO_PORT` matches your Metro port (usually 8081).
|
|
265
|
+
|
|
266
|
+
### Issue: "ADB command not found"
|
|
267
|
+
|
|
268
|
+
**Solution:** Add Android SDK platform-tools to your PATH:
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
# Add to ~/.zshrc or ~/.bashrc
|
|
272
|
+
export ANDROID_HOME=$HOME/Library/Android/sdk
|
|
273
|
+
export PATH=$PATH:$ANDROID_HOME/platform-tools
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Issue: "simctl not found" (iOS)
|
|
277
|
+
|
|
278
|
+
**Solution:** Install Xcode Command Line Tools:
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
xcode-select --install
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Issue: DevLens tools not showing in Cursor/Claude
|
|
285
|
+
|
|
286
|
+
**Solutions:**
|
|
287
|
+
1. Check MCP config file syntax (valid JSON)
|
|
288
|
+
2. Restart Cursor/Claude completely
|
|
289
|
+
3. Check Console/Logs for MCP connection errors
|
|
290
|
+
4. For local development, verify the path is absolute and correct
|
|
291
|
+
5. Run `npx devlens-mcp@latest` in terminal to verify it works standalone
|
|
292
|
+
|
|
293
|
+
### Issue: "Invalid token" on Figma compare
|
|
294
|
+
|
|
295
|
+
**Solution:**
|
|
296
|
+
- Use a personal access token (starts with `figd_`), not OAuth
|
|
297
|
+
- Required scope: **File content: Read**
|
|
298
|
+
- Generate at https://www.figma.com/settings
|
|
299
|
+
|
|
300
|
+
### Issue: "File not exportable" on Figma compare
|
|
301
|
+
|
|
302
|
+
**Solution:** In Figma, disable "Prevent viewers from copying and exporting" in share settings.
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## What's Next?
|
|
307
|
+
|
|
308
|
+
### Basic Workflow
|
|
309
|
+
|
|
310
|
+
1. **Check Metro**: Ask AI to check if Metro is healthy
|
|
311
|
+
2. **Take Screenshots**: Capture current app state
|
|
312
|
+
3. **Interact**: Tap buttons, fill forms, navigate
|
|
313
|
+
4. **Verify**: Compare with Figma designs
|
|
314
|
+
5. **Iterate**: Make code changes, hot reload, repeat
|
|
315
|
+
|
|
316
|
+
### Advanced Workflows
|
|
317
|
+
|
|
318
|
+
- **Figma-to-Code Loop**: Automated design implementation with visual verification
|
|
319
|
+
- **Design System Integration**: Use `devlens_ds_context` for token-aware code generation
|
|
320
|
+
- **Flow Testing**: Use `devlens_capture_flow` for multi-step interaction capture
|
|
321
|
+
- **Layout Debugging**: Per-element comparison scores to pinpoint UI issues
|
|
322
|
+
|
|
323
|
+
### Example AI Prompts
|
|
324
|
+
|
|
325
|
+
- "Take a screenshot and compare it with this Figma design: [URL]"
|
|
326
|
+
- "Navigate to the login screen and verify all elements are present"
|
|
327
|
+
- "Fill out the registration form with test data"
|
|
328
|
+
- "Show me the design system tokens and components available"
|
|
329
|
+
- "Capture a flow of: tap login → enter credentials → tap submit"
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## Support
|
|
334
|
+
|
|
335
|
+
- **Documentation**: See [README.md](./README.md) for full tool reference
|
|
336
|
+
- **Issues**: Report issues to your team's Azure DevOps
|
|
337
|
+
- **Updates**: Run `npx devlens-mcp@latest` to always get the latest version
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
## Quick Reference
|
|
342
|
+
|
|
343
|
+
### Available Tools (34 total)
|
|
344
|
+
|
|
345
|
+
- **Device Management** (3): list_devices, device_info, set_orientation
|
|
346
|
+
- **App Management** (4): launch_app, terminate_app, install_app, list_apps
|
|
347
|
+
- **Snapshot & Elements** (5): snapshot, find_element, wait_for_element, wait_for_screen, element_info
|
|
348
|
+
- **Interaction** (8): tap, type, swipe, scroll, long_press, press_button, fill_form, capture_flow
|
|
349
|
+
- **Screenshots & Visual** (5): screenshot, compare_screenshot, element_screenshot, compare_images, compare_with_figma
|
|
350
|
+
- **React Native / Metro** (6): metro_status, metro_logs, component_tree, hot_reload, network_requests, dismiss_overlays
|
|
351
|
+
- **Navigation** (2): open_url, go_back
|
|
352
|
+
- **Design System** (1): ds_context
|
|
353
|
+
|
|
354
|
+
See full documentation in [README.md](./README.md) for detailed tool descriptions.
|
package/QUICK_START.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# DevLens MCP - Quick Start Guide
|
|
2
|
+
|
|
3
|
+
## 🚀 Pushing Code to Azure DevOps
|
|
4
|
+
|
|
5
|
+
### Option 1: Using the Script (Easiest)
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
./PUSH_COMMANDS.sh
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The script will guide you through:
|
|
12
|
+
1. Generating a Personal Access Token (PAT)
|
|
13
|
+
2. Configuring the remote
|
|
14
|
+
3. Pushing the code
|
|
15
|
+
|
|
16
|
+
### Option 2: Manual Steps
|
|
17
|
+
|
|
18
|
+
1. **Generate PAT**: Visit https://dev.azure.com/JioOmni/_usersSettings/tokens
|
|
19
|
+
- Click "New Token"
|
|
20
|
+
- Name: "DevLens MCP"
|
|
21
|
+
- Permissions: Code → Read & Write
|
|
22
|
+
- Copy the token
|
|
23
|
+
|
|
24
|
+
2. **Push Code**:
|
|
25
|
+
```bash
|
|
26
|
+
git remote set-url origin https://JioOmni:YOUR_PAT@dev.azure.com/JioOmni/OmniAI/_git/mcp-devlens
|
|
27
|
+
git push -u origin main
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
3. **Verify**: https://dev.azure.com/JioOmni/OmniAI/_git/mcp-devlens
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 👥 How Developers Install DevLens
|
|
35
|
+
|
|
36
|
+
### For Cursor IDE Users
|
|
37
|
+
|
|
38
|
+
Add to `.cursor/mcp.json` in their project root:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"mcpServers": {
|
|
43
|
+
"devlens": {
|
|
44
|
+
"command": "npx",
|
|
45
|
+
"args": ["devlens-mcp@latest"],
|
|
46
|
+
"env": {
|
|
47
|
+
"METRO_PORT": "8081",
|
|
48
|
+
"FIGMA_TOKEN": "figd_xxxxx"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Then restart Cursor.
|
|
56
|
+
|
|
57
|
+
### For Claude Desktop Users
|
|
58
|
+
|
|
59
|
+
**macOS**: Edit `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
60
|
+
|
|
61
|
+
**Windows**: Edit `%APPDATA%/Claude/claude_desktop_config.json`
|
|
62
|
+
|
|
63
|
+
Add the same configuration as above, then restart Claude Desktop.
|
|
64
|
+
|
|
65
|
+
### For Claude Code CLI Users
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
claude mcp add devlens -- npx devlens-mcp@latest
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 🔧 What Developers Need
|
|
74
|
+
|
|
75
|
+
### Prerequisites
|
|
76
|
+
|
|
77
|
+
- Node.js >= 18
|
|
78
|
+
- Android SDK (for Android) OR Xcode (for iOS on macOS)
|
|
79
|
+
- React Native app with Metro running
|
|
80
|
+
|
|
81
|
+
### Environment Variables
|
|
82
|
+
|
|
83
|
+
| Variable | Required | Description |
|
|
84
|
+
|----------|----------|-------------|
|
|
85
|
+
| `FIGMA_TOKEN` | Optional* | Figma personal access token (for design comparison) |
|
|
86
|
+
| `METRO_PORT` | No | Default: 8081 |
|
|
87
|
+
| `DEVLENS_CONFIG` | No | Path to design system config |
|
|
88
|
+
|
|
89
|
+
*Required only for Figma comparison features
|
|
90
|
+
|
|
91
|
+
### Getting Figma Token
|
|
92
|
+
|
|
93
|
+
1. Go to https://www.figma.com/settings
|
|
94
|
+
2. Create new token with "File content: Read" scope
|
|
95
|
+
3. Copy token (starts with `figd_`)
|
|
96
|
+
4. Add to MCP config
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 📚 Key Documentation Files
|
|
101
|
+
|
|
102
|
+
- **INSTALLATION_GUIDE.md** - Complete installation instructions for all platforms
|
|
103
|
+
- **README.md** - Full tool reference and features
|
|
104
|
+
- **AZURE_DEVOPS_SETUP.md** - Detailed push instructions
|
|
105
|
+
- **docs/setup-guide.md** - Design system configuration
|
|
106
|
+
- **docs/figma-workflow.md** - Figma integration guide
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## ✅ Testing the Installation
|
|
111
|
+
|
|
112
|
+
After installation, developers can test by asking the AI:
|
|
113
|
+
|
|
114
|
+
1. "List running devices" → Should show their emulator/simulator
|
|
115
|
+
2. "Take a screenshot" → Should capture the app screen
|
|
116
|
+
3. "Show the element tree" → Should display UI hierarchy
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 🎯 Key Features to Share
|
|
121
|
+
|
|
122
|
+
- **34 Tools** for mobile app automation
|
|
123
|
+
- **Figma Design Comparison** with per-element similarity scores
|
|
124
|
+
- **React Native Integration** with Metro bundler
|
|
125
|
+
- **Playwright-style API** with element references (no coordinate guessing)
|
|
126
|
+
- **Design System Context** for token-aware code generation
|
|
127
|
+
- **Works with Android & iOS**
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 📞 Quick Links
|
|
132
|
+
|
|
133
|
+
- **Azure Repo**: https://dev.azure.com/JioOmni/OmniAI/_git/mcp-devlens
|
|
134
|
+
- **Figma Settings**: https://www.figma.com/settings
|
|
135
|
+
- **Azure PAT Creation**: https://dev.azure.com/JioOmni/_usersSettings/tokens
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 🐛 Common Issues
|
|
140
|
+
|
|
141
|
+
### "No devices found"
|
|
142
|
+
Start emulator/simulator first
|
|
143
|
+
|
|
144
|
+
### "Metro not connected"
|
|
145
|
+
Run `npx react-native start`
|
|
146
|
+
|
|
147
|
+
### "Invalid Figma token"
|
|
148
|
+
Use personal token (figd_), not OAuth
|
|
149
|
+
|
|
150
|
+
### "DevLens tools not showing"
|
|
151
|
+
Restart Cursor/Claude completely
|
|
152
|
+
|
|
153
|
+
See INSTALLATION_GUIDE.md for detailed troubleshooting.
|