chrometools-mcp 3.1.7 → 3.2.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.
- package/CHANGELOG.md +88 -0
- package/README.md +157 -108
- package/README.ru.md +331 -0
- package/chrome-extension.zip +0 -0
- package/docs/extension-developer-mode.png +0 -0
- package/docs/extension-installed.png +0 -0
- package/index.js +95 -44
- package/package.json +1 -1
- package/pom/apom-tree-converter.js +302 -39
- package/server/tool-definitions.js +23 -30
- package/server/tool-schemas.js +5 -6
- package/test-interactivity.html +178 -0
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ MCP server for Chrome automation using Puppeteer with persistent browser session
|
|
|
9
9
|
The easiest way to install for Claude Code users:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
claude mcp add chrometools -- npx
|
|
12
|
+
claude mcp add chrometools -- npx chrometools-mcp
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
This command will automatically configure the MCP server in your Claude Code settings.
|
|
@@ -26,7 +26,7 @@ Add to your Claude Desktop configuration file:
|
|
|
26
26
|
"mcpServers": {
|
|
27
27
|
"chrometools": {
|
|
28
28
|
"command": "npx",
|
|
29
|
-
"args": ["
|
|
29
|
+
"args": ["chrometools-mcp"]
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -47,7 +47,7 @@ Add to your Claude Desktop configuration file:
|
|
|
47
47
|
"mcpServers": {
|
|
48
48
|
"chrometools": {
|
|
49
49
|
"command": "npx",
|
|
50
|
-
"args": ["
|
|
50
|
+
"args": ["chrometools-mcp"]
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -64,7 +64,7 @@ Add to your Claude Desktop configuration file:
|
|
|
64
64
|
},
|
|
65
65
|
"chrometools": {
|
|
66
66
|
"command": "npx",
|
|
67
|
-
"args": ["
|
|
67
|
+
"args": ["chrometools-mcp"]
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -99,7 +99,7 @@ Add to your Claude Desktop configuration file:
|
|
|
99
99
|
"mcpServers": {
|
|
100
100
|
"chrometools": {
|
|
101
101
|
"command": "npx",
|
|
102
|
-
"args": ["
|
|
102
|
+
"args": ["chrometools-mcp"]
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -118,7 +118,7 @@ For Cline, Continue, or other MCP-compatible clients, add to your MCP configurat
|
|
|
118
118
|
"mcpServers": {
|
|
119
119
|
"chrometools": {
|
|
120
120
|
"command": "npx",
|
|
121
|
-
"args": ["
|
|
121
|
+
"args": ["chrometools-mcp"]
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
}
|
|
@@ -129,26 +129,85 @@ For Cline, Continue, or other MCP-compatible clients, add to your MCP configurat
|
|
|
129
129
|
You can also run directly without configuration:
|
|
130
130
|
|
|
131
131
|
```bash
|
|
132
|
-
npx
|
|
132
|
+
npx chrometools-mcp
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
+
### Chrome Extension Setup
|
|
136
|
+
|
|
137
|
+
The Chrome Extension is **required** for scenario recording and other advanced features. Follow these steps to install it:
|
|
138
|
+
|
|
139
|
+
**Important:** ChromeTools opens Chrome with a separate user profile, so you must install the extension **after** ChromeTools starts Chrome for the first time.
|
|
140
|
+
|
|
141
|
+
**Step 1:** Start ChromeTools MCP server first
|
|
142
|
+
- Make sure ChromeTools is running through your MCP client (Claude Desktop, Cursor, etc.)
|
|
143
|
+
- Or run it manually: `npx chrometools-mcp`
|
|
144
|
+
- This will launch Chrome with ChromeTools' isolated profile
|
|
145
|
+
|
|
146
|
+
**Step 2:** Enable Developer Mode in Chrome
|
|
147
|
+
- Open Chrome Extensions page: `chrome://extensions`
|
|
148
|
+
- Toggle **Developer mode** (switch in top-right corner)
|
|
149
|
+
|
|
150
|
+

|
|
151
|
+
|
|
152
|
+
**Step 3:** Download and Extract the Extension
|
|
153
|
+
|
|
154
|
+
**Option A - Download from GitHub (Recommended):**
|
|
155
|
+
1. Download the extension archive: [chrome-extension.zip](https://github.com/modelcontextprotocol/servers/raw/main/src/chrometools/chrome-extension.zip)
|
|
156
|
+
2. Extract the ZIP file to a folder on your computer
|
|
157
|
+
3. Remember the extraction path (you'll need it in the next step)
|
|
158
|
+
|
|
159
|
+
**Option B - Use from node_modules (if you know the path):**
|
|
160
|
+
- **After npx install:** `~/.npm/_npx/.../node_modules/chrometools-mcp/extension`
|
|
161
|
+
- **After global install:** `<npm-global-path>/node_modules/chrometools-mcp/extension`
|
|
162
|
+
- **From source:** `<repo-path>/extension`
|
|
163
|
+
|
|
164
|
+
**Step 4:** Load the Extension
|
|
165
|
+
- Click **"Load unpacked"** button
|
|
166
|
+
- Navigate to the extracted extension folder (from Step 3)
|
|
167
|
+
- Select the folder and click **"Select Folder"**
|
|
168
|
+
|
|
169
|
+
**Step 5:** Verify Installation
|
|
170
|
+
- You should see "ChromeTools MCP" extension appear in your extensions list with:
|
|
171
|
+
- **Name:** ChromeTools MCP
|
|
172
|
+
- **Version:** (current version)
|
|
173
|
+
- **Description:** MCP server integration for Chrome automation
|
|
174
|
+
- **Status:** Toggle should be ON (blue)
|
|
175
|
+
- Look for the ChromeTools icon (CT) in your Chrome toolbar
|
|
176
|
+
- The extension is now ready to use for scenario recording
|
|
177
|
+
|
|
178
|
+

|
|
179
|
+
|
|
180
|
+
> **Note:** After installation, the extension card will appear on the `chrome://extensions` page alongside other installed extensions. The extension should show as "Enabled" with a blue toggle switch.
|
|
181
|
+
|
|
182
|
+
**Step 6:** Pin the Extension (Optional but Recommended)
|
|
183
|
+
- Click the puzzle piece icon in Chrome toolbar
|
|
184
|
+
- Find "ChromeTools MCP" in the list
|
|
185
|
+
- Click the pin icon to keep it visible in toolbar
|
|
186
|
+
|
|
187
|
+
**Troubleshooting:**
|
|
188
|
+
- **Recommended:** Use Option A (download from GitHub) to avoid searching in node_modules
|
|
189
|
+
- If using Option B and can't find the extension folder after `npx` install, run `npm list -g chrometools-mcp` to find the installation path
|
|
190
|
+
- The extension only works with Chrome instances launched by ChromeTools
|
|
191
|
+
- If Chrome closes and reopens, the extension should still be loaded (developer mode persists)
|
|
192
|
+
- When ChromeTools first opens Chrome, it automatically shows a prompt with the extension path in node_modules
|
|
193
|
+
|
|
135
194
|
## Table of Contents
|
|
136
195
|
|
|
137
196
|
- [Installation](#installation)
|
|
138
|
-
- [
|
|
139
|
-
- [Scenario Recorder](#scenario-recorder)
|
|
197
|
+
- [Chrome Extension Setup](#chrome-extension-setup)
|
|
198
|
+
- [AI Optimization Features](#ai-optimization-features)- [Scenario Recorder](#scenario-recorder) - Visual UI-based recording with smart optimization
|
|
140
199
|
- [Available Tools](#available-tools) - **46+ Tools Total**
|
|
141
|
-
- [AI-Powered Tools](#ai-powered-tools)
|
|
200
|
+
- [AI-Powered Tools](#ai-powered-tools) - smartFindElement, analyzePage, getElementDetails, getAllInteractiveElements, findElementsByText
|
|
142
201
|
- [Core Tools](#1-core-tools) - ping, openBrowser
|
|
143
202
|
- [Interaction Tools](#2-interaction-tools) - click, type, scrollTo, selectOption, selectFromGroup, drag, scrollHorizontal
|
|
144
203
|
- [Inspection Tools](#3-inspection-tools) - getElement, getComputedCss, getBoxModel, screenshot
|
|
145
204
|
- [Advanced Tools](#4-advanced-tools) - executeScript, getConsoleLogs, listNetworkRequests, getNetworkRequest, filterNetworkRequests, hover, setStyles, setViewport, getViewport, navigateTo
|
|
146
|
-
- [Tab Management Tools](#5-tab-management-tools)
|
|
147
|
-
- [Recorder Tools](#7-recorder-tools)
|
|
205
|
+
- [Tab Management Tools](#5-tab-management-tools) - listTabs, switchTab
|
|
206
|
+
- [Recorder Tools](#7-recorder-tools) - enableRecorder, executeScenario, listScenarios, searchScenarios, getScenarioInfo, deleteScenario, exportScenarioAsCode, appendScenarioToFile, generatePageObject
|
|
148
207
|
- [Typical Workflow Example](#typical-workflow-example)
|
|
149
208
|
- [Tool Usage Tips](#tool-usage-tips)
|
|
150
209
|
- [Configuration](#configuration)
|
|
151
|
-
- [Multi-Instance Support](#multi-instance-support)
|
|
210
|
+
- [Multi-Instance Support](#multi-instance-support) - Run multiple MCP servers simultaneously
|
|
152
211
|
- [WSL Setup Guide](#wsl-setup-guide) → [Full WSL Guide](WSL_SETUP.md)
|
|
153
212
|
- [Development](#development)
|
|
154
213
|
- [Features](#features)
|
|
@@ -156,7 +215,7 @@ npx -y chrometools-mcp
|
|
|
156
215
|
|
|
157
216
|
## AI Optimization Features
|
|
158
217
|
|
|
159
|
-
|
|
218
|
+
: Dramatically reduce AI agent request cycles with intelligent element finding and page analysis.
|
|
160
219
|
|
|
161
220
|
### Why This Matters
|
|
162
221
|
|
|
@@ -192,22 +251,17 @@ AI: smartFindElement("login button")
|
|
|
192
251
|
|
|
193
252
|
## Scenario Recorder
|
|
194
253
|
|
|
195
|
-
|
|
254
|
+
: Visual UI-based recorder for creating reusable test scenarios with automatic secret detection.
|
|
196
255
|
|
|
197
256
|
### Features
|
|
198
257
|
|
|
199
258
|
- **Visual Widget** - Floating recorder UI with compact mode (50x50px minimize button)
|
|
200
|
-
- **Auto-Reinjection** - Recorder persists across page reloads/navigation automatically with duplicate prevention
|
|
201
|
-
- **Smart Click Detection** - Finds actual clickable parent elements with event listeners ⭐ **NEW**
|
|
202
|
-
- **Smart Waiters** - 2s minimum + animation/network/DOM change detection after clicks ⭐ **NEW**
|
|
203
|
-
- **Detailed Error Reports** - Comprehensive failure analysis with context and suggestions ⭐ **NEW**
|
|
204
|
-
- **Smart Recording** - Captures clicks, typing, navigation with intelligent optimization
|
|
259
|
+
- **Auto-Reinjection** - Recorder persists across page reloads/navigation automatically with duplicate prevention - **Smart Click Detection** - Finds actual clickable parent elements with event listeners- **Smart Waiters** - 2s minimum + animation/network/DOM change detection after clicks- **Detailed Error Reports** - Comprehensive failure analysis with context and suggestions- **Smart Recording** - Captures clicks, typing, navigation with intelligent optimization
|
|
205
260
|
- **Secret Detection** - Auto-detects passwords/emails and stores them securely
|
|
206
261
|
- **Action Optimization** - Combines sequential actions, removes duplicates
|
|
207
262
|
- **Scenario Management** - Save, load, execute, search, and delete scenarios
|
|
208
263
|
- **Dependencies** - Chain scenarios together with dependency resolution
|
|
209
|
-
- **Multi-Instance Protection** - Prevents multiple recorder instances from interfering
|
|
210
|
-
|
|
264
|
+
- **Multi-Instance Protection** - Prevents multiple recorder instances from interfering
|
|
211
265
|
### Quick Start
|
|
212
266
|
|
|
213
267
|
```javascript
|
|
@@ -258,8 +312,7 @@ executeScenario({ name: "login_flow", parameters: { email: "user@test.com" } })
|
|
|
258
312
|
|
|
259
313
|
### AI-Powered Tools
|
|
260
314
|
|
|
261
|
-
####
|
|
262
|
-
Find elements using natural language descriptions instead of CSS selectors.
|
|
315
|
+
#### smartFindElementFind elements using natural language descriptions instead of CSS selectors.
|
|
263
316
|
- **Parameters**:
|
|
264
317
|
- `description` (required): Natural language (e.g., "login button", "email field")
|
|
265
318
|
- `maxResults` (optional): Max candidates to return (default: 5)
|
|
@@ -283,9 +336,22 @@ Find elements using natural language descriptions instead of CSS selectors.
|
|
|
283
336
|
}
|
|
284
337
|
```
|
|
285
338
|
|
|
286
|
-
#### analyzePage
|
|
287
|
-
|
|
288
|
-
|
|
339
|
+
#### analyzePage Get current page state and structure. Returns complete map of forms (with values), inputs, buttons, links with selectors.
|
|
340
|
+
|
|
341
|
+
**Interactivity Detection**:
|
|
342
|
+
- Detects interactive elements via **8 different methods**:
|
|
343
|
+
1. Native HTML tags (`button`, `a`, `input`, `select`, `textarea`)
|
|
344
|
+
2. ARIA roles (`button`, `link`, `checkbox`, etc.)
|
|
345
|
+
3. `onclick` attribute
|
|
346
|
+
4. `onclick` property (set via JavaScript)
|
|
347
|
+
5. CSS `cursor: pointer`
|
|
348
|
+
6. JavaScript `addEventListener('click')`
|
|
349
|
+
7. `tabindex` attribute (except -1)
|
|
350
|
+
8. `contenteditable="true"`
|
|
351
|
+
- **Captures DIV/SPAN with click handlers** - JavaScript-enabled elements are detected
|
|
352
|
+
- Adds `interactivityReason` metadata showing detection method (e.g., `cursor-pointer`, `event-listener`)
|
|
353
|
+
|
|
354
|
+
**When to use**:
|
|
289
355
|
- After opening/navigating to page (initial analysis)
|
|
290
356
|
- **After clicking buttons** (see what changed)
|
|
291
357
|
- **After form submissions** (check results, errors)
|
|
@@ -295,18 +361,13 @@ Get current page state and structure. Returns complete map of forms (with values
|
|
|
295
361
|
- **Parameters**:
|
|
296
362
|
- `refresh` (optional): Force refresh cache to get CURRENT state after changes (default: false)
|
|
297
363
|
- `includeAll` (optional): Include ALL page elements, not just interactive ones (default: false). Useful for layout work - find any element, get its selector, then use `getComputedCss` or `setStyles` on it.
|
|
298
|
-
- `useLegacyFormat` (optional): Return legacy format instead of APOM (default: false -
|
|
299
|
-
- `registerElements` (optional): Auto-register elements for ID-based usage (default: true)
|
|
300
|
-
- `groupBy` (optional): 'type' or 'flat' - how to group elements (default: 'type') ⭐ **APOM**
|
|
301
|
-
- **Why better than screenshot**:
|
|
364
|
+
- `useLegacyFormat` (optional): Return legacy format instead of APOM (default: false - APOM is the default)
|
|
365
|
+
- `registerElements` (optional): Auto-register elements for ID-based usage (default: true) - `groupBy` (optional): 'type' or 'flat' - how to group elements (default: 'type') - **Why better than screenshot**:
|
|
302
366
|
- Shows actual data (form values, validation errors) not just visual
|
|
303
367
|
- Uses 2-5k tokens vs screenshot 15-25k tokens
|
|
304
368
|
- Returns structured data with **unique element IDs** for easy interaction
|
|
305
|
-
- **Detects UI frameworks** (MUI, Ant Design, Chakra, Bootstrap, Vuetify, Semantic UI)
|
|
306
|
-
- **
|
|
307
|
-
- **Returns**:
|
|
308
|
-
- **APOM format** (default): Tree-structured Page Object Model with unique IDs ⭐ **NOW DEFAULT**
|
|
309
|
-
- `tree` - Hierarchical tree of page elements (optimized: ~82% smaller than flat format)
|
|
369
|
+
- **Detects UI frameworks** (MUI, Ant Design, Chakra, Bootstrap, Vuetify, Semantic UI) - **Extracts dropdown options** from both native `<select>` and custom UI components- **Returns**:
|
|
370
|
+
- **APOM format** (default): Tree-structured Page Object Model with unique IDs - `tree` - Hierarchical tree of page elements (optimized: ~82% smaller than flat format)
|
|
310
371
|
- Each node: `{ tag, id?, type?, sel, ch?, bounds?, meta? }`
|
|
311
372
|
- Interactive elements have `bounds` and full metadata
|
|
312
373
|
- Parent containers have minimal info (position only)
|
|
@@ -315,12 +376,10 @@ Get current page state and structure. Returns complete map of forms (with values
|
|
|
315
376
|
- Elements automatically registered - use IDs with `click({ id: "..." })`, `type({ id: "..." })`, etc.
|
|
316
377
|
- **Token-optimized**: Minified JSON, simplified parents, no redundant data
|
|
317
378
|
- Example: `analyzePage()` returns APOM, then use `click({ id: "button_45" })` or `type({ id: "input_20", text: "..." })`
|
|
318
|
-
- **Use `
|
|
379
|
+
- **Use `getElementDetails({ id: "input_20" })`** to get full details for any element, or with `analyzeChildren: true` to get children tree structure
|
|
319
380
|
- **Legacy format** (`useLegacyFormat: true`): Classic format for backward compatibility
|
|
320
381
|
- Complete map of forms (with current values), inputs, buttons, links, navigation with selectors
|
|
321
|
-
- **Each element includes `uiFramework` info** (name, version, component type)
|
|
322
|
-
- **Select elements include `options` array** with value, text, index, selected, disabled, group ⭐
|
|
323
|
-
- With `includeAll: true`: Also includes `allElements` array with ALL visible page elements (divs, spans, headings, etc.) - each with selector, tag, text, classes, id
|
|
382
|
+
- **Each element includes `uiFramework` info** (name, version, component type) - **Select elements include `options` array** with value, text, index, selected, disabled, group - With `includeAll: true`: Also includes `allElements` array with ALL visible page elements (divs, spans, headings, etc.) - each with selector, tag, text, classes, id
|
|
324
383
|
- **Example workflow**:
|
|
325
384
|
1. `openBrowser({ url: "..." })`
|
|
326
385
|
2. `analyzePage()` ← Initial analysis, returns elements with IDs
|
|
@@ -333,26 +392,31 @@ Get current page state and structure. Returns complete map of forms (with values
|
|
|
333
392
|
3. `getComputedCss({ selector: "div.header" })` ← Get current styles
|
|
334
393
|
4. `setStyles({ selector: "div.header", styles: [...] })` ← Apply new styles
|
|
335
394
|
|
|
336
|
-
####
|
|
337
|
-
Get detailed information about a specific element by its APOM ID from `analyzePage`. Use this to inspect elements without re-analyzing the entire page.
|
|
395
|
+
#### getElementDetailsGet comprehensive details about a specific element by its APOM ID. Can optionally analyze children elements tree structure. Use when `analyzePage` output is simplified and you need complete element information or want to focus analysis on a specific section.
|
|
338
396
|
- **Parameters**:
|
|
339
397
|
- `id` (required): APOM element ID (e.g., `"input_20"`, `"button_45"`)
|
|
340
|
-
-
|
|
341
|
-
-
|
|
398
|
+
- `analyzeChildren` (optional): Analyze children elements tree structure (default: false)
|
|
399
|
+
- `includeAll` (optional): When analyzing children, include all elements, not just interactive ones (default: false)
|
|
400
|
+
- `refresh` (optional): Force refresh of cached analysis (default: false)
|
|
401
|
+
- **Use case**:
|
|
402
|
+
- Get full details including bounds, CSS selector, attributes, computed styles
|
|
403
|
+
- Focus analysis on specific section (modal, form, sidebar, etc.) with `analyzeChildren: true`
|
|
404
|
+
- **Returns**: Complete element details including:
|
|
342
405
|
- `id`: Element APOM ID
|
|
343
|
-
- `selector`: CSS selector
|
|
406
|
+
- `selector`: CSS selector for the element
|
|
344
407
|
- `tag`: HTML tag name
|
|
345
|
-
- `type`:
|
|
408
|
+
- `type`: Element type (input, button, link, etc.)
|
|
346
409
|
- `text`: Visible text content
|
|
347
|
-
- `bounds`: `{ x, y, width, height
|
|
348
|
-
- `attributes`: All HTML attributes
|
|
349
|
-
- `
|
|
350
|
-
- `
|
|
351
|
-
- `
|
|
410
|
+
- `bounds`: Position and size `{ x, y, width, height, top, right, bottom, left }`
|
|
411
|
+
- `attributes`: All HTML attributes (id, class, name, placeholder, href, etc.)
|
|
412
|
+
- `computed`: Key CSS properties (display, visibility, cursor, color, fontSize, etc.)
|
|
413
|
+
- `metadata`: Element metadata from APOM analysis
|
|
414
|
+
- `visible`: Whether element is visible
|
|
415
|
+
- `childrenTree` (optional): APOM tree structure of children elements when `analyzeChildren: true`
|
|
352
416
|
- **Example**:
|
|
353
417
|
```javascript
|
|
354
|
-
// Get details for specific input field
|
|
355
|
-
|
|
418
|
+
// Get complete details for specific input field
|
|
419
|
+
getElementDetails({ id: "input_20" })
|
|
356
420
|
|
|
357
421
|
// Returns:
|
|
358
422
|
{
|
|
@@ -362,12 +426,16 @@ Get detailed information about a specific element by its APOM ID from `analyzePa
|
|
|
362
426
|
"tag": "input",
|
|
363
427
|
"type": "email",
|
|
364
428
|
"text": "",
|
|
365
|
-
"bounds": { "x": 100, "y": 200, "width": 300, "height": 40 },
|
|
366
|
-
"attributes": { "name": "email", "placeholder": "Enter email" },
|
|
367
|
-
"
|
|
368
|
-
"
|
|
369
|
-
"isEnabled": true
|
|
429
|
+
"bounds": { "x": 100, "y": 200, "width": 300, "height": 40, "top": 200, "right": 400, "bottom": 240, "left": 100 },
|
|
430
|
+
"attributes": { "name": "email", "placeholder": "Enter email", "type": "email" },
|
|
431
|
+
"computed": { "display": "block", "visibility": "visible", "cursor": "text" },
|
|
432
|
+
"visible": true
|
|
370
433
|
}
|
|
434
|
+
|
|
435
|
+
// Analyze modal contents after opening it
|
|
436
|
+
analyzePage() // Get initial page structure
|
|
437
|
+
click({ id: "button_45" }) // Open modal
|
|
438
|
+
getElementDetails({ id: "container_123", analyzeChildren: true, refresh: true }) // Analyze modal contents with children tree
|
|
371
439
|
```
|
|
372
440
|
|
|
373
441
|
#### getAllInteractiveElements
|
|
@@ -471,8 +539,7 @@ Select option in dropdown (HTML select elements). **PREFERRED**: Use APOM ID fro
|
|
|
471
539
|
selectOption({ selector: "select[name='country']", text: "United States" })
|
|
472
540
|
```
|
|
473
541
|
|
|
474
|
-
####
|
|
475
|
-
Select option(s) from radio or checkbox group by name attribute. Works at abstract group level instead of individual clicks.
|
|
542
|
+
#### selectFromGroupSelect option(s) from radio or checkbox group by name attribute. Works at abstract group level instead of individual clicks.
|
|
476
543
|
- **Parameters**:
|
|
477
544
|
- `name` (required): Name attribute of the radio/checkbox group (e.g., 'size', 'toppings')
|
|
478
545
|
- `value` (optional): Single value to select (for radio or single checkbox)
|
|
@@ -695,8 +762,7 @@ Navigate to different URL while keeping browser instance.
|
|
|
695
762
|
- **Use case**: Moving between pages in workflow
|
|
696
763
|
- **Returns**: New page title
|
|
697
764
|
|
|
698
|
-
### 5. Tab Management Tools
|
|
699
|
-
|
|
765
|
+
### 5. Tab Management Tools
|
|
700
766
|
Tools for managing multiple browser tabs. New tabs opened via `window.open()`, `target="_blank"`, or user actions are automatically detected and tracked.
|
|
701
767
|
|
|
702
768
|
#### listTabs
|
|
@@ -737,12 +803,10 @@ switchTab({ tab: 0 })
|
|
|
737
803
|
switchTab({ tab: "google.com" })
|
|
738
804
|
```
|
|
739
805
|
|
|
740
|
-
### 6. Figma Tools
|
|
741
|
-
|
|
806
|
+
### 6. Figma Tools
|
|
742
807
|
Design-to-code validation, file browsing, design system extraction, and comparison tools with automatic 3 MB compression.
|
|
743
808
|
|
|
744
|
-
#### parseFigmaUrl
|
|
745
|
-
Parse Figma URL to extract fileKey and nodeId automatically.
|
|
809
|
+
#### parseFigmaUrl Parse Figma URL to extract fileKey and nodeId automatically.
|
|
746
810
|
- **Parameters**:
|
|
747
811
|
- `url` (required): Full Figma URL or just fileKey
|
|
748
812
|
- **Supported formats**:
|
|
@@ -752,8 +816,7 @@ Parse Figma URL to extract fileKey and nodeId automatically.
|
|
|
752
816
|
- **Use case**: No need to manually extract fileKey and nodeId from URLs
|
|
753
817
|
- **Returns**: `{ fileKey, nodeId }` object
|
|
754
818
|
|
|
755
|
-
#### listFigmaPages
|
|
756
|
-
Browse entire Figma file structure: all pages and frames with IDs.
|
|
819
|
+
#### listFigmaPages Browse entire Figma file structure: all pages and frames with IDs.
|
|
757
820
|
- **Parameters**:
|
|
758
821
|
- `figmaToken` (optional): Figma API token
|
|
759
822
|
- `fileKey` (required): Figma file key or full URL
|
|
@@ -779,8 +842,7 @@ Browse entire Figma file structure: all pages and frames with IDs.
|
|
|
779
842
|
}
|
|
780
843
|
```
|
|
781
844
|
|
|
782
|
-
#### searchFigmaFrames
|
|
783
|
-
Search frames/components by name across entire Figma file.
|
|
845
|
+
#### searchFigmaFrames Search frames/components by name across entire Figma file.
|
|
784
846
|
- **Parameters**:
|
|
785
847
|
- `figmaToken` (optional): Figma API token
|
|
786
848
|
- `fileKey` (required): Figma file key or full URL
|
|
@@ -789,16 +851,14 @@ Search frames/components by name across entire Figma file.
|
|
|
789
851
|
- **Returns**: All matching nodes with IDs, names, types, pages, dimensions
|
|
790
852
|
- **Example**: Search for "login" returns all frames containing "login" in name
|
|
791
853
|
|
|
792
|
-
#### getFigmaComponents
|
|
793
|
-
Extract all components from Figma file (Design System).
|
|
854
|
+
#### getFigmaComponents Extract all components from Figma file (Design System).
|
|
794
855
|
- **Parameters**:
|
|
795
856
|
- `figmaToken` (optional): Figma API token
|
|
796
857
|
- `fileKey` (required): Figma file key or full URL
|
|
797
858
|
- **Use case**: Get complete list of design system components
|
|
798
859
|
- **Returns**: All COMPONENT and COMPONENT_SET nodes with names, descriptions, dimensions
|
|
799
860
|
|
|
800
|
-
#### getFigmaStyles
|
|
801
|
-
Get all shared styles from Figma file (color, text, effect, grid styles).
|
|
861
|
+
#### getFigmaStyles Get all shared styles from Figma file (color, text, effect, grid styles).
|
|
802
862
|
- **Parameters**:
|
|
803
863
|
- `figmaToken` (optional): Figma API token
|
|
804
864
|
- `fileKey` (required): Figma file key or full URL
|
|
@@ -809,8 +869,7 @@ Get all shared styles from Figma file (color, text, effect, grid styles).
|
|
|
809
869
|
- Effect styles (shadows, blur)
|
|
810
870
|
- Grid styles
|
|
811
871
|
|
|
812
|
-
#### getFigmaColorPalette
|
|
813
|
-
Extract complete color palette with usage statistics.
|
|
872
|
+
#### getFigmaColorPalette Extract complete color palette with usage statistics.
|
|
814
873
|
- **Parameters**:
|
|
815
874
|
- `figmaToken` (optional): Figma API token
|
|
816
875
|
- `fileKey` (required): Figma file key or full URL
|
|
@@ -821,8 +880,7 @@ Extract complete color palette with usage statistics.
|
|
|
821
880
|
- Usage examples (where the color is used)
|
|
822
881
|
- Sorted by usage frequency
|
|
823
882
|
|
|
824
|
-
#### convertFigmaToCode
|
|
825
|
-
Convert Figma designs to React/Tailwind code with AI assistance.
|
|
883
|
+
#### convertFigmaToCode Convert Figma designs to React/Tailwind code with AI assistance.
|
|
826
884
|
- **Parameters**:
|
|
827
885
|
- `figmaToken` (optional): Figma API token
|
|
828
886
|
- `fileKey` (required): Figma file key
|
|
@@ -883,9 +941,8 @@ Extract detailed design specifications from Figma including text content, colors
|
|
|
883
941
|
- **Dimensions**: Width, height, x, y coordinates
|
|
884
942
|
- **Children**: Recursive tree with text extraction from all child elements
|
|
885
943
|
|
|
886
|
-
### 7. Recorder Tools
|
|
887
|
-
|
|
888
|
-
**URL-Based Storage (v2.1+)**: Scenarios are automatically organized by website domain in `~/.config/chrometools-mcp/projects/{domain}/scenarios/`.
|
|
944
|
+
### 7. Recorder Tools
|
|
945
|
+
**URL-Based Storage**: Scenarios are automatically organized by website domain in `~/.config/chrometools-mcp/projects/{domain}/scenarios/`.
|
|
889
946
|
|
|
890
947
|
**Automatic Domain Detection**: Project ID is extracted from the URL where recording starts:
|
|
891
948
|
- `https://www.google.com` → `google`
|
|
@@ -1028,8 +1085,7 @@ Delete a scenario and its associated secrets. Searches all projects to find the
|
|
|
1028
1085
|
- **Use case**: Clean up unused scenarios
|
|
1029
1086
|
- **Returns**: Success confirmation
|
|
1030
1087
|
|
|
1031
|
-
####
|
|
1032
|
-
Export recorded scenario as executable test code for creating a **NEW** test file. Automatically cleans unstable selectors (CSS Modules, styled-components, Emotion). Optionally generates Page Object class. Returns JSON with code and suggested filename - Claude Code will create the file. To add tests to **EXISTING** files, use `appendScenarioToFile` instead.
|
|
1088
|
+
#### exportScenarioAsCodeExport recorded scenario as executable test code for creating a **NEW** test file. Automatically cleans unstable selectors (CSS Modules, styled-components, Emotion). Optionally generates Page Object class. Returns JSON with code and suggested filename - Claude Code will create the file. To add tests to **EXISTING** files, use `appendScenarioToFile` instead.
|
|
1033
1089
|
|
|
1034
1090
|
- **Parameters**:
|
|
1035
1091
|
- `scenarioName` (required): Name of scenario to export
|
|
@@ -1097,7 +1153,7 @@ Export recorded scenario as executable test code for creating a **NEW** test fil
|
|
|
1097
1153
|
- Hash suffixes: `component_a1b2c3d` → removed
|
|
1098
1154
|
- Prefers stable selectors: `data-testid`, `role`, `aria-label`, semantic attributes
|
|
1099
1155
|
|
|
1100
|
-
#### appendScenarioToFile
|
|
1156
|
+
#### appendScenarioToFile
|
|
1101
1157
|
Append recorded scenario as test code to an **EXISTING** test file. Automatically cleans unstable selectors (CSS Modules, styled-components, Emotion). Optionally generates Page Object class. Returns JSON with test code (without imports) - Claude Code will read the file, append the test, and write back. To create **NEW** test files, use `exportScenarioAsCode` instead.
|
|
1102
1158
|
|
|
1103
1159
|
- **Parameters**:
|
|
@@ -1189,8 +1245,7 @@ Append recorded scenario as test code to an **EXISTING** test file. Automaticall
|
|
|
1189
1245
|
}
|
|
1190
1246
|
```
|
|
1191
1247
|
|
|
1192
|
-
####
|
|
1193
|
-
Generate Page Object Model (POM) class from current page structure. Analyzes page, extracts interactive elements, and generates framework-specific code with smart naming and helper methods.
|
|
1248
|
+
#### generatePageObjectGenerate Page Object Model (POM) class from current page structure. Analyzes page, extracts interactive elements, and generates framework-specific code with smart naming and helper methods.
|
|
1194
1249
|
|
|
1195
1250
|
- **Parameters**:
|
|
1196
1251
|
- `className` (optional): Page Object class name (auto-generated from page title/URL if not provided)
|
|
@@ -1303,7 +1358,7 @@ Add the MCP server to your MCP client configuration file:
|
|
|
1303
1358
|
"mcpServers": {
|
|
1304
1359
|
"chrometools": {
|
|
1305
1360
|
"command": "npx",
|
|
1306
|
-
"args": ["
|
|
1361
|
+
"args": ["chrometools-mcp"]
|
|
1307
1362
|
}
|
|
1308
1363
|
}
|
|
1309
1364
|
}
|
|
@@ -1317,7 +1372,7 @@ Add the MCP server to your MCP client configuration file:
|
|
|
1317
1372
|
"chrometools": {
|
|
1318
1373
|
"type": "stdio",
|
|
1319
1374
|
"command": "npx",
|
|
1320
|
-
"args": ["
|
|
1375
|
+
"args": ["chrometools-mcp"],
|
|
1321
1376
|
"env": {}
|
|
1322
1377
|
}
|
|
1323
1378
|
}
|
|
@@ -1361,7 +1416,7 @@ By default, all tools are enabled. You can selectively enable only specific tool
|
|
|
1361
1416
|
|
|
1362
1417
|
**Why filter tools?**
|
|
1363
1418
|
|
|
1364
|
-
Each tool definition is sent to the AI in every request, consuming context tokens.
|
|
1419
|
+
Each tool definition is sent to the AI in every request, consuming context tokens. Filtering tools can reduce token usage, improve focus, and lower API costs:
|
|
1365
1420
|
|
|
1366
1421
|
- **Save tokens:** Fewer tools = less context consumed per request
|
|
1367
1422
|
- **Reduce costs:** Lower token usage means lower API costs
|
|
@@ -1374,13 +1429,13 @@ Each tool definition is sent to the AI in every request, consuming context token
|
|
|
1374
1429
|
|-------|-------------|---------------|
|
|
1375
1430
|
| `core` | Basic tools | `ping`, `openBrowser` (2) |
|
|
1376
1431
|
| `interaction` | User interaction | `click`, `type`, `scrollTo`, `waitForElement`, `hover` (5) |
|
|
1377
|
-
| `inspection` | Page inspection | `
|
|
1432
|
+
| `inspection` | Page inspection | `getComputedCss`, `getBoxModel`, `screenshot`, `saveScreenshot` (4) |
|
|
1378
1433
|
| `debug` | Debugging & network | `getConsoleLogs`, `listNetworkRequests`, `getNetworkRequest`, `filterNetworkRequests` (4) |
|
|
1379
1434
|
| `advanced` | Advanced automation & AI | `executeScript`, `setStyles`, `setViewport`, `getViewport`, `navigateTo`, `smartFindElement`, `analyzePage`, `getAllInteractiveElements`, `findElementsByText` (9) |
|
|
1380
1435
|
| `recorder` | Scenario recording | `enableRecorder`, `executeScenario`, `listScenarios`, `searchScenarios`, `getScenarioInfo`, `deleteScenario`, `exportScenarioAsCode`, `appendScenarioToFile`, `generatePageObject` (9) |
|
|
1381
1436
|
| `figma` | Figma integration | `getFigmaFrame`, `compareFigmaToElement`, `getFigmaSpecs`, `parseFigmaUrl`, `listFigmaPages`, `searchFigmaFrames`, `getFigmaComponents`, `getFigmaStyles`, `getFigmaColorPalette`, `convertFigmaToCode` (10) |
|
|
1382
1437
|
|
|
1383
|
-
**Total:**
|
|
1438
|
+
**Total:** 43 tools across 7 groups
|
|
1384
1439
|
|
|
1385
1440
|
**Configuration:**
|
|
1386
1441
|
|
|
@@ -1391,7 +1446,7 @@ Each tool definition is sent to the AI in every request, consuming context token
|
|
|
1391
1446
|
"mcpServers": {
|
|
1392
1447
|
"chrometools": {
|
|
1393
1448
|
"command": "npx",
|
|
1394
|
-
"args": ["
|
|
1449
|
+
"args": ["chrometools-mcp"],
|
|
1395
1450
|
"env": {
|
|
1396
1451
|
"ENABLED_TOOLS": "core,interaction,inspection"
|
|
1397
1452
|
}
|
|
@@ -1408,7 +1463,7 @@ Each tool definition is sent to the AI in every request, consuming context token
|
|
|
1408
1463
|
"chrometools": {
|
|
1409
1464
|
"type": "stdio",
|
|
1410
1465
|
"command": "npx",
|
|
1411
|
-
"args": ["
|
|
1466
|
+
"args": ["chrometools-mcp"],
|
|
1412
1467
|
"env": {
|
|
1413
1468
|
"ENABLED_TOOLS": "core,interaction,advanced"
|
|
1414
1469
|
}
|
|
@@ -1475,7 +1530,7 @@ To use Figma tools, you need to configure your Figma Personal Access Token.
|
|
|
1475
1530
|
"mcpServers": {
|
|
1476
1531
|
"chrometools": {
|
|
1477
1532
|
"command": "npx",
|
|
1478
|
-
"args": ["
|
|
1533
|
+
"args": ["chrometools-mcp"],
|
|
1479
1534
|
"env": {
|
|
1480
1535
|
"FIGMA_TOKEN": "your-figma-token-here"
|
|
1481
1536
|
}
|
|
@@ -1492,7 +1547,7 @@ To use Figma tools, you need to configure your Figma Personal Access Token.
|
|
|
1492
1547
|
"chrometools": {
|
|
1493
1548
|
"type": "stdio",
|
|
1494
1549
|
"command": "npx",
|
|
1495
|
-
"args": ["
|
|
1550
|
+
"args": ["chrometools-mcp"],
|
|
1496
1551
|
"env": {
|
|
1497
1552
|
"FIGMA_TOKEN": "your-figma-token-here"
|
|
1498
1553
|
}
|
|
@@ -1543,30 +1598,24 @@ npx @modelcontextprotocol/inspector node index.js
|
|
|
1543
1598
|
|
|
1544
1599
|
## Features
|
|
1545
1600
|
|
|
1546
|
-
- **
|
|
1601
|
+
- **48+ Powerful Tools**: Complete toolkit for browser automation
|
|
1547
1602
|
- Core: ping, openBrowser
|
|
1548
1603
|
- Interaction: click, type, scrollTo, selectOption, selectFromGroup, drag, scrollHorizontal
|
|
1549
1604
|
- Inspection: getElement, getComputedCss, getBoxModel, screenshot, saveScreenshot
|
|
1550
1605
|
- Advanced: executeScript, getConsoleLogs, listNetworkRequests, getNetworkRequest, filterNetworkRequests, hover, setStyles, setViewport, getViewport, navigateTo, waitForElement
|
|
1551
|
-
- AI-Powered: smartFindElement, analyzePage,
|
|
1552
|
-
- Recorder: enableRecorder, executeScenario, listScenarios, searchScenarios, getScenarioInfo, deleteScenario, exportScenarioAsCode, appendScenarioToFile, generatePageObject
|
|
1606
|
+
- AI-Powered: smartFindElement, analyzePage, getElementDetails (with children analysis), getAllInteractiveElements, findElementsByText - Recorder: enableRecorder, executeScenario, listScenarios, searchScenarios, getScenarioInfo, deleteScenario, exportScenarioAsCode, appendScenarioToFile, generatePageObject
|
|
1553
1607
|
- Figma: getFigmaFrame, compareFigmaToElement, getFigmaSpecs, parseFigmaUrl, listFigmaPages, searchFigmaFrames, getFigmaComponents, getFigmaStyles, getFigmaColorPalette, convertFigmaToCode
|
|
1554
|
-
- **UI Framework Detection**: Automatic detection of MUI, Ant Design, Chakra UI, Bootstrap, Vuetify, Semantic UI
|
|
1555
|
-
- **Smart Dropdown Handling**: Extracts options from both native `<select>` and custom UI framework components ⭐ **NEW**
|
|
1556
|
-
- **APOM (Agent Page Object Model)**: Automatic element ID assignment for reliable interaction ⭐ **NEW**
|
|
1557
|
-
- `analyzePage()` returns elements with unique IDs (e.g., `input_20`, `button_45`)
|
|
1608
|
+
- **UI Framework Detection**: Automatic detection of MUI, Ant Design, Chakra UI, Bootstrap, Vuetify, Semantic UI- **Smart Dropdown Handling**: Extracts options from both native `<select>` and custom UI framework components- **APOM (Agent Page Object Model)**: Automatic element ID assignment for reliable interaction - `analyzePage()` returns elements with unique IDs (e.g., `input_20`, `button_45`)
|
|
1558
1609
|
- Use `id` parameter in click/type/hover/selectOption for stable targeting
|
|
1559
|
-
- Use `
|
|
1610
|
+
- Use `getElementDetails()` to get detailed element info
|
|
1560
1611
|
- **Console Log Capture**: Automatic JavaScript console monitoring
|
|
1561
1612
|
- **Network Request Monitoring**: Track all HTTP/API requests (XHR, Fetch, etc.)
|
|
1562
1613
|
- **Persistent Browser Sessions**: Browser tabs remain open between requests
|
|
1563
|
-
- **Multi-Instance Support**: Run multiple MCP servers simultaneously with automatic discovery
|
|
1564
|
-
- Dynamic port allocation (9223-9227)
|
|
1614
|
+
- **Multi-Instance Support**: Run multiple MCP servers simultaneously with automatic discovery - Dynamic port allocation (9223-9227)
|
|
1565
1615
|
- Chrome Extension port scanning every 20s
|
|
1566
1616
|
- Broadcast pattern for parallel AI clients
|
|
1567
1617
|
- Graceful handling of ungraceful shutdowns
|
|
1568
|
-
- **Auto-Sync Active Tab**: MCP server automatically syncs to user's currently active tab
|
|
1569
|
-
- **Visual Browser (GUI Mode)**: See automation in real-time
|
|
1618
|
+
- **Auto-Sync Active Tab**: MCP server automatically syncs to user's currently active tab- **Visual Browser (GUI Mode)**: See automation in real-time
|
|
1570
1619
|
- **Cross-platform**: Works on Windows/WSL, Linux, macOS
|
|
1571
1620
|
- **Simple Installation**: One command with npx
|
|
1572
1621
|
- **CDP Integration**: Uses Chrome DevTools Protocol for precision
|
|
@@ -1575,7 +1624,7 @@ npx @modelcontextprotocol/inspector node index.js
|
|
|
1575
1624
|
|
|
1576
1625
|
## Multi-Instance Support
|
|
1577
1626
|
|
|
1578
|
-
|
|
1627
|
+
: Run up to 8 MCP servers simultaneously, connecting/disconnecting at any time without coordination.
|
|
1579
1628
|
|
|
1580
1629
|
### Overview
|
|
1581
1630
|
|