Skip to content

Commit b5e211f

Browse files
committed
fix: update screenshot format configuration and troubleshooting notes for Claude Code
1 parent 225694d commit b5e211f

3 files changed

Lines changed: 11 additions & 32 deletions

File tree

README.md

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -430,37 +430,7 @@ You can connect directly to a Chrome WebSocket endpoint and include custom heade
430430

431431
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.
432432

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-
463-
You can also run `npx chrome-devtools-mcp@latest --help` to see all available configuration options.
433+
You can run `npx chrome-devtools-mcp@latest --help` to see all available configuration options.
464434

465435
## Concepts
466436

docs/troubleshooting.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ ssh -N -L 127.0.0.1:9222:127.0.0.1:9222 <user>@<host-ip>
3838

3939
Point the MCP connection inside the VM to `http://127.0.0.1:9222` and DevTools
4040
will reach the host browser without triggering the Host validation.
41+
42+
### Screenshots not displaying correctly in Claude Code
43+
44+
If you experience issues with screenshots not displaying correctly in Claude Code, you can work around this by:
45+
46+
1. Setting the default format to JPEG in your configuration (recommended): Add `--screenshot-format=jpeg` to your MCP server args
47+
2. Explicitly passing `jpeg` as the format parameter in all `take_screenshot()` calls: `take_screenshot(format="jpeg")`
48+
49+
This workaround is needed until the issue is resolved on Claude Code's side.

src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export const cliOptions = {
163163
screenshotFormat: {
164164
type: 'string',
165165
describe:
166-
'Default image format for screenshots. Options: png, jpeg, webp. Default is png.',
166+
'Default image format for screenshots taken by take_screenshot when no format parameter is provided. Options: png, jpeg, webp. Default is png.',
167167
choices: ['png', 'jpeg', 'webp'] as const,
168168
default: 'png',
169169
},

0 commit comments

Comments
 (0)