chrometools-mcp 3.1.7 β 3.2.6
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 +118 -0
- package/README.md +183 -117
- package/README.ru.md +352 -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 +93 -90
- package/package.json +1 -1
- package/pom/apom-tree-converter.js +330 -46
- package/publish_output.txt +0 -0
- package/server/tool-definitions.js +24 -41
- package/server/tool-groups.js +0 -1
- package/server/tool-schemas.js +6 -11
- package/test-interactivity.html +178 -0
package/README.md
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
# chrometools-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> π [Π ΡΡΡΠΊΠ°Ρ Π²Π΅ΡΡΠΈΡ README](./README.ru.md)
|
|
4
|
+
|
|
5
|
+
**AI-powered Chrome automation through natural language.** No more fighting with CSS selectors, XPath expressions, or brittle test scripts. Just tell your AI assistant what you want to do on a web page, and ChromeTools MCP makes it happen.
|
|
6
|
+
|
|
7
|
+
## Why ChromeTools MCP?
|
|
8
|
+
|
|
9
|
+
**For AI Agents & Developers:**
|
|
10
|
+
- π― **54 specialized tools** for browser automation - from simple clicks to Figma comparisons
|
|
11
|
+
- π§ **APOM (Agent Page Object Model)** - AI-friendly page representation (~8-10k tokens vs 15-25k for screenshots)
|
|
12
|
+
- π **Persistent browser sessions** - pages stay open between commands for iterative workflows
|
|
13
|
+
- β‘ **Framework-aware** - handles React, Vue, Angular events and state updates automatically
|
|
14
|
+
- πΈ **Visual testing** - compare designs pixel-by-pixel with Figma integration
|
|
15
|
+
- π¬ **Scenario recording** - record browser actions, replay them, or export as Playwright/Selenium tests
|
|
16
|
+
- π **Cross-platform** - works seamlessly on Windows, WSL, Linux, and macOS
|
|
17
|
+
|
|
18
|
+
**Perfect for:**
|
|
19
|
+
- π€ Building AI agents that interact with web applications
|
|
20
|
+
- π§ͺ Automated testing without writing code - let AI generate tests from scenarios
|
|
21
|
+
- π Web scraping and data extraction with natural language instructions
|
|
22
|
+
- π¨ Design validation - compare implemented UI with Figma designs
|
|
23
|
+
- π Rapid prototyping - test user flows by describing them to AI
|
|
24
|
+
- π Monitoring and health checks for web applications
|
|
25
|
+
|
|
26
|
+
Stop writing brittle automation scripts. Start describing what you want in plain English.
|
|
4
27
|
|
|
5
28
|
## Installation
|
|
6
29
|
|
|
@@ -9,7 +32,7 @@ MCP server for Chrome automation using Puppeteer with persistent browser session
|
|
|
9
32
|
The easiest way to install for Claude Code users:
|
|
10
33
|
|
|
11
34
|
```bash
|
|
12
|
-
claude mcp add chrometools -- npx
|
|
35
|
+
claude mcp add chrometools -- npx chrometools-mcp
|
|
13
36
|
```
|
|
14
37
|
|
|
15
38
|
This command will automatically configure the MCP server in your Claude Code settings.
|
|
@@ -26,7 +49,7 @@ Add to your Claude Desktop configuration file:
|
|
|
26
49
|
"mcpServers": {
|
|
27
50
|
"chrometools": {
|
|
28
51
|
"command": "npx",
|
|
29
|
-
"args": ["
|
|
52
|
+
"args": ["chrometools-mcp"]
|
|
30
53
|
}
|
|
31
54
|
}
|
|
32
55
|
}
|
|
@@ -47,7 +70,7 @@ Add to your Claude Desktop configuration file:
|
|
|
47
70
|
"mcpServers": {
|
|
48
71
|
"chrometools": {
|
|
49
72
|
"command": "npx",
|
|
50
|
-
"args": ["
|
|
73
|
+
"args": ["chrometools-mcp"]
|
|
51
74
|
}
|
|
52
75
|
}
|
|
53
76
|
}
|
|
@@ -64,7 +87,7 @@ Add to your Claude Desktop configuration file:
|
|
|
64
87
|
},
|
|
65
88
|
"chrometools": {
|
|
66
89
|
"command": "npx",
|
|
67
|
-
"args": ["
|
|
90
|
+
"args": ["chrometools-mcp"]
|
|
68
91
|
}
|
|
69
92
|
}
|
|
70
93
|
}
|
|
@@ -99,7 +122,7 @@ Add to your Claude Desktop configuration file:
|
|
|
99
122
|
"mcpServers": {
|
|
100
123
|
"chrometools": {
|
|
101
124
|
"command": "npx",
|
|
102
|
-
"args": ["
|
|
125
|
+
"args": ["chrometools-mcp"]
|
|
103
126
|
}
|
|
104
127
|
}
|
|
105
128
|
}
|
|
@@ -118,7 +141,7 @@ For Cline, Continue, or other MCP-compatible clients, add to your MCP configurat
|
|
|
118
141
|
"mcpServers": {
|
|
119
142
|
"chrometools": {
|
|
120
143
|
"command": "npx",
|
|
121
|
-
"args": ["
|
|
144
|
+
"args": ["chrometools-mcp"]
|
|
122
145
|
}
|
|
123
146
|
}
|
|
124
147
|
}
|
|
@@ -129,26 +152,85 @@ For Cline, Continue, or other MCP-compatible clients, add to your MCP configurat
|
|
|
129
152
|
You can also run directly without configuration:
|
|
130
153
|
|
|
131
154
|
```bash
|
|
132
|
-
npx
|
|
155
|
+
npx chrometools-mcp
|
|
133
156
|
```
|
|
134
157
|
|
|
158
|
+
### Chrome Extension Setup
|
|
159
|
+
|
|
160
|
+
The Chrome Extension is **required** for scenario recording and other advanced features. Follow these steps to install it:
|
|
161
|
+
|
|
162
|
+
**Important:** ChromeTools opens Chrome with a separate user profile, so you must install the extension **after** ChromeTools starts Chrome for the first time.
|
|
163
|
+
|
|
164
|
+
**Step 1:** Start ChromeTools MCP server first
|
|
165
|
+
- Make sure ChromeTools is running through your MCP client (Claude Desktop, Cursor, etc.)
|
|
166
|
+
- Or run it manually: `npx chrometools-mcp`
|
|
167
|
+
- This will launch Chrome with ChromeTools' isolated profile
|
|
168
|
+
|
|
169
|
+
**Step 2:** Enable Developer Mode in Chrome
|
|
170
|
+
- Open Chrome Extensions page: `chrome://extensions`
|
|
171
|
+
- Toggle **Developer mode** (switch in top-right corner)
|
|
172
|
+
|
|
173
|
+

|
|
174
|
+
|
|
175
|
+
**Step 3:** Download and Extract the Extension
|
|
176
|
+
|
|
177
|
+
**Option A - Download from GitHub (Recommended):**
|
|
178
|
+
1. Download the extension archive: [chrome-extension.zip](https://github.com/docentovich/chrometools-mcp/raw/main/chrome-extension.zip)
|
|
179
|
+
2. Extract the ZIP file to a folder on your computer
|
|
180
|
+
3. Remember the extraction path (you'll need it in the next step)
|
|
181
|
+
|
|
182
|
+
**Option B - Use from node_modules (if you know the path):**
|
|
183
|
+
- **After npx install:** `~/.npm/_npx/.../node_modules/chrometools-mcp/extension`
|
|
184
|
+
- **After global install:** `<npm-global-path>/node_modules/chrometools-mcp/extension`
|
|
185
|
+
- **From source:** `<repo-path>/extension`
|
|
186
|
+
|
|
187
|
+
**Step 4:** Load the Extension
|
|
188
|
+
- Click **"Load unpacked"** button
|
|
189
|
+
- Navigate to the extracted extension folder (from Step 3)
|
|
190
|
+
- Select the folder and click **"Select Folder"**
|
|
191
|
+
|
|
192
|
+
**Step 5:** Verify Installation
|
|
193
|
+
- You should see "ChromeTools MCP" extension appear in your extensions list with:
|
|
194
|
+
- **Name:** ChromeTools MCP
|
|
195
|
+
- **Version:** (current version)
|
|
196
|
+
- **Description:** MCP server integration for Chrome automation
|
|
197
|
+
- **Status:** Toggle should be ON (blue)
|
|
198
|
+
- Look for the ChromeTools icon (CT) in your Chrome toolbar
|
|
199
|
+
- The extension is now ready to use for scenario recording
|
|
200
|
+
|
|
201
|
+

|
|
202
|
+
|
|
203
|
+
> **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.
|
|
204
|
+
|
|
205
|
+
**Step 6:** Pin the Extension (Optional but Recommended)
|
|
206
|
+
- Click the puzzle piece icon in Chrome toolbar
|
|
207
|
+
- Find "ChromeTools MCP" in the list
|
|
208
|
+
- Click the pin icon to keep it visible in toolbar
|
|
209
|
+
|
|
210
|
+
**Troubleshooting:**
|
|
211
|
+
- **Recommended:** Use Option A (download from GitHub) to avoid searching in node_modules
|
|
212
|
+
- 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
|
|
213
|
+
- The extension only works with Chrome instances launched by ChromeTools
|
|
214
|
+
- If Chrome closes and reopens, the extension should still be loaded (developer mode persists)
|
|
215
|
+
- When ChromeTools first opens Chrome, it automatically shows a prompt with the extension path in node_modules
|
|
216
|
+
|
|
135
217
|
## Table of Contents
|
|
136
218
|
|
|
137
219
|
- [Installation](#installation)
|
|
138
|
-
- [
|
|
139
|
-
- [Scenario Recorder](#scenario-recorder)
|
|
220
|
+
- [Chrome Extension Setup](#chrome-extension-setup)
|
|
221
|
+
- [AI Optimization Features](#ai-optimization-features)- [Scenario Recorder](#scenario-recorder) - Visual UI-based recording with smart optimization
|
|
140
222
|
- [Available Tools](#available-tools) - **46+ Tools Total**
|
|
141
|
-
- [AI-Powered Tools](#ai-powered-tools)
|
|
223
|
+
- [AI-Powered Tools](#ai-powered-tools) - smartFindElement, analyzePage, getElementDetails, findElementsByText
|
|
142
224
|
- [Core Tools](#1-core-tools) - ping, openBrowser
|
|
143
225
|
- [Interaction Tools](#2-interaction-tools) - click, type, scrollTo, selectOption, selectFromGroup, drag, scrollHorizontal
|
|
144
226
|
- [Inspection Tools](#3-inspection-tools) - getElement, getComputedCss, getBoxModel, screenshot
|
|
145
227
|
- [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)
|
|
228
|
+
- [Tab Management Tools](#5-tab-management-tools) - listTabs, switchTab
|
|
229
|
+
- [Recorder Tools](#7-recorder-tools) - enableRecorder, executeScenario, listScenarios, searchScenarios, getScenarioInfo, deleteScenario, exportScenarioAsCode, appendScenarioToFile, generatePageObject
|
|
148
230
|
- [Typical Workflow Example](#typical-workflow-example)
|
|
149
231
|
- [Tool Usage Tips](#tool-usage-tips)
|
|
150
232
|
- [Configuration](#configuration)
|
|
151
|
-
- [Multi-Instance Support](#multi-instance-support)
|
|
233
|
+
- [Multi-Instance Support](#multi-instance-support) - Run multiple MCP servers simultaneously
|
|
152
234
|
- [WSL Setup Guide](#wsl-setup-guide) β [Full WSL Guide](WSL_SETUP.md)
|
|
153
235
|
- [Development](#development)
|
|
154
236
|
- [Features](#features)
|
|
@@ -156,7 +238,7 @@ npx -y chrometools-mcp
|
|
|
156
238
|
|
|
157
239
|
## AI Optimization Features
|
|
158
240
|
|
|
159
|
-
|
|
241
|
+
: Dramatically reduce AI agent request cycles with intelligent element finding and page analysis.
|
|
160
242
|
|
|
161
243
|
### Why This Matters
|
|
162
244
|
|
|
@@ -179,7 +261,7 @@ AI: smartFindElement("login button")
|
|
|
179
261
|
1. **`analyzePage`** - π₯ **USE FREQUENTLY** - Get current page state after loads, clicks, submissions (cached, use refresh:true)
|
|
180
262
|
2. **`smartFindElement`** - Natural language element search with multilingual support
|
|
181
263
|
3. **AI Hints** - Automatic context in all tools (page type, available actions, suggestions)
|
|
182
|
-
4. **
|
|
264
|
+
4. **Text search** - `findElementsByText` for finding elements by visible text
|
|
183
265
|
|
|
184
266
|
**Performance:** 3-5x faster, 5-10x fewer requests
|
|
185
267
|
|
|
@@ -192,22 +274,17 @@ AI: smartFindElement("login button")
|
|
|
192
274
|
|
|
193
275
|
## Scenario Recorder
|
|
194
276
|
|
|
195
|
-
|
|
277
|
+
: Visual UI-based recorder for creating reusable test scenarios with automatic secret detection.
|
|
196
278
|
|
|
197
279
|
### Features
|
|
198
280
|
|
|
199
281
|
- **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
|
|
282
|
+
- **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
283
|
- **Secret Detection** - Auto-detects passwords/emails and stores them securely
|
|
206
284
|
- **Action Optimization** - Combines sequential actions, removes duplicates
|
|
207
285
|
- **Scenario Management** - Save, load, execute, search, and delete scenarios
|
|
208
286
|
- **Dependencies** - Chain scenarios together with dependency resolution
|
|
209
|
-
- **Multi-Instance Protection** - Prevents multiple recorder instances from interfering
|
|
210
|
-
|
|
287
|
+
- **Multi-Instance Protection** - Prevents multiple recorder instances from interfering
|
|
211
288
|
### Quick Start
|
|
212
289
|
|
|
213
290
|
```javascript
|
|
@@ -258,8 +335,7 @@ executeScenario({ name: "login_flow", parameters: { email: "user@test.com" } })
|
|
|
258
335
|
|
|
259
336
|
### AI-Powered Tools
|
|
260
337
|
|
|
261
|
-
####
|
|
262
|
-
Find elements using natural language descriptions instead of CSS selectors.
|
|
338
|
+
#### smartFindElementFind elements using natural language descriptions instead of CSS selectors.
|
|
263
339
|
- **Parameters**:
|
|
264
340
|
- `description` (required): Natural language (e.g., "login button", "email field")
|
|
265
341
|
- `maxResults` (optional): Max candidates to return (default: 5)
|
|
@@ -283,9 +359,22 @@ Find elements using natural language descriptions instead of CSS selectors.
|
|
|
283
359
|
}
|
|
284
360
|
```
|
|
285
361
|
|
|
286
|
-
#### analyzePage
|
|
287
|
-
|
|
288
|
-
|
|
362
|
+
#### analyzePage Get current page state and structure. Returns complete map of forms (with values), inputs, buttons, links with selectors.
|
|
363
|
+
|
|
364
|
+
**Interactivity Detection**:
|
|
365
|
+
- Detects interactive elements via **8 different methods**:
|
|
366
|
+
1. Native HTML tags (`button`, `a`, `input`, `select`, `textarea`)
|
|
367
|
+
2. ARIA roles (`button`, `link`, `checkbox`, etc.)
|
|
368
|
+
3. `onclick` attribute
|
|
369
|
+
4. `onclick` property (set via JavaScript)
|
|
370
|
+
5. CSS `cursor: pointer`
|
|
371
|
+
6. JavaScript `addEventListener('click')`
|
|
372
|
+
7. `tabindex` attribute (except -1)
|
|
373
|
+
8. `contenteditable="true"`
|
|
374
|
+
- **Captures DIV/SPAN with click handlers** - JavaScript-enabled elements are detected
|
|
375
|
+
- Adds `interactivityReason` metadata showing detection method (e.g., `cursor-pointer`, `event-listener`)
|
|
376
|
+
|
|
377
|
+
**When to use**:
|
|
289
378
|
- After opening/navigating to page (initial analysis)
|
|
290
379
|
- **After clicking buttons** (see what changed)
|
|
291
380
|
- **After form submissions** (check results, errors)
|
|
@@ -295,18 +384,13 @@ Get current page state and structure. Returns complete map of forms (with values
|
|
|
295
384
|
- **Parameters**:
|
|
296
385
|
- `refresh` (optional): Force refresh cache to get CURRENT state after changes (default: false)
|
|
297
386
|
- `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**:
|
|
387
|
+
- `useLegacyFormat` (optional): Return legacy format instead of APOM (default: false - APOM is the default)
|
|
388
|
+
- `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
389
|
- Shows actual data (form values, validation errors) not just visual
|
|
303
390
|
- Uses 2-5k tokens vs screenshot 15-25k tokens
|
|
304
391
|
- 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)
|
|
392
|
+
- **Detects UI frameworks** (MUI, Ant Design, Chakra, Bootstrap, Vuetify, Semantic UI) - **Extracts dropdown options** from both native `<select>` and custom UI components- **Returns**:
|
|
393
|
+
- **APOM format** (default): Tree-structured Page Object Model with unique IDs - `tree` - Hierarchical tree of page elements (optimized: ~82% smaller than flat format)
|
|
310
394
|
- Each node: `{ tag, id?, type?, sel, ch?, bounds?, meta? }`
|
|
311
395
|
- Interactive elements have `bounds` and full metadata
|
|
312
396
|
- Parent containers have minimal info (position only)
|
|
@@ -315,12 +399,10 @@ Get current page state and structure. Returns complete map of forms (with values
|
|
|
315
399
|
- Elements automatically registered - use IDs with `click({ id: "..." })`, `type({ id: "..." })`, etc.
|
|
316
400
|
- **Token-optimized**: Minified JSON, simplified parents, no redundant data
|
|
317
401
|
- Example: `analyzePage()` returns APOM, then use `click({ id: "button_45" })` or `type({ id: "input_20", text: "..." })`
|
|
318
|
-
- **Use `
|
|
402
|
+
- **Use `getElementDetails({ id: "input_20" })`** to get full details for any element, or with `analyzeChildren: true` to get children tree structure
|
|
319
403
|
- **Legacy format** (`useLegacyFormat: true`): Classic format for backward compatibility
|
|
320
404
|
- 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
|
|
405
|
+
- **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
406
|
- **Example workflow**:
|
|
325
407
|
1. `openBrowser({ url: "..." })`
|
|
326
408
|
2. `analyzePage()` β Initial analysis, returns elements with IDs
|
|
@@ -333,26 +415,31 @@ Get current page state and structure. Returns complete map of forms (with values
|
|
|
333
415
|
3. `getComputedCss({ selector: "div.header" })` β Get current styles
|
|
334
416
|
4. `setStyles({ selector: "div.header", styles: [...] })` β Apply new styles
|
|
335
417
|
|
|
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.
|
|
418
|
+
#### 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
419
|
- **Parameters**:
|
|
339
420
|
- `id` (required): APOM element ID (e.g., `"input_20"`, `"button_45"`)
|
|
340
|
-
-
|
|
341
|
-
-
|
|
421
|
+
- `analyzeChildren` (optional): Analyze children elements tree structure (default: false)
|
|
422
|
+
- `includeAll` (optional): When analyzing children, include all elements, not just interactive ones (default: false)
|
|
423
|
+
- `refresh` (optional): Force refresh of cached analysis (default: false)
|
|
424
|
+
- **Use case**:
|
|
425
|
+
- Get full details including bounds, CSS selector, attributes, computed styles
|
|
426
|
+
- Focus analysis on specific section (modal, form, sidebar, etc.) with `analyzeChildren: true`
|
|
427
|
+
- **Returns**: Complete element details including:
|
|
342
428
|
- `id`: Element APOM ID
|
|
343
|
-
- `selector`: CSS selector
|
|
429
|
+
- `selector`: CSS selector for the element
|
|
344
430
|
- `tag`: HTML tag name
|
|
345
|
-
- `type`:
|
|
431
|
+
- `type`: Element type (input, button, link, etc.)
|
|
346
432
|
- `text`: Visible text content
|
|
347
|
-
- `bounds`: `{ x, y, width, height
|
|
348
|
-
- `attributes`: All HTML attributes
|
|
349
|
-
- `
|
|
350
|
-
- `
|
|
351
|
-
- `
|
|
433
|
+
- `bounds`: Position and size `{ x, y, width, height, top, right, bottom, left }`
|
|
434
|
+
- `attributes`: All HTML attributes (id, class, name, placeholder, href, etc.)
|
|
435
|
+
- `computed`: Key CSS properties (display, visibility, cursor, color, fontSize, etc.)
|
|
436
|
+
- `metadata`: Element metadata from APOM analysis
|
|
437
|
+
- `visible`: Whether element is visible
|
|
438
|
+
- `childrenTree` (optional): APOM tree structure of children elements when `analyzeChildren: true`
|
|
352
439
|
- **Example**:
|
|
353
440
|
```javascript
|
|
354
|
-
// Get details for specific input field
|
|
355
|
-
|
|
441
|
+
// Get complete details for specific input field
|
|
442
|
+
getElementDetails({ id: "input_20" })
|
|
356
443
|
|
|
357
444
|
// Returns:
|
|
358
445
|
{
|
|
@@ -362,19 +449,17 @@ Get detailed information about a specific element by its APOM ID from `analyzePa
|
|
|
362
449
|
"tag": "input",
|
|
363
450
|
"type": "email",
|
|
364
451
|
"text": "",
|
|
365
|
-
"bounds": { "x": 100, "y": 200, "width": 300, "height": 40 },
|
|
366
|
-
"attributes": { "name": "email", "placeholder": "Enter email" },
|
|
367
|
-
"
|
|
368
|
-
"
|
|
369
|
-
"isEnabled": true
|
|
452
|
+
"bounds": { "x": 100, "y": 200, "width": 300, "height": 40, "top": 200, "right": 400, "bottom": 240, "left": 100 },
|
|
453
|
+
"attributes": { "name": "email", "placeholder": "Enter email", "type": "email" },
|
|
454
|
+
"computed": { "display": "block", "visibility": "visible", "cursor": "text" },
|
|
455
|
+
"visible": true
|
|
370
456
|
}
|
|
371
|
-
```
|
|
372
457
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
458
|
+
// Analyze modal contents after opening it
|
|
459
|
+
analyzePage() // Get initial page structure
|
|
460
|
+
click({ id: "button_45" }) // Open modal
|
|
461
|
+
getElementDetails({ id: "container_123", analyzeChildren: true, refresh: true }) // Analyze modal contents with children tree
|
|
462
|
+
```
|
|
378
463
|
|
|
379
464
|
#### findElementsByText
|
|
380
465
|
Find elements by their visible text content.
|
|
@@ -471,8 +556,7 @@ Select option in dropdown (HTML select elements). **PREFERRED**: Use APOM ID fro
|
|
|
471
556
|
selectOption({ selector: "select[name='country']", text: "United States" })
|
|
472
557
|
```
|
|
473
558
|
|
|
474
|
-
####
|
|
475
|
-
Select option(s) from radio or checkbox group by name attribute. Works at abstract group level instead of individual clicks.
|
|
559
|
+
#### selectFromGroupSelect option(s) from radio or checkbox group by name attribute. Works at abstract group level instead of individual clicks.
|
|
476
560
|
- **Parameters**:
|
|
477
561
|
- `name` (required): Name attribute of the radio/checkbox group (e.g., 'size', 'toppings')
|
|
478
562
|
- `value` (optional): Single value to select (for radio or single checkbox)
|
|
@@ -695,8 +779,7 @@ Navigate to different URL while keeping browser instance.
|
|
|
695
779
|
- **Use case**: Moving between pages in workflow
|
|
696
780
|
- **Returns**: New page title
|
|
697
781
|
|
|
698
|
-
### 5. Tab Management Tools
|
|
699
|
-
|
|
782
|
+
### 5. Tab Management Tools
|
|
700
783
|
Tools for managing multiple browser tabs. New tabs opened via `window.open()`, `target="_blank"`, or user actions are automatically detected and tracked.
|
|
701
784
|
|
|
702
785
|
#### listTabs
|
|
@@ -737,12 +820,10 @@ switchTab({ tab: 0 })
|
|
|
737
820
|
switchTab({ tab: "google.com" })
|
|
738
821
|
```
|
|
739
822
|
|
|
740
|
-
### 6. Figma Tools
|
|
741
|
-
|
|
823
|
+
### 6. Figma Tools
|
|
742
824
|
Design-to-code validation, file browsing, design system extraction, and comparison tools with automatic 3 MB compression.
|
|
743
825
|
|
|
744
|
-
#### parseFigmaUrl
|
|
745
|
-
Parse Figma URL to extract fileKey and nodeId automatically.
|
|
826
|
+
#### parseFigmaUrl Parse Figma URL to extract fileKey and nodeId automatically.
|
|
746
827
|
- **Parameters**:
|
|
747
828
|
- `url` (required): Full Figma URL or just fileKey
|
|
748
829
|
- **Supported formats**:
|
|
@@ -752,8 +833,7 @@ Parse Figma URL to extract fileKey and nodeId automatically.
|
|
|
752
833
|
- **Use case**: No need to manually extract fileKey and nodeId from URLs
|
|
753
834
|
- **Returns**: `{ fileKey, nodeId }` object
|
|
754
835
|
|
|
755
|
-
#### listFigmaPages
|
|
756
|
-
Browse entire Figma file structure: all pages and frames with IDs.
|
|
836
|
+
#### listFigmaPages Browse entire Figma file structure: all pages and frames with IDs.
|
|
757
837
|
- **Parameters**:
|
|
758
838
|
- `figmaToken` (optional): Figma API token
|
|
759
839
|
- `fileKey` (required): Figma file key or full URL
|
|
@@ -779,8 +859,7 @@ Browse entire Figma file structure: all pages and frames with IDs.
|
|
|
779
859
|
}
|
|
780
860
|
```
|
|
781
861
|
|
|
782
|
-
#### searchFigmaFrames
|
|
783
|
-
Search frames/components by name across entire Figma file.
|
|
862
|
+
#### searchFigmaFrames Search frames/components by name across entire Figma file.
|
|
784
863
|
- **Parameters**:
|
|
785
864
|
- `figmaToken` (optional): Figma API token
|
|
786
865
|
- `fileKey` (required): Figma file key or full URL
|
|
@@ -789,16 +868,14 @@ Search frames/components by name across entire Figma file.
|
|
|
789
868
|
- **Returns**: All matching nodes with IDs, names, types, pages, dimensions
|
|
790
869
|
- **Example**: Search for "login" returns all frames containing "login" in name
|
|
791
870
|
|
|
792
|
-
#### getFigmaComponents
|
|
793
|
-
Extract all components from Figma file (Design System).
|
|
871
|
+
#### getFigmaComponents Extract all components from Figma file (Design System).
|
|
794
872
|
- **Parameters**:
|
|
795
873
|
- `figmaToken` (optional): Figma API token
|
|
796
874
|
- `fileKey` (required): Figma file key or full URL
|
|
797
875
|
- **Use case**: Get complete list of design system components
|
|
798
876
|
- **Returns**: All COMPONENT and COMPONENT_SET nodes with names, descriptions, dimensions
|
|
799
877
|
|
|
800
|
-
#### getFigmaStyles
|
|
801
|
-
Get all shared styles from Figma file (color, text, effect, grid styles).
|
|
878
|
+
#### getFigmaStyles Get all shared styles from Figma file (color, text, effect, grid styles).
|
|
802
879
|
- **Parameters**:
|
|
803
880
|
- `figmaToken` (optional): Figma API token
|
|
804
881
|
- `fileKey` (required): Figma file key or full URL
|
|
@@ -809,8 +886,7 @@ Get all shared styles from Figma file (color, text, effect, grid styles).
|
|
|
809
886
|
- Effect styles (shadows, blur)
|
|
810
887
|
- Grid styles
|
|
811
888
|
|
|
812
|
-
#### getFigmaColorPalette
|
|
813
|
-
Extract complete color palette with usage statistics.
|
|
889
|
+
#### getFigmaColorPalette Extract complete color palette with usage statistics.
|
|
814
890
|
- **Parameters**:
|
|
815
891
|
- `figmaToken` (optional): Figma API token
|
|
816
892
|
- `fileKey` (required): Figma file key or full URL
|
|
@@ -821,8 +897,7 @@ Extract complete color palette with usage statistics.
|
|
|
821
897
|
- Usage examples (where the color is used)
|
|
822
898
|
- Sorted by usage frequency
|
|
823
899
|
|
|
824
|
-
#### convertFigmaToCode
|
|
825
|
-
Convert Figma designs to React/Tailwind code with AI assistance.
|
|
900
|
+
#### convertFigmaToCode Convert Figma designs to React/Tailwind code with AI assistance.
|
|
826
901
|
- **Parameters**:
|
|
827
902
|
- `figmaToken` (optional): Figma API token
|
|
828
903
|
- `fileKey` (required): Figma file key
|
|
@@ -883,9 +958,8 @@ Extract detailed design specifications from Figma including text content, colors
|
|
|
883
958
|
- **Dimensions**: Width, height, x, y coordinates
|
|
884
959
|
- **Children**: Recursive tree with text extraction from all child elements
|
|
885
960
|
|
|
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/`.
|
|
961
|
+
### 7. Recorder Tools
|
|
962
|
+
**URL-Based Storage**: Scenarios are automatically organized by website domain in `~/.config/chrometools-mcp/projects/{domain}/scenarios/`.
|
|
889
963
|
|
|
890
964
|
**Automatic Domain Detection**: Project ID is extracted from the URL where recording starts:
|
|
891
965
|
- `https://www.google.com` β `google`
|
|
@@ -1028,8 +1102,7 @@ Delete a scenario and its associated secrets. Searches all projects to find the
|
|
|
1028
1102
|
- **Use case**: Clean up unused scenarios
|
|
1029
1103
|
- **Returns**: Success confirmation
|
|
1030
1104
|
|
|
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.
|
|
1105
|
+
#### 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
1106
|
|
|
1034
1107
|
- **Parameters**:
|
|
1035
1108
|
- `scenarioName` (required): Name of scenario to export
|
|
@@ -1097,7 +1170,7 @@ Export recorded scenario as executable test code for creating a **NEW** test fil
|
|
|
1097
1170
|
- Hash suffixes: `component_a1b2c3d` β removed
|
|
1098
1171
|
- Prefers stable selectors: `data-testid`, `role`, `aria-label`, semantic attributes
|
|
1099
1172
|
|
|
1100
|
-
#### appendScenarioToFile
|
|
1173
|
+
#### appendScenarioToFile
|
|
1101
1174
|
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
1175
|
|
|
1103
1176
|
- **Parameters**:
|
|
@@ -1189,8 +1262,7 @@ Append recorded scenario as test code to an **EXISTING** test file. Automaticall
|
|
|
1189
1262
|
}
|
|
1190
1263
|
```
|
|
1191
1264
|
|
|
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.
|
|
1265
|
+
#### 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
1266
|
|
|
1195
1267
|
- **Parameters**:
|
|
1196
1268
|
- `className` (optional): Page Object class name (auto-generated from page title/URL if not provided)
|
|
@@ -1303,7 +1375,7 @@ Add the MCP server to your MCP client configuration file:
|
|
|
1303
1375
|
"mcpServers": {
|
|
1304
1376
|
"chrometools": {
|
|
1305
1377
|
"command": "npx",
|
|
1306
|
-
"args": ["
|
|
1378
|
+
"args": ["chrometools-mcp"]
|
|
1307
1379
|
}
|
|
1308
1380
|
}
|
|
1309
1381
|
}
|
|
@@ -1317,7 +1389,7 @@ Add the MCP server to your MCP client configuration file:
|
|
|
1317
1389
|
"chrometools": {
|
|
1318
1390
|
"type": "stdio",
|
|
1319
1391
|
"command": "npx",
|
|
1320
|
-
"args": ["
|
|
1392
|
+
"args": ["chrometools-mcp"],
|
|
1321
1393
|
"env": {}
|
|
1322
1394
|
}
|
|
1323
1395
|
}
|
|
@@ -1361,7 +1433,7 @@ By default, all tools are enabled. You can selectively enable only specific tool
|
|
|
1361
1433
|
|
|
1362
1434
|
**Why filter tools?**
|
|
1363
1435
|
|
|
1364
|
-
Each tool definition is sent to the AI in every request, consuming context tokens.
|
|
1436
|
+
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
1437
|
|
|
1366
1438
|
- **Save tokens:** Fewer tools = less context consumed per request
|
|
1367
1439
|
- **Reduce costs:** Lower token usage means lower API costs
|
|
@@ -1374,13 +1446,13 @@ Each tool definition is sent to the AI in every request, consuming context token
|
|
|
1374
1446
|
|-------|-------------|---------------|
|
|
1375
1447
|
| `core` | Basic tools | `ping`, `openBrowser` (2) |
|
|
1376
1448
|
| `interaction` | User interaction | `click`, `type`, `scrollTo`, `waitForElement`, `hover` (5) |
|
|
1377
|
-
| `inspection` | Page inspection | `
|
|
1449
|
+
| `inspection` | Page inspection | `getComputedCss`, `getBoxModel`, `screenshot`, `saveScreenshot` (4) |
|
|
1378
1450
|
| `debug` | Debugging & network | `getConsoleLogs`, `listNetworkRequests`, `getNetworkRequest`, `filterNetworkRequests` (4) |
|
|
1379
|
-
| `advanced` | Advanced automation & AI | `executeScript`, `setStyles`, `setViewport`, `getViewport`, `navigateTo`, `smartFindElement`, `analyzePage`, `
|
|
1451
|
+
| `advanced` | Advanced automation & AI | `executeScript`, `setStyles`, `setViewport`, `getViewport`, `navigateTo`, `smartFindElement`, `analyzePage`, `findElementsByText` (8) |
|
|
1380
1452
|
| `recorder` | Scenario recording | `enableRecorder`, `executeScenario`, `listScenarios`, `searchScenarios`, `getScenarioInfo`, `deleteScenario`, `exportScenarioAsCode`, `appendScenarioToFile`, `generatePageObject` (9) |
|
|
1381
1453
|
| `figma` | Figma integration | `getFigmaFrame`, `compareFigmaToElement`, `getFigmaSpecs`, `parseFigmaUrl`, `listFigmaPages`, `searchFigmaFrames`, `getFigmaComponents`, `getFigmaStyles`, `getFigmaColorPalette`, `convertFigmaToCode` (10) |
|
|
1382
1454
|
|
|
1383
|
-
**Total:**
|
|
1455
|
+
**Total:** 42 tools across 7 groups
|
|
1384
1456
|
|
|
1385
1457
|
**Configuration:**
|
|
1386
1458
|
|
|
@@ -1391,7 +1463,7 @@ Each tool definition is sent to the AI in every request, consuming context token
|
|
|
1391
1463
|
"mcpServers": {
|
|
1392
1464
|
"chrometools": {
|
|
1393
1465
|
"command": "npx",
|
|
1394
|
-
"args": ["
|
|
1466
|
+
"args": ["chrometools-mcp"],
|
|
1395
1467
|
"env": {
|
|
1396
1468
|
"ENABLED_TOOLS": "core,interaction,inspection"
|
|
1397
1469
|
}
|
|
@@ -1408,7 +1480,7 @@ Each tool definition is sent to the AI in every request, consuming context token
|
|
|
1408
1480
|
"chrometools": {
|
|
1409
1481
|
"type": "stdio",
|
|
1410
1482
|
"command": "npx",
|
|
1411
|
-
"args": ["
|
|
1483
|
+
"args": ["chrometools-mcp"],
|
|
1412
1484
|
"env": {
|
|
1413
1485
|
"ENABLED_TOOLS": "core,interaction,advanced"
|
|
1414
1486
|
}
|
|
@@ -1475,7 +1547,7 @@ To use Figma tools, you need to configure your Figma Personal Access Token.
|
|
|
1475
1547
|
"mcpServers": {
|
|
1476
1548
|
"chrometools": {
|
|
1477
1549
|
"command": "npx",
|
|
1478
|
-
"args": ["
|
|
1550
|
+
"args": ["chrometools-mcp"],
|
|
1479
1551
|
"env": {
|
|
1480
1552
|
"FIGMA_TOKEN": "your-figma-token-here"
|
|
1481
1553
|
}
|
|
@@ -1492,7 +1564,7 @@ To use Figma tools, you need to configure your Figma Personal Access Token.
|
|
|
1492
1564
|
"chrometools": {
|
|
1493
1565
|
"type": "stdio",
|
|
1494
1566
|
"command": "npx",
|
|
1495
|
-
"args": ["
|
|
1567
|
+
"args": ["chrometools-mcp"],
|
|
1496
1568
|
"env": {
|
|
1497
1569
|
"FIGMA_TOKEN": "your-figma-token-here"
|
|
1498
1570
|
}
|
|
@@ -1543,30 +1615,24 @@ npx @modelcontextprotocol/inspector node index.js
|
|
|
1543
1615
|
|
|
1544
1616
|
## Features
|
|
1545
1617
|
|
|
1546
|
-
- **
|
|
1618
|
+
- **48+ Powerful Tools**: Complete toolkit for browser automation
|
|
1547
1619
|
- Core: ping, openBrowser
|
|
1548
1620
|
- Interaction: click, type, scrollTo, selectOption, selectFromGroup, drag, scrollHorizontal
|
|
1549
1621
|
- Inspection: getElement, getComputedCss, getBoxModel, screenshot, saveScreenshot
|
|
1550
1622
|
- 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
|
|
1623
|
+
- AI-Powered: smartFindElement, analyzePage, getElementDetails (with children analysis), findElementsByText - Recorder: enableRecorder, executeScenario, listScenarios, searchScenarios, getScenarioInfo, deleteScenario, exportScenarioAsCode, appendScenarioToFile, generatePageObject
|
|
1553
1624
|
- 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`)
|
|
1625
|
+
- **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
1626
|
- Use `id` parameter in click/type/hover/selectOption for stable targeting
|
|
1559
|
-
- Use `
|
|
1627
|
+
- Use `getElementDetails()` to get detailed element info
|
|
1560
1628
|
- **Console Log Capture**: Automatic JavaScript console monitoring
|
|
1561
1629
|
- **Network Request Monitoring**: Track all HTTP/API requests (XHR, Fetch, etc.)
|
|
1562
1630
|
- **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)
|
|
1631
|
+
- **Multi-Instance Support**: Run multiple MCP servers simultaneously with automatic discovery - Dynamic port allocation (9223-9227)
|
|
1565
1632
|
- Chrome Extension port scanning every 20s
|
|
1566
1633
|
- Broadcast pattern for parallel AI clients
|
|
1567
1634
|
- 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
|
|
1635
|
+
- **Auto-Sync Active Tab**: MCP server automatically syncs to user's currently active tab- **Visual Browser (GUI Mode)**: See automation in real-time
|
|
1570
1636
|
- **Cross-platform**: Works on Windows/WSL, Linux, macOS
|
|
1571
1637
|
- **Simple Installation**: One command with npx
|
|
1572
1638
|
- **CDP Integration**: Uses Chrome DevTools Protocol for precision
|
|
@@ -1575,7 +1641,7 @@ npx @modelcontextprotocol/inspector node index.js
|
|
|
1575
1641
|
|
|
1576
1642
|
## Multi-Instance Support
|
|
1577
1643
|
|
|
1578
|
-
|
|
1644
|
+
: Run up to 8 MCP servers simultaneously, connecting/disconnecting at any time without coordination.
|
|
1579
1645
|
|
|
1580
1646
|
### Overview
|
|
1581
1647
|
|