ira-researcher 1.0.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/LICENSE +21 -0
- package/PLAN.md +554 -0
- package/README.md +335 -0
- package/install.ps1 +59 -0
- package/install.sh +55 -0
- package/package.json +48 -0
- package/src/browser.js +308 -0
- package/src/browser_old.js +190 -0
- package/src/ghost/index.js +694 -0
- package/src/ghost/index_old.js +310 -0
- package/src/index.js +205 -0
- package/src/pipeline.js +32 -0
- package/src/tools/debug.js +62 -0
- package/src/tools/devtools.js +189 -0
- package/src/tools/interaction.js +217 -0
- package/src/tools/navigation.js +47 -0
- package/src/tools/reading.js +174 -0
- package/src/tools/status.js +63 -0
- package/src/tools/tabs.js +73 -0
- package/src/tools/utility.js +123 -0
- package/src/tools/vision.js +135 -0
- package/src/utils.js +89 -0
- package/test-prompt.md +112 -0
- package/tools.md +234 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 bidre
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/PLAN.md
ADDED
|
@@ -0,0 +1,554 @@
|
|
|
1
|
+
# 🚀 IRA-RESEARCHER — The Ultimate Browser Automation MCP
|
|
2
|
+
|
|
3
|
+
## 🎯 Vision
|
|
4
|
+
|
|
5
|
+
The **best browser automation MCP server** ever built. Combining:
|
|
6
|
+
- **Claude-in-Chrome** — clean MCP tools, easy setup
|
|
7
|
+
- **browser-use** — powerful ghost effects, smart DOM understanding
|
|
8
|
+
- **Plus** — stealth mode, auto-recovery, developer tools, anti-detection
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 📋 Setup (2 Steps)
|
|
13
|
+
|
|
14
|
+
### 1. Install
|
|
15
|
+
```powershell
|
|
16
|
+
cd IRA-RESEARCHER
|
|
17
|
+
npm install
|
|
18
|
+
npx puppeteer browsers install chrome
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 2. Add to MCP Config
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"mcpServers": {
|
|
25
|
+
"ira-researcher": {
|
|
26
|
+
"command": "node",
|
|
27
|
+
"args": ["path/to/IRA-RESEARCHER/server.js"],
|
|
28
|
+
"env": {
|
|
29
|
+
"IRA_HEADLESS": "false",
|
|
30
|
+
"IRA_GHOST": "true",
|
|
31
|
+
"IRA_STEALTH": "true",
|
|
32
|
+
"IRA_PROXY": ""
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 🧩 Full Tool List (32 tools — no LLM needed)
|
|
42
|
+
|
|
43
|
+
### Navigation (4 tools)
|
|
44
|
+
| Tool | Description |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `ira_navigate` | Go to URL with auto-retry on empty DOM |
|
|
47
|
+
| `ira_go_back` | Go back in history |
|
|
48
|
+
| `ira_go_forward` | Go forward in history |
|
|
49
|
+
| `ira_reload` | Reload current page |
|
|
50
|
+
|
|
51
|
+
### Interaction (6 tools)
|
|
52
|
+
| Tool | Description |
|
|
53
|
+
|---|---|
|
|
54
|
+
| `ira_click` | Click by element index OR (x,y) coordinates |
|
|
55
|
+
| `ira_type` | Type text into input field |
|
|
56
|
+
| `ira_hover` | Hover over element |
|
|
57
|
+
| `ira_drag` | Click & drag from A to B |
|
|
58
|
+
| `ira_upload` | Upload file to input element |
|
|
59
|
+
| `ira_select` | Select dropdown option |
|
|
60
|
+
|
|
61
|
+
### Vision & Reading (8 tools)
|
|
62
|
+
| Tool | Description |
|
|
63
|
+
|---|---|
|
|
64
|
+
| `ira_screenshot` | Take full-page screenshot → returns **image** to Cline |
|
|
65
|
+
| `ira_element_screenshot` | Screenshot specific element by index → **cropped image** |
|
|
66
|
+
| `ira_extract_images` | Get all `<img>` tags with src, alt, dimensions → can download each |
|
|
67
|
+
| `ira_get_state` | Get page state with interactive elements |
|
|
68
|
+
| `ira_read_page` | Full accessibility tree |
|
|
69
|
+
| `ira_find` | Find elements by text description |
|
|
70
|
+
| `ira_extract_text` | Extract article/main text |
|
|
71
|
+
| `ira_get_html` | Get raw HTML of page or selector |
|
|
72
|
+
|
|
73
|
+
### Tab Management (3 tools)
|
|
74
|
+
| Tool | Description |
|
|
75
|
+
|---|---|
|
|
76
|
+
| `ira_tabs` | List all open tabs |
|
|
77
|
+
| `ira_switch_tab` | Switch to tab by ID |
|
|
78
|
+
| `ira_close_tab` | Close a tab |
|
|
79
|
+
|
|
80
|
+
### Debug & DevTools (9 tools — full Chrome DevTools access)
|
|
81
|
+
| Tool | Description |
|
|
82
|
+
|---|---|
|
|
83
|
+
| `ira_console` | Read browser console logs (Console tab) |
|
|
84
|
+
| `ira_network` | Read network requests (Network tab) |
|
|
85
|
+
| `ira_javascript` | Execute JavaScript in page (Console executor) |
|
|
86
|
+
| `ira_inspect_element` | Get full DOM tree with computed styles (Elements tab) |
|
|
87
|
+
| `ira_get_styles` | Get computed CSS styles of any element (Styles pane) |
|
|
88
|
+
| `ira_performance` | Get page load metrics: TTFB, DOM ready, resources (Performance tab) |
|
|
89
|
+
| `ira_storage` | View cookies, localStorage, sessionStorage (Application tab) |
|
|
90
|
+
| `ira_network_timing` | Get request timing waterfall: TTFB, download, total (Network waterfall) |
|
|
91
|
+
| `ira_audit_accessibility` | Run accessibility audit on page (Lighthouse audit) |
|
|
92
|
+
|
|
93
|
+
### Utility (3 tools)
|
|
94
|
+
| Tool | Description |
|
|
95
|
+
|---|---|
|
|
96
|
+
| `ira_wait` | Wait for element or seconds |
|
|
97
|
+
| `ira_scroll` | Scroll page |
|
|
98
|
+
| `ira_cookies` | Get/set browser cookies |
|
|
99
|
+
|
|
100
|
+
> **26 tools, zero LLM dependency.** Cline/Claude Code is the brain. IRA-RESEARCHER is just the hands.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 👻 Ghost Effects v2.0 (Enhanced)
|
|
105
|
+
|
|
106
|
+
### 1. Floating Action Panel (enhanced from browser-use)
|
|
107
|
+
```
|
|
108
|
+
┌────────────────────────────────────┐
|
|
109
|
+
│ 🤖 IRA-RESEARCHER 3/12 │ ← Action counter
|
|
110
|
+
├────────────────────────────────────┤
|
|
111
|
+
│ │
|
|
112
|
+
│ ⏱ 2s ago ▶️ Navigated to google.com │ ← Green border
|
|
113
|
+
│ ⏱ 1s ago 🖱️ Clicked #2 "Search" │ ← Green border
|
|
114
|
+
│ ⏱ 0s ago ⌨️ Typed "AI research" │ ← Green border
|
|
115
|
+
│ ⏱ 0s ago 📸 Screenshot saved │ ← Blue border
|
|
116
|
+
│ │
|
|
117
|
+
├────────────────────────────────────┤
|
|
118
|
+
│ 🔵 Active ✅ Done ⚠️ Warning │ ← Status bar
|
|
119
|
+
└────────────────────────────────────┘
|
|
120
|
+
```
|
|
121
|
+
- **Action counter** showing step X/Y in header
|
|
122
|
+
- **Relative timestamps** (2s ago, 1m ago)
|
|
123
|
+
- **Status bar** at bottom showing current state
|
|
124
|
+
- **Keyboard shortcut** to toggle (Ctrl+Shift+I)
|
|
125
|
+
|
|
126
|
+
### 2. Click Ripple Animation (enhanced)
|
|
127
|
+
```css
|
|
128
|
+
/* Click at (x,y) shows expanding orange ring */
|
|
129
|
+
@keyframes clickRipple {
|
|
130
|
+
0% { transform: scale(0.5); opacity: 1; }
|
|
131
|
+
50% { transform: scale(2); opacity: 0.5; }
|
|
132
|
+
100% { transform: scale(3); opacity: 0; }
|
|
133
|
+
}
|
|
134
|
+
/* Plus a persistent dot at center */
|
|
135
|
+
```
|
|
136
|
+
- **Expanding ring** animation (0.5s)
|
|
137
|
+
- **Center dot** that fades slowly (2s)
|
|
138
|
+
- **Click coordinates** shown as label
|
|
139
|
+
|
|
140
|
+
### 3. Typing Animation (NEW)
|
|
141
|
+
```css
|
|
142
|
+
/* Green glow effect when typing into field */
|
|
143
|
+
@keyframes typingGlow {
|
|
144
|
+
0% { box-shadow: 0 0 5px rgba(34,197,94,0.3); }
|
|
145
|
+
50% { box-shadow: 0 0 15px rgba(34,197,94,0.5); }
|
|
146
|
+
100% { box-shadow: 0 0 5px rgba(34,197,94,0.3); }
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
- **Green glow** around input field while typing
|
|
150
|
+
- **Character-by-character** ghost text overlay
|
|
151
|
+
- Auto-fades after typing completes
|
|
152
|
+
|
|
153
|
+
### 4. Drag Path Animation (NEW)
|
|
154
|
+
```css
|
|
155
|
+
/* Red dotted arrow from start → end */
|
|
156
|
+
/* Arrow head at destination */
|
|
157
|
+
/* Dashed line animates along path */
|
|
158
|
+
@keyframes dragPath {
|
|
159
|
+
0% { stroke-dashoffset: 100; }
|
|
160
|
+
100% { stroke-dashoffset: 0; }
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
- **SVG arrow** from start to end position
|
|
164
|
+
- **Animated dashed line** drawing itself
|
|
165
|
+
- **Arrow head** at destination point
|
|
166
|
+
- **Coordinate labels** at start and end
|
|
167
|
+
|
|
168
|
+
### 5. Scroll Indicator (NEW)
|
|
169
|
+
```
|
|
170
|
+
↑ (scrolled up 3 ticks)
|
|
171
|
+
┌─────────────────┐
|
|
172
|
+
│ │
|
|
173
|
+
│ Page Content │
|
|
174
|
+
│ │
|
|
175
|
+
└─────────────────┘
|
|
176
|
+
↓ (scrolled down 3 ticks)
|
|
177
|
+
```
|
|
178
|
+
- **Arrow** showing scroll direction
|
|
179
|
+
- **Tick count** label
|
|
180
|
+
- Fades out after 1.5s
|
|
181
|
+
|
|
182
|
+
### 6. Element Index Labels (enhanced)
|
|
183
|
+
```
|
|
184
|
+
┌──────┐ ┌──────────┐ ┌───────┐
|
|
185
|
+
│ [1] │ │ [2] │ │ [3] │
|
|
186
|
+
│ Login│ │ Search → │ │ About │
|
|
187
|
+
└──────┘ └──────────┘ └───────┘
|
|
188
|
+
```
|
|
189
|
+
- **Numbered badges** on all interactive elements
|
|
190
|
+
- **Hover effect**: label expands to show element name
|
|
191
|
+
- **Click**: badge pulses to confirm
|
|
192
|
+
|
|
193
|
+
### 7. Screenshot Flash (NEW)
|
|
194
|
+
- **Brief white flash** on screen when screenshot taken
|
|
195
|
+
- **"📸"** indicator in corner
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## 🛡️ Smart Features
|
|
200
|
+
|
|
201
|
+
### 1. Auto-Wait for Elements
|
|
202
|
+
```javascript
|
|
203
|
+
// Before clicking, auto-wait for element to appear (5s timeout)
|
|
204
|
+
async function click(index) {
|
|
205
|
+
const el = await page.waitForSelector(`[data-ira-index="${index}"]`, { timeout: 5000 });
|
|
206
|
+
if (!el) throw new Error(`Element ${index} not found after 5s`);
|
|
207
|
+
// ... click
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### 2. Auto-Retry on Failure
|
|
212
|
+
```javascript
|
|
213
|
+
// Retry up to 3 times with exponential backoff
|
|
214
|
+
async function retryAction(action, maxRetries = 3) {
|
|
215
|
+
for (let i = 0; i < maxRetries; i++) {
|
|
216
|
+
try { return await action(); }
|
|
217
|
+
catch (e) {
|
|
218
|
+
if (i === maxRetries - 1) throw e;
|
|
219
|
+
await new Promise(r => setTimeout(r, 1000 * (i + 1)));
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### 3. Empty DOM Detection & Recovery
|
|
226
|
+
```javascript
|
|
227
|
+
// If page looks blank after navigation, wait + reload
|
|
228
|
+
async function navigateWithRecovery(url) {
|
|
229
|
+
await page.goto(url);
|
|
230
|
+
const content = await page.content();
|
|
231
|
+
if (content.length < 500) { // Too short = likely empty
|
|
232
|
+
await new Promise(r => setTimeout(r, 3000));
|
|
233
|
+
await page.reload();
|
|
234
|
+
// Wait up to 10s for real content
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### 4. Stealth Mode (Anti-Detection)
|
|
240
|
+
```javascript
|
|
241
|
+
// Override navigator properties to avoid bot detection
|
|
242
|
+
const puppeteer = require('puppeteer-extra');
|
|
243
|
+
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
|
|
244
|
+
puppeteer.use(StealthPlugin());
|
|
245
|
+
// Also:
|
|
246
|
+
// - Fake webdriver property
|
|
247
|
+
// - Override chrome detection
|
|
248
|
+
// - Randomize mouse movements
|
|
249
|
+
// - Add natural typing delays
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### 5. Smart Click (center-point calculation)
|
|
253
|
+
```javascript
|
|
254
|
+
// Always click in the CENTER of elements, not edges
|
|
255
|
+
async function smartClick(element) {
|
|
256
|
+
const box = await element.boundingBox();
|
|
257
|
+
const cx = box.x + box.width / 2;
|
|
258
|
+
const cy = box.y + box.height / 2;
|
|
259
|
+
// Add tiny random offset (±2px) for human-like feel
|
|
260
|
+
await page.mouse.click(cx + random(-2, 2), cy + random(-2, 2));
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### 6. Human-Like Typing
|
|
265
|
+
```javascript
|
|
266
|
+
// Type with random delays between characters
|
|
267
|
+
async function humanType(page, selector, text) {
|
|
268
|
+
for (const char of text) {
|
|
269
|
+
await page.keyboard.type(char, { delay: 30 + Math.random() * 70 });
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### 7. Page Health Monitor
|
|
275
|
+
```javascript
|
|
276
|
+
// Detect: loading, timeout, error pages, captcha
|
|
277
|
+
function detectPageHealth() {
|
|
278
|
+
// Check for common error indicators
|
|
279
|
+
const errorPatterns = ['403', '404', '500', 'captcha', 'blocked'];
|
|
280
|
+
// Check for loading indicators
|
|
281
|
+
const loadingPatterns = ['loading', 'spinner', 'skeleton'];
|
|
282
|
+
return { healthy, loading, error, errorType };
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## 🛠️ Developer Experience
|
|
289
|
+
|
|
290
|
+
### 1. Session Persistence
|
|
291
|
+
```javascript
|
|
292
|
+
// Save session (cookies, localStorage, page states) to disk
|
|
293
|
+
async function saveSession(path) {
|
|
294
|
+
const cookies = await page.cookies();
|
|
295
|
+
const storage = await page.evaluate(() => JSON.stringify(localStorage));
|
|
296
|
+
fs.writeFileSync(path, JSON.stringify({ cookies, storage }));
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// Restore session on restart
|
|
300
|
+
async function restoreSession(path) {
|
|
301
|
+
const data = JSON.parse(fs.readFileSync(path));
|
|
302
|
+
await page.setCookie(...data.cookies);
|
|
303
|
+
await page.evaluate((s) => localStorage = JSON.parse(s), data.storage);
|
|
304
|
+
}
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### 2. Auto-Recovery
|
|
308
|
+
```javascript
|
|
309
|
+
// If browser crashes, auto-restart
|
|
310
|
+
process.on('uncaughtException', async (err) => {
|
|
311
|
+
console.error('Crash detected, restarting browser...');
|
|
312
|
+
await browser.close();
|
|
313
|
+
browser = await puppeteer.launch({ ... });
|
|
314
|
+
});
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### 3. Better Error Messages
|
|
318
|
+
```javascript
|
|
319
|
+
// Context-aware error messages
|
|
320
|
+
function formatError(error, context) {
|
|
321
|
+
return {
|
|
322
|
+
error: error.message,
|
|
323
|
+
tool: context.tool,
|
|
324
|
+
suggestion: getSuggestion(error), // e.g., "Try scrolling down or check if element exists"
|
|
325
|
+
timestamp: new Date().toISOString(),
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### 4. Debug Logging
|
|
331
|
+
```javascript
|
|
332
|
+
// Verbose logging when IRA_DEBUG=true
|
|
333
|
+
if (process.env.IRA_DEBUG) {
|
|
334
|
+
console.log('[IRA-DEBUG]', action, params, result);
|
|
335
|
+
// Screenshot every step for debugging
|
|
336
|
+
await page.screenshot({ path: `debug/step-${step}.png` });
|
|
337
|
+
}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### 5. Proxy Support (with auto-rotation)
|
|
341
|
+
|
|
342
|
+
Single proxy:
|
|
343
|
+
```json
|
|
344
|
+
"env": {
|
|
345
|
+
"IRA_PROXY": "http://user:pass@proxy:8080"
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
**Auto-rotate from pool** (random each session):
|
|
350
|
+
```json
|
|
351
|
+
"env": {
|
|
352
|
+
"IRA_PROXY": "http://proxy1:8080,http://proxy2:8080,socks5://proxy3:1080",
|
|
353
|
+
"IRA_PROXY_ROTATE": "true"
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
- If `IRA_PROXY_ROTATE=true` → picks a **random proxy** from the comma-separated list on each browser launch
|
|
358
|
+
- If `IRA_PROXY_ROTATE=false` or omitted → uses the single proxy
|
|
359
|
+
- If `IRA_PROXY` is empty → **no proxy** (direct connection)
|
|
360
|
+
- Logs which proxy is active: `[IRA] Using proxy: http://proxy2:8080`
|
|
361
|
+
|
|
362
|
+
### 6. Cookie Manager Tool
|
|
363
|
+
```javascript
|
|
364
|
+
// Get all cookies for current domain
|
|
365
|
+
ira_cookies({ action: "get" })
|
|
366
|
+
// Set specific cookie
|
|
367
|
+
ira_cookies({ action: "set", name: "token", value: "abc" })
|
|
368
|
+
// Clear all cookies
|
|
369
|
+
ira_cookies({ action: "clear" })
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
## 📦 Dependencies (no LLM needed!)
|
|
375
|
+
|
|
376
|
+
```json
|
|
377
|
+
{
|
|
378
|
+
"dependencies": {
|
|
379
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
380
|
+
"puppeteer": "^23.0.0",
|
|
381
|
+
"puppeteer-extra": "^3.3.0",
|
|
382
|
+
"puppeteer-extra-plugin-stealth": "^2.11.0",
|
|
383
|
+
"zod": "^3.23.0"
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
```
|
|
387
|
+
> **Zero API keys required.** Pure browser automation. Cline/Claude Code provides the intelligence.
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
## 🏗️ File Structure
|
|
392
|
+
|
|
393
|
+
```
|
|
394
|
+
IRA-RESEARCHER/
|
|
395
|
+
│
|
|
396
|
+
├── src/ ← Source code
|
|
397
|
+
│ ├── index.js ← Entry point: starts MCP server
|
|
398
|
+
│ ├── server.js ← MCP server setup + tool registration
|
|
399
|
+
│ ├── browser.js ← Puppeteer browser launch + session
|
|
400
|
+
│ │
|
|
401
|
+
│ ├── tools/ ← Tool implementations (one file per category)
|
|
402
|
+
│ │ ├── navigation.js ← ira_navigate, go_back, go_forward, reload
|
|
403
|
+
│ │ ├── interaction.js ← ira_click, type, hover, drag, upload, select
|
|
404
|
+
│ │ ├── vision.js ← ira_screenshot, element_screenshot, extract_images
|
|
405
|
+
│ │ ├── reading.js ← ira_get_state, read_page, find, extract_text, get_html
|
|
406
|
+
│ │ ├── tabs.js ← ira_tabs, switch_tab, close_tab
|
|
407
|
+
│ │ ├── debug.js ← ira_console, network, javascript
|
|
408
|
+
│ │ ├── devtools.js ← ira_inspect_element, get_styles, performance, storage, network_timing, audit_accessibility
|
|
409
|
+
│ │ └── utility.js ← ira_wait, scroll, cookies
|
|
410
|
+
│ │
|
|
411
|
+
│ ├── ghost/ ← Ghost effects (injected into pages)
|
|
412
|
+
│ │ ├── panel.js ← Floating action panel (dark UI)
|
|
413
|
+
│ │ ├── ripple.js ← Click ripple animation (orange circle)
|
|
414
|
+
│ │ ├── typing.js ← Typing glow animation (green)
|
|
415
|
+
│ │ ├── drag.js ← Drag path SVG arrows
|
|
416
|
+
│ │ ├── scroll.js ← Scroll indicators
|
|
417
|
+
│ │ ├── labels.js ← Element index labels
|
|
418
|
+
│ │ ├── flash.js ← Screenshot flash effect
|
|
419
|
+
│ │ └── index.js ← Combines all ghost scripts into one
|
|
420
|
+
│ │
|
|
421
|
+
│ ├── stealth.js ← Anti-detection (puppeteer-extra)
|
|
422
|
+
│ └── utils.js ← Shared utilities (retry, wait, format)
|
|
423
|
+
│
|
|
424
|
+
├── package.json ← Dependencies
|
|
425
|
+
├── install.ps1 ← Windows one-click install
|
|
426
|
+
├── install.sh ← Mac/Linux one-click install
|
|
427
|
+
├── README.md ← Usage docs + examples
|
|
428
|
+
├── PLAN.md ← This file
|
|
429
|
+
├── comparison-analysis.md ← Analysis of all 4 browser MCPs
|
|
430
|
+
└── debug/ ← Debug screenshots (when IRA_DEBUG=true)
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
### File sizes (estimated)
|
|
434
|
+
| File | Lines | Purpose |
|
|
435
|
+
|---|---|---|
|
|
436
|
+
| `src/index.js` | 30 | Entry point |
|
|
437
|
+
| `src/server.js` | 150 | MCP tool registration |
|
|
438
|
+
| `src/browser.js` | 200 | Puppeteer + stealth launch |
|
|
439
|
+
| `src/tools/navigation.js` | 120 | 4 navigation tools |
|
|
440
|
+
| `src/tools/interaction.js` | 200 | 6 interaction tools |
|
|
441
|
+
| `src/tools/vision.js` | 150 | 3 vision tools |
|
|
442
|
+
| `src/tools/reading.js` | 180 | 5 reading tools |
|
|
443
|
+
| `src/tools/tabs.js` | 100 | 3 tab tools |
|
|
444
|
+
| `src/tools/debug.js` | 100 | 3 debug tools |
|
|
445
|
+
| `src/tools/devtools.js` | 250 | 6 DevTools tools |
|
|
446
|
+
| `src/tools/utility.js` | 80 | 3 utility tools |
|
|
447
|
+
| `src/ghost/*.js` | 400 | 7 ghost effects |
|
|
448
|
+
| `src/stealth.js` | 80 | Anti-detection |
|
|
449
|
+
| `src/utils.js` | 60 | Shared helpers |
|
|
450
|
+
| **Total** | **~2,100** | **32 tools + 7 ghost effects** |
|
|
451
|
+
|
|
452
|
+
---
|
|
453
|
+
|
|
454
|
+
## 🔧 Implementation Phases
|
|
455
|
+
|
|
456
|
+
### Phase 1 — Core
|
|
457
|
+
- `server.js` with MCP server + Puppeteer
|
|
458
|
+
- 5 basic tools: navigate, click, type, screenshot, get_state
|
|
459
|
+
- Basic ghost panel
|
|
460
|
+
|
|
461
|
+
### Phase 2 — Full Tools
|
|
462
|
+
- All 25 tools
|
|
463
|
+
- Tab management
|
|
464
|
+
- Debug tools (console, network)
|
|
465
|
+
- Form tools (select, upload, cookies)
|
|
466
|
+
|
|
467
|
+
### Phase 3 — Ghost v2.0
|
|
468
|
+
- Enhanced floating panel with counter
|
|
469
|
+
- Click ripple animation
|
|
470
|
+
- Typing animation (green glow)
|
|
471
|
+
- Drag path arrows
|
|
472
|
+
- Scroll indicators
|
|
473
|
+
- Element index labels
|
|
474
|
+
- Screenshot flash
|
|
475
|
+
|
|
476
|
+
### Phase 4 — Smart Features
|
|
477
|
+
- Auto-wait for elements
|
|
478
|
+
- Auto-retry (3 attempts)
|
|
479
|
+
- Empty DOM recovery
|
|
480
|
+
- Stealth mode (puppeteer-extra)
|
|
481
|
+
- Human-like typing
|
|
482
|
+
- Page health monitoring
|
|
483
|
+
|
|
484
|
+
### Phase 5 — Developer Experience
|
|
485
|
+
- Session persistence
|
|
486
|
+
- Auto-recovery on crash
|
|
487
|
+
- Better error messages
|
|
488
|
+
- Debug logging
|
|
489
|
+
- Proxy support
|
|
490
|
+
- README + install scripts
|
|
491
|
+
|
|
492
|
+
---
|
|
493
|
+
|
|
494
|
+
## 📊 Comparison: IRA-RESEARCHER vs Others
|
|
495
|
+
|
|
496
|
+
| Feature | Claude-in-Chrome | browser-use | **IRA-RESEARCHER** |
|
|
497
|
+
|---|---|---|---|
|
|
498
|
+
| Setup complexity | Hard (extension+host+config) | Medium (pip+key) | **Easy (npm + 2 lines)** |
|
|
499
|
+
| Language | JavaScript | Python | **JavaScript** |
|
|
500
|
+
| Browser launch | Manual | Auto | **Auto** |
|
|
501
|
+
| Tools count | 18 | 14 | **25** |
|
|
502
|
+
| Ghost panel | None | Yes (922 lines) | **Yes (enhanced v2)** |
|
|
503
|
+
| Click ripple | None | Yes (basic) | **Yes (animated ring)** |
|
|
504
|
+
| Typing animation | None | None | **Yes (green glow)** |
|
|
505
|
+
| Drag arrows | None | None | **Yes (SVG arrow)** |
|
|
506
|
+
| Scroll indicator | None | None | **Yes** |
|
|
507
|
+
| Action counter | None | None | **Yes** |
|
|
508
|
+
| Auto-wait | None | Yes | **Yes** |
|
|
509
|
+
| Auto-retry | None | Yes | **Yes** |
|
|
510
|
+
| Stealth/anti-detect | None | Cloud only | **puppeteer-extra** |
|
|
511
|
+
| Human-like typing | None | None | **Yes (random delays)** |
|
|
512
|
+
| Session persistence | None | Yes | **Yes** |
|
|
513
|
+
| Proxy support | None | Yes | **Yes** |
|
|
514
|
+
| Debug logging | None | Yes | **Yes** |
|
|
515
|
+
| Empty DOM recovery | None | Yes | **Yes** |
|
|
516
|
+
| Page health check | None | None | **Yes** |
|
|
517
|
+
| Cookie manager | None | None | **Yes** |
|
|
518
|
+
| Dependencies | Chrome+Node | Python+20+pkgs | **Node+3 pkgs** |
|
|
519
|
+
|
|
520
|
+
---
|
|
521
|
+
|
|
522
|
+
## ✅ Master Checklist
|
|
523
|
+
|
|
524
|
+
- [ ] `package.json`
|
|
525
|
+
- [ ] `server.js` — MCP server skeleton + Puppeteer
|
|
526
|
+
- [ ] `ghost-effects.js` — All ghost animations
|
|
527
|
+
- [ ] `stealth.js` — Anti-detection
|
|
528
|
+
- [ ] Navigation tools: navigate, go_back, go_forward, reload
|
|
529
|
+
- [ ] Interaction tools: click, type, hover, drag, upload, select
|
|
530
|
+
- [ ] Reading tools: screenshot, get_state, read_page, find, extract_text, get_html
|
|
531
|
+
- [ ] Tab tools: tabs, switch_tab, close_tab
|
|
532
|
+
- [ ] Debug tools: console, network, javascript
|
|
533
|
+
- [ ] Utility tools: wait, scroll, cookies
|
|
534
|
+
- [ ] Ghost: floating panel with counter
|
|
535
|
+
- [ ] Ghost: click ripple animation
|
|
536
|
+
- [ ] Ghost: typing glow animation
|
|
537
|
+
- [ ] Ghost: drag path SVG arrows
|
|
538
|
+
- [ ] Ghost: scroll indicators
|
|
539
|
+
- [ ] Ghost: element index labels
|
|
540
|
+
- [ ] Ghost: screenshot flash
|
|
541
|
+
- [ ] Smart: auto-wait for elements
|
|
542
|
+
- [ ] Smart: auto-retry with backoff
|
|
543
|
+
- [ ] Smart: empty DOM recovery
|
|
544
|
+
- [ ] Smart: stealth mode
|
|
545
|
+
- [ ] Smart: human-like typing
|
|
546
|
+
- [ ] Smart: page health monitor
|
|
547
|
+
- [ ] DX: session persistence
|
|
548
|
+
- [ ] DX: auto-recovery
|
|
549
|
+
- [ ] DX: better error messages
|
|
550
|
+
- [ ] DX: debug logging
|
|
551
|
+
- [ ] DX: proxy support
|
|
552
|
+
- [ ] `install.ps1` + `install.sh`
|
|
553
|
+
- [ ] `README.md`
|
|
554
|
+
- [ ] Test with Cline
|