Bug: take_screenshot returns wrong MIME type for PNG format
Description of the bug
Description
The take_screenshot tool declares image/jpeg media type in the response but actually returns PNG image
data. This causes the Claude API to reject the image with a format mismatch error.
Error Message
Error: API error: Could not process image at index 0 Declared media_type is image/jpeg, but the data appears to be image/png
Reproduction
Steps to Reproduce
- Use the
take_screenshottool with default settings (format: "png") - The tool returns image data
- The response declares
image/jpegmedia type - Claude API rejects due to format mismatch
Environment
- OS: WSL2 (Linux 5.15.167.4-microsoft-standard-WSL2)
Additional Context
The screenshot itself is captured correctly; only the MIME type declaration is wrong.
Expectation
Expected Behavior
- When
format: "png"→ declareimage/png - When
format: "jpeg"→ declareimage/jpeg - When
format: "webp"→ declareimage/webp
MCP configuration
{ "mcpServers": { "chrome-devtools": { "command": "npx", "args": ["-y", "chrome-devtools-mcp@latest"] } } }
Chrome DevTools MCP version
0.10.2
Chrome version
142.0.7444.59
Coding agent version
Claude Code CLI v2.0.46
Model version
Sonnet 4.5
Chat log
No response
Node version
v22.17.1
Operating system
Windows Subsystem for Linux (WSL)
Extra checklist
- [ ] I want to provide a PR to fix this bug
I think I have been running recently in this bug numerous times.
Bug Description chrome-devtools take_screenshot fails consistently with
⏺ chrome-devtools - take_screenshot (MCP)(format: "png")
⎿ # take_screenshot response
Took a screenshot of the current page's viewport.
⎿ [Image]
⎿ API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.13.content.3.image.source.base64.data:
Image does not match the provided media type image/jpeg"},"request_id":"req_011CVM5UMAuiXMHSbNu6Mfn5"}
Environment Info
- Platform: darwin
- Terminal: iTerm.app
- Version: 2.0.49
- Feedback ID: 194dd997-1492-4a73-a4f6-11f68207de03
Errors
[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/george.moldoveanu/.local/share/claude/versions/2.0.49 (expected in multi-process scenarios)\n at BI0 (/$bunfs/root/claude:2556:1516)\n at E$A (/$bunfs/root/claude:2556:1194)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-11-21T11:59:46.564Z"},{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/george.moldoveanu/.local/share/claude/versions/2.0.49 (expected in multi-process scenarios)\n at BI0 (/$bunfs/root/claude:2556:1516)\n at q$A (/$bunfs/root/claude:2554:12595)\n at async Km8 (/$bunfs/root/claude:2554:13797)\n at async Hx (/$bunfs/root/claude:2556:236)\n at async <anonymous> (/$bunfs/root/claude:2556:12360)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-11-21T11:59:54.794Z"},{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/george.moldoveanu/.local/share/claude/versions/2.0.49 (expected in multi-process scenarios)\n at BI0 (/$bunfs/root/claude:2556:1516)\n at q$A (/$bunfs/root/claude:2554:12595)\n at async Km8 (unknown)\n at async Hx (unknown)\n at unknown\n at processTicksAndRejections (native:7:39)","timestamp":"2025-11-21T12:00:22.582Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at NQ (/$bunfs/root/claude:1055:4471)\n at <anonymous> (/$bunfs/root/claude:1055:4193)\n at map (native:1:11)\n at zJ (/$bunfs/root/claude:1055:4185)\n at EuB (/$bunfs/root/claude:1768:3696)\n at N7 (/$bunfs/root/claude:102:19666)\n at EI (/$bunfs/root/claude:104:42843)\n at TU (/$bunfs/root/claude:104:38376)\n at TD (/$bunfs/root/claude:104:38304)\n at kq (/$bunfs/root/claude:104:38158)","timestamp":"2025-11-21T12:23:54.055Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at NQ (/$bunfs/root/claude:1055:4471)\n at <anonymous> (/$bunfs/root/claude:1055:4193)\n at map (native:1:11)\n at zJ (/$bunfs/root/claude:1055:4185)\n at EuB (/$bunfs/root/claude:1768:3696)\n at N7 (/$bunfs/root/claude:102:19666)\n at EI (/$bunfs/root/claude:104:42843)\n at TU (/$bunfs/root/claude:104:38376)\n at TD (/$bunfs/root/claude:104:38304)\n at kq (/$bunfs/root/claude:104:38158)","timestamp":"2025-11-21T12:23:54.058Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at NQ (/$bunfs/root/claude:1055:4471)\n at <anonymous> (/$bunfs/root/claude:1055:4193)\n at map (native:1:11)\n at zJ (/$bunfs/root/claude:1055:4185)\n at EuB (/$bunfs/root/claude:1768:3696)\n at N7 (/$bunfs/root/claude:102:19666)\n at EI (/$bunfs/root/claude:104:42843)\n at TU (/$bunfs/root/claude:104:38376)\n at TD (/$bunfs/root/claude:104:38304)\n at kq (/$bunfs/root/claude:104:38158)","timestamp":"2025-11-21T12:23:54.058Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at NQ (/$bunfs/root/claude:1055:4471)\n at <anonymous> (/$bunfs/root/claude:1055:4193)\n at map (native:1:11)\n at zJ (/$bunfs/root/claude:1055:4185)\n at EuB (/$bunfs/root/claude:1768:3696)\n at N7 (/$bunfs/root/claude:102:19666)\n at EI (/$bunfs/root/claude:104:42843)\n at TU (/$bunfs/root/claude:104:38376)\n at TD (/$bunfs/root/claude:104:38304)\n at kq (/$bunfs/root/claude:104:38158)","timestamp":"2025-11-21T12:31:42.303Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at NQ (/$bunfs/root/claude:1055:4471)\n at <anonymous> (/$bunfs/root/claude:1055:4193)\n at map (native:1:11)\n at zJ (/$bunfs/root/claude:1055:4185)\n at EuB (/$bunfs/root/claude:1768:3696)\n at N7 (/$bunfs/root/claude:102:19666)\n at EI (/$bunfs/root/claude:104:42843)\n at TU (/$bunfs/root/claude:104:38376)\n at TD (/$bunfs/root/claude:104:38304)\n at kq (/$bunfs/ro
Note: Error logs were truncated.
+1 I'm also getting this.
⎿ # take_screenshot response
Took a screenshot of the current page's viewport.
⎿ [Image]
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.5.content.7.image.source.base64.data: Image does not match the provided media
type image/jpeg"},"request_id":"req_011CVMMN37fCxA6QHGpEMxcg"}
I was on latest but tried downgrading to 0.10.0, still getting the error. I'm using Claude Code 2.0.49 on MacOS 15.7.2.
I'm also seen this error
@OrKoN what do we do with this issue? As far as I understand its Claude handling this wrong.
Yeah, Claude is handling it wrong. I would suggest to work around it via a prompt / rule to request a jpeg image until it is solved in Claude.