Skip to content

Commit 79944d0

Browse files
committed
feat(cli): allow enabling and disabling categories of tools
1 parent d47aaa9 commit 79944d0

File tree

17 files changed

+228
-157
lines changed

17 files changed

+228
-157
lines changed

README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -230,38 +230,38 @@ If you run into any issues, checkout our [troubleshooting guide](./docs/troubles
230230

231231
<!-- BEGIN AUTO GENERATED TOOLS -->
232232

233-
- **Input automation** (7 tools)
234-
- [`click`](docs/tool-reference.md#click)
235-
- [`drag`](docs/tool-reference.md#drag)
236-
- [`fill`](docs/tool-reference.md#fill)
237-
- [`fill_form`](docs/tool-reference.md#fill_form)
238-
- [`handle_dialog`](docs/tool-reference.md#handle_dialog)
239-
- [`hover`](docs/tool-reference.md#hover)
240-
- [`upload_file`](docs/tool-reference.md#upload_file)
241-
- **Navigation automation** (7 tools)
233+
- **core** (10 tools)
242234
- [`close_page`](docs/tool-reference.md#close_page)
235+
- [`handle_dialog`](docs/tool-reference.md#handle_dialog)
243236
- [`list_pages`](docs/tool-reference.md#list_pages)
244237
- [`navigate_page`](docs/tool-reference.md#navigate_page)
245238
- [`navigate_page_history`](docs/tool-reference.md#navigate_page_history)
246239
- [`new_page`](docs/tool-reference.md#new_page)
247240
- [`select_page`](docs/tool-reference.md#select_page)
241+
- [`take_screenshot`](docs/tool-reference.md#take_screenshot)
242+
- [`take_snapshot`](docs/tool-reference.md#take_snapshot)
248243
- [`wait_for`](docs/tool-reference.md#wait_for)
249-
- **Emulation** (3 tools)
244+
- **input** (6 tools)
245+
- [`click`](docs/tool-reference.md#click)
246+
- [`drag`](docs/tool-reference.md#drag)
247+
- [`fill`](docs/tool-reference.md#fill)
248+
- [`fill_form`](docs/tool-reference.md#fill_form)
249+
- [`hover`](docs/tool-reference.md#hover)
250+
- [`upload_file`](docs/tool-reference.md#upload_file)
251+
- **emulation** (3 tools)
250252
- [`emulate_cpu`](docs/tool-reference.md#emulate_cpu)
251253
- [`emulate_network`](docs/tool-reference.md#emulate_network)
252254
- [`resize_page`](docs/tool-reference.md#resize_page)
253-
- **Performance** (3 tools)
255+
- **performance** (3 tools)
254256
- [`performance_analyze_insight`](docs/tool-reference.md#performance_analyze_insight)
255257
- [`performance_start_trace`](docs/tool-reference.md#performance_start_trace)
256258
- [`performance_stop_trace`](docs/tool-reference.md#performance_stop_trace)
257-
- **Network** (2 tools)
259+
- **network** (2 tools)
258260
- [`get_network_request`](docs/tool-reference.md#get_network_request)
259261
- [`list_network_requests`](docs/tool-reference.md#list_network_requests)
260-
- **Debugging** (4 tools)
262+
- **debugging** (2 tools)
261263
- [`evaluate_script`](docs/tool-reference.md#evaluate_script)
262264
- [`list_console_messages`](docs/tool-reference.md#list_console_messages)
263-
- [`take_screenshot`](docs/tool-reference.md#take_screenshot)
264-
- [`take_snapshot`](docs/tool-reference.md#take_snapshot)
265265

266266
<!-- END AUTO GENERATED TOOLS -->
267267

@@ -314,6 +314,11 @@ The Chrome DevTools MCP server supports the following configuration option:
314314
Additional arguments for Chrome. Only applies when Chrome is launched by chrome-devtools-mcp.
315315
- **Type:** array
316316

317+
- **`--categories`**
318+
Categories of tools to expose
319+
- **Type:** string
320+
- **Default:** `core,input,emulation,performance,network,debugging`
321+
317322
<!-- END AUTO GENERATED OPTIONS -->
318323

319324
Pass them via the `args` property in the JSON configuration. For example:

docs/tool-reference.md

Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,24 @@
22

33
# Chrome DevTools MCP Tool Reference
44

5-
- **[Input automation](#input-automation)** (7 tools)
6-
- [`click`](#click)
7-
- [`drag`](#drag)
8-
- [`fill`](#fill)
9-
- [`fill_form`](#fill_form)
10-
- [`handle_dialog`](#handle_dialog)
11-
- [`hover`](#hover)
12-
- [`upload_file`](#upload_file)
13-
- **[Navigation automation](#navigation-automation)** (7 tools)
5+
- **[Core automation](#core-automation)** (10 tools)
146
- [`close_page`](#close_page)
7+
- [`handle_dialog`](#handle_dialog)
158
- [`list_pages`](#list_pages)
169
- [`navigate_page`](#navigate_page)
1710
- [`navigate_page_history`](#navigate_page_history)
1811
- [`new_page`](#new_page)
1912
- [`select_page`](#select_page)
13+
- [`take_screenshot`](#take_screenshot)
14+
- [`take_snapshot`](#take_snapshot)
2015
- [`wait_for`](#wait_for)
16+
- **[Input automation](#input-automation)** (6 tools)
17+
- [`click`](#click)
18+
- [`drag`](#drag)
19+
- [`fill`](#fill)
20+
- [`fill_form`](#fill_form)
21+
- [`hover`](#hover)
22+
- [`upload_file`](#upload_file)
2123
- **[Emulation](#emulation)** (3 tools)
2224
- [`emulate_cpu`](#emulate_cpu)
2325
- [`emulate_network`](#emulate_network)
@@ -29,160 +31,183 @@
2931
- **[Network](#network)** (2 tools)
3032
- [`get_network_request`](#get_network_request)
3133
- [`list_network_requests`](#list_network_requests)
32-
- **[Debugging](#debugging)** (4 tools)
34+
- **[Debugging](#debugging)** (2 tools)
3335
- [`evaluate_script`](#evaluate_script)
3436
- [`list_console_messages`](#list_console_messages)
35-
- [`take_screenshot`](#take_screenshot)
36-
- [`take_snapshot`](#take_snapshot)
3737

38-
## Input automation
38+
## Core automation
3939

40-
### `click`
40+
### `close_page`
4141

42-
**Description:** Clicks on the provided element
42+
**Description:** Closes the page by its index. The last open page cannot be closed.
4343

4444
**Parameters:**
4545

46-
- **dblClick** (boolean) _(optional)_: Set to true for double clicks. Default is false.
47-
- **uid** (string) **(required)**: The uid of an element on the page from the page content snapshot
46+
- **pageIdx** (number) **(required)**: The index of the page to close. Call [`list_pages`](#list_pages) to list pages.
4847

4948
---
5049

51-
### `drag`
50+
### `handle_dialog`
5251

53-
**Description:** [`Drag`](#drag) an element onto another element
52+
**Description:** If a browser dialog was opened, use this command to handle it
5453

5554
**Parameters:**
5655

57-
- **from_uid** (string) **(required)**: The uid of the element to [`drag`](#drag)
58-
- **to_uid** (string) **(required)**: The uid of the element to drop into
56+
- **action** (enum: "accept", "dismiss") **(required)**: Whether to dismiss or accept the dialog
57+
- **promptText** (string) _(optional)_: Optional prompt text to enter into the dialog.
5958

6059
---
6160

62-
### `fill`
61+
### `list_pages`
6362

64-
**Description:** Type text into a input, text area or select an option from a &lt;select&gt; element.
63+
**Description:** Get a list of pages open in the browser.
64+
65+
**Parameters:** None
66+
67+
---
68+
69+
### `navigate_page`
70+
71+
**Description:** Navigates the currently selected page to a URL.
6572

6673
**Parameters:**
6774

68-
- **uid** (string) **(required)**: The uid of an element on the page from the page content snapshot
69-
- **value** (string) **(required)**: The value to [`fill`](#fill) in
75+
- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
76+
- **url** (string) **(required)**: URL to navigate the page to
7077

7178
---
7279

73-
### `fill_form`
80+
### `navigate_page_history`
7481

75-
**Description:** [`Fill`](#fill) out multiple form elements at once
82+
**Description:** Navigates the currently selected page.
7683

7784
**Parameters:**
7885

79-
- **elements** (array) **(required)**: Elements from snapshot to [`fill`](#fill) out.
86+
- **navigate** (enum: "back", "forward") **(required)**: Whether to navigate back or navigate forward in the selected pages history
87+
- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
8088

8189
---
8290

83-
### `handle_dialog`
91+
### `new_page`
8492

85-
**Description:** If a browser dialog was opened, use this command to handle it
93+
**Description:** Creates a new page
8694

8795
**Parameters:**
8896

89-
- **action** (enum: "accept", "dismiss") **(required)**: Whether to dismiss or accept the dialog
90-
- **promptText** (string) _(optional)_: Optional prompt text to enter into the dialog.
97+
- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
98+
- **url** (string) **(required)**: URL to load in a new page.
9199

92100
---
93101

94-
### `hover`
102+
### `select_page`
95103

96-
**Description:** [`Hover`](#hover) over the provided element
104+
**Description:** Select a page as a context for future tool calls.
97105

98106
**Parameters:**
99107

100-
- **uid** (string) **(required)**: The uid of an element on the page from the page content snapshot
108+
- **pageIdx** (number) **(required)**: The index of the page to select. Call [`list_pages`](#list_pages) to list pages.
101109

102110
---
103111

104-
### `upload_file`
112+
### `take_screenshot`
105113

106-
**Description:** Upload a file through a provided element.
114+
**Description:** Take a screenshot of the page or element.
107115

108116
**Parameters:**
109117

110-
- **filePath** (string) **(required)**: The local path of the file to upload
111-
- **uid** (string) **(required)**: The uid of the file input element or an element that will open file chooser on the page from the page content snapshot
118+
- **filePath** (string) _(optional)_: The absolute path, or a path relative to the current working directory, to save the screenshot to instead of attaching it to the response.
119+
- **format** (enum: "png", "jpeg", "webp") _(optional)_: Type of format to save the screenshot as. Default is "png"
120+
- **fullPage** (boolean) _(optional)_: If set to true takes a screenshot of the full page instead of the currently visible viewport. Incompatible with uid.
121+
- **quality** (number) _(optional)_: Compression quality for JPEG and WebP formats (0-100). Higher values mean better quality but larger file sizes. Ignored for PNG format.
122+
- **uid** (string) _(optional)_: The uid of an element on the page from the page content snapshot. If omitted takes a pages screenshot.
112123

113124
---
114125

115-
## Navigation automation
126+
### `take_snapshot`
116127

117-
### `close_page`
128+
**Description:** Take a text snapshot of the currently selected page based on the a11y tree. The snapshot lists page elements along with a unique
129+
identifier (uid). Always use the latest snapshot. Prefer taking a snapshot over taking a screenshot.
118130

119-
**Description:** Closes the page by its index. The last open page cannot be closed.
131+
**Parameters:**
132+
133+
- **verbose** (boolean) _(optional)_: Whether to include all possible information available in the full a11y tree. Default is false.
134+
135+
---
136+
137+
### `wait_for`
138+
139+
**Description:** Wait for the specified text to appear on the selected page.
120140

121141
**Parameters:**
122142

123-
- **pageIdx** (number) **(required)**: The index of the page to close. Call [`list_pages`](#list_pages) to list pages.
143+
- **text** (string) **(required)**: Text to appear on the page
144+
- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
124145

125146
---
126147

127-
### `list_pages`
148+
## Input automation
128149

129-
**Description:** Get a list of pages open in the browser.
150+
### `click`
130151

131-
**Parameters:** None
152+
**Description:** Clicks on the provided element
153+
154+
**Parameters:**
155+
156+
- **dblClick** (boolean) _(optional)_: Set to true for double clicks. Default is false.
157+
- **uid** (string) **(required)**: The uid of an element on the page from the page content snapshot
132158

133159
---
134160

135-
### `navigate_page`
161+
### `drag`
136162

137-
**Description:** Navigates the currently selected page to a URL.
163+
**Description:** [`Drag`](#drag) an element onto another element
138164

139165
**Parameters:**
140166

141-
- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
142-
- **url** (string) **(required)**: URL to navigate the page to
167+
- **from_uid** (string) **(required)**: The uid of the element to [`drag`](#drag)
168+
- **to_uid** (string) **(required)**: The uid of the element to drop into
143169

144170
---
145171

146-
### `navigate_page_history`
172+
### `fill`
147173

148-
**Description:** Navigates the currently selected page.
174+
**Description:** Type text into a input, text area or select an option from a &lt;select&gt; element.
149175

150176
**Parameters:**
151177

152-
- **navigate** (enum: "back", "forward") **(required)**: Whether to navigate back or navigate forward in the selected pages history
153-
- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
178+
- **uid** (string) **(required)**: The uid of an element on the page from the page content snapshot
179+
- **value** (string) **(required)**: The value to [`fill`](#fill) in
154180

155181
---
156182

157-
### `new_page`
183+
### `fill_form`
158184

159-
**Description:** Creates a new page
185+
**Description:** [`Fill`](#fill) out multiple form elements at once
160186

161187
**Parameters:**
162188

163-
- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
164-
- **url** (string) **(required)**: URL to load in a new page.
189+
- **elements** (array) **(required)**: Elements from snapshot to [`fill`](#fill) out.
165190

166191
---
167192

168-
### `select_page`
193+
### `hover`
169194

170-
**Description:** Select a page as a context for future tool calls.
195+
**Description:** [`Hover`](#hover) over the provided element
171196

172197
**Parameters:**
173198

174-
- **pageIdx** (number) **(required)**: The index of the page to select. Call [`list_pages`](#list_pages) to list pages.
199+
- **uid** (string) **(required)**: The uid of an element on the page from the page content snapshot
175200

176201
---
177202

178-
### `wait_for`
203+
### `upload_file`
179204

180-
**Description:** Wait for the specified text to appear on the selected page.
205+
**Description:** Upload a file through a provided element.
181206

182207
**Parameters:**
183208

184-
- **text** (string) **(required)**: Text to appear on the page
185-
- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
209+
- **filePath** (string) **(required)**: The local path of the file to upload
210+
- **uid** (string) **(required)**: The uid of the file input element or an element that will open file chooser on the page from the page content snapshot
186211

187212
---
188213

@@ -303,28 +328,3 @@ so returned values have to JSON-serializable.
303328
**Parameters:** None
304329

305330
---
306-
307-
### `take_screenshot`
308-
309-
**Description:** Take a screenshot of the page or element.
310-
311-
**Parameters:**
312-
313-
- **filePath** (string) _(optional)_: The absolute path, or a path relative to the current working directory, to save the screenshot to instead of attaching it to the response.
314-
- **format** (enum: "png", "jpeg", "webp") _(optional)_: Type of format to save the screenshot as. Default is "png"
315-
- **fullPage** (boolean) _(optional)_: If set to true takes a screenshot of the full page instead of the currently visible viewport. Incompatible with uid.
316-
- **quality** (number) _(optional)_: Compression quality for JPEG and WebP formats (0-100). Higher values mean better quality but larger file sizes. Ignored for PNG format.
317-
- **uid** (string) _(optional)_: The uid of an element on the page from the page content snapshot. If omitted takes a pages screenshot.
318-
319-
---
320-
321-
### `take_snapshot`
322-
323-
**Description:** Take a text snapshot of the currently selected page based on the a11y tree. The snapshot lists page elements along with a unique
324-
identifier (uid). Always use the latest snapshot. Prefer taking a snapshot over taking a screenshot.
325-
326-
**Parameters:**
327-
328-
- **verbose** (boolean) _(optional)_: Whether to include all possible information available in the full a11y tree. Default is false.
329-
330-
---

0 commit comments

Comments
 (0)