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
Copy file name to clipboardExpand all lines: README.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -383,6 +383,12 @@ The Chrome DevTools MCP server supports the following configuration option:
383
383
-**Type:** boolean
384
384
-**Default:**`true`
385
385
386
+
-**`--screenshot-format`**
387
+
Default image format for screenshots. Options: png, jpeg, webp. Default is png.
388
+
-**Type:** string
389
+
-**Choices:**`png`, `jpeg`, `webp`
390
+
-**Default:**`png`
391
+
386
392
<!-- END AUTO GENERATED OPTIONS -->
387
393
388
394
Pass them via the `args` property in the JSON configuration. For example:
@@ -424,6 +430,36 @@ You can connect directly to a Chrome WebSocket endpoint and include custom heade
424
430
425
431
To get the WebSocket endpoint from a running Chrome instance, visit `http://127.0.0.1:9222/json/version` and look for the `webSocketDebuggerUrl` field.
426
432
433
+
### Configuring default screenshot format
434
+
435
+
You can set a default image format for all screenshots using the `--screenshot-format` option. The default is PNG. You can change it to JPEG or WebP if needed:
436
+
437
+
```json
438
+
{
439
+
"mcpServers": {
440
+
"chrome-devtools": {
441
+
"command": "npx",
442
+
"args": [
443
+
"chrome-devtools-mcp@latest",
444
+
"--screenshot-format=jpeg"
445
+
]
446
+
}
447
+
}
448
+
}
449
+
```
450
+
451
+
When configured, the `take_screenshot` tool will use this format by default unless explicitly overridden by passing a `format` parameter. Supported formats are `png`, `jpeg`, and `webp`.
452
+
453
+
> [!TIP]
454
+
> PNG is the default format as it provides lossless screenshots. JPEG typically produces smaller file sizes than PNG, which improves performance when working with screenshots. WebP offers the best compression while maintaining quality.
455
+
456
+
> [!NOTE]
457
+
> **Claude Code users**: If you experience issues with screenshots not displaying correctly, you can work around this by:
458
+
> 1. Setting the default format to JPEG in your configuration (recommended): Add `--screenshot-format=jpeg` to your MCP server args
459
+
> 2. Explicitly passing `jpeg` as the format parameter in all `take_screenshot()` calls: `take_screenshot(format="jpeg")`
460
+
>
461
+
> This workaround is needed until the issue is resolved on Claude Code's side.
462
+
427
463
You can also run `npx chrome-devtools-mcp@latest --help` to see all available configuration options.
0 commit comments