You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds ability to install, uninstall and reload extensions, trigger
extension actions and inspect extension pages, service workers and
content scripts. Specify `--categoryExtensions` to enable.
Closes#1173Closes#96
---------
Co-authored-by: Mathias Bynens <mathias@qiwi.be>
Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
Set to true to include tools related to extensions. Note: This feature is currently only supported with a pipe connection. autoConnect, browserUrl, and wsEndpoint are not supported with this feature until 149 will be released.
623
+
-**Type:** boolean
624
+
-**Default:**`false`
625
+
615
626
-**`--performanceCrux`/ `--performance-crux`**
616
627
Set to false to disable sending URLs from performance traces to CrUX API to get field performance data.
Copy file name to clipboardExpand all lines: skills/chrome-devtools/SKILL.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,7 @@ description: Uses Chrome DevTools via MCP for efficient debugging, troubleshooti
5
5
6
6
## Core Concepts
7
7
8
-
**Browser lifecycle**: Browser starts automatically on first tool call using a persistent Chrome profile. Configure via CLI args in the MCP server configuration: `npx chrome-devtools-mcp@latest --help`.
9
-
8
+
**Browser lifecycle**: Browser starts automatically on first tool call using a persistent Chrome profile. Configure via CLI args in the MCP server configuration: `npx chrome-devtools-mcp@latest --help`. To enable extensions, use `--categoryExtensions`.
10
9
**Page selection**: Tools operate on the currently selected page. Use `list_pages` to see available pages, then `select_page` to switch context.
11
10
12
11
**Element interaction**: Use `take_snapshot` to get page structure with element `uid`s. Each element has a unique `uid` for interaction. If an element isn't found, take a fresh snapshot - the element may have been removed or the page changed.
@@ -36,6 +35,14 @@ description: Uses Chrome DevTools via MCP for efficient debugging, troubleshooti
36
35
37
36
You can send multiple tool calls in parallel, but maintain correct order: navigate → wait → snapshot → interact.
38
37
38
+
### Testing an extension
39
+
40
+
1.**Install**: Use `install_extension` with the path to the unpacked extension.
41
+
2.**Identify**: Get the extension ID from the response or by calling `list_extensions`.
42
+
3.**Trigger Action**: Use `trigger_extension_action` to open the popup or side panel if applicable.
43
+
4.**Verify Service Worker**: Use `evaluate_script` with `serviceWorkerId` to check extension state or trigger background actions.
44
+
5.**Verify Page Behavior**: Navigate to a page where the extension operates and use `take_snapshot` to check if content scripts injected elements or modified the page correctly.
45
+
39
46
## Troubleshooting
40
47
41
48
If `chrome-devtools-mcp` is insufficient, guide users to use Chrome DevTools UI:
Copy file name to clipboardExpand all lines: skills/troubleshooting/SKILL.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,13 @@ If the server starts successfully but only a limited subset of tools (like `list
47
47
48
48
All tools in `chrome-devtools-mcp` are annotated with `readOnlyHint: true` (for safe, non-modifying tools) or `readOnlyHint: false` (for tools that modify browser state, like `emulate`, `click`, `navigate_page`). To access the full suite of tools, the user must disable read-only mode in their MCP client (e.g., by exiting "Plan Mode" in Gemini CLI or adjusting their client's tool safety settings).
49
49
50
+
#### Symptom: Extension tools are missing or extensions fail to load
51
+
52
+
If the tools related to extensions (like `install_extension`) are not available, or if the extensions you load are not functioning:
53
+
54
+
1.**Check for the `--categoryExtensions` flag**: Ensure this flag is passed in the MCP server configuration to enable the extension category tools.
55
+
2.**Make sure the MCP server in configured to launch Chrome instead of connecting to an instance**: Chrome before 149 is not able to load extensions when connecting to an existing instance (`--auto-connect`, `--browserUrl`).
56
+
50
57
#### Other Common Errors
51
58
52
59
Identify other error messages from the failed tool call or the MCP initialization logs:
Copy file name to clipboardExpand all lines: src/bin/chrome-devtools-mcp-cli-options.ts
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ export const cliOptions = {
12
12
type: 'boolean',
13
13
description:
14
14
'If specified, automatically connects to a browser (Chrome 144+) running locally from the user data directory identified by the channel param (default channel is stable). Requires the remote debugging server to be started in the Chrome instance via chrome://inspect/#remote-debugging.',
'Connect to a running, debuggable Chrome instance (e.g. `http://127.0.0.1:9222`). For more details see: https://github.com/ChromeDevTools/chrome-devtools-mcp#connecting-to-a-running-chrome-instance.',
28
28
alias: 'u',
29
-
conflicts: ['wsEndpoint','categoryExtensions'],
29
+
conflicts: ['wsEndpoint'],
30
30
coerce: (url: string|undefined)=>{
31
31
if(!url){
32
32
return;
@@ -44,7 +44,7 @@ export const cliOptions = {
44
44
description:
45
45
'WebSocket endpoint to connect to a running Chrome instance (e.g., ws://127.0.0.1:9222/devtools/browser/<id>). Alternative to --browserUrl.',
'Set to true to include tools related to extensions. Note: This feature is only supported with a pipe connection. autoConnect is not supported.',
228
+
'Set to true to include tools related to extensions. Note: This feature is currently only supported with a pipe connection. autoConnect, browserUrl, and wsEndpoint are not supported with this feature until 149 will be released.',
description: `List all console messages for the currently selected page since the last navigation.${cliArgs?.categoryExtensions ? ' This includes console messages originating from extensions content scripts.' : ''}`,
46
+
annotations: {
47
+
category: ToolCategory.DEBUGGING,
48
+
readOnlyHint: true,
49
+
},
50
+
schema: {
51
+
pageSize: zod
52
+
.number()
53
+
.int()
54
+
.positive()
55
+
.optional()
56
+
.describe(
57
+
'Maximum number of messages to return. When omitted, returns all messages.',
58
+
),
59
+
pageIdx: zod
60
+
.number()
61
+
.int()
62
+
.min(0)
63
+
.optional()
64
+
.describe(
65
+
'Page number to return (0-based). When omitted, returns the first page.',
66
+
),
67
+
types: zod
68
+
.array(zod.enum(FILTERABLE_MESSAGE_TYPES))
69
+
.optional()
70
+
.describe(
71
+
'Filter messages to only return messages of the specified resource types. When omitted or empty, returns all messages.',
72
+
),
73
+
includePreservedMessages: zod
74
+
.boolean()
75
+
.default(false)
76
+
.optional()
77
+
.describe(
78
+
'Set to true to return the preserved messages over the last 3 navigations.',
0 commit comments