[Bug] Anthropic API Error: PNG screenshots sent with incorrect image/jpeg MIME type

Resolved 💬 11 comments Opened Nov 19, 2025 by Ormadont Closed Nov 19, 2025

Bug Description
When using the MCP Playwright server within the Claude Code environment (VSCode extension), a persistent invalid_request_error occurs when attempting to transmit screenshots to the Anthropic API. The issue manifests as an incorrect MIME type specification: PNG screenshots are transmitted with an image/jpeg media type declaration, which blocks all subsequent requests within the current conversation

Environment Info

  • Platform: win32
  • Terminal: vscode
  • Version: 2.0.31
  • Feedback ID: 51270c65-5715-4f04-b9dc-83c4b73dfbb4

Errors

[]

Steps to Reproduce
Step 1: Screenshot Initialization
Tool invocation:
{
"tool": "mcp_playwright_browser_take_screenshot",
"parameters": {
"fullPage": true,
"filename": "all-post-operative-control-page.png"
}
}


### Step 2: Error Manifestation
When attempting to continue the conversation, the following error occurs:

messages.7.content.17.image.source.base64.data:
Image does not match the provided media type image/jpeg


### Step 3: Issue Persistence
The error reproduces with every subsequent request within the current conversation, even without repeated calls to MCP Playwright.

---

## 4. Diagnostic Data

### 4.1. Log Fragments (Output → Claude)

2025-11-19T08:30:26.821Z [ERROR] Error streaming, falling back to non-streaming mode: 400
{
"type":"error",
"error":{
"type":"invalid_request_error",
"message":"messages.7.content.17.image.source.base64.data: Image does not match the provided media type image/jpeg"
},
"request_id":"req_011CVGwCPUBQVhbin6DfhmxU"
}

2025-11-19T08:30:27.493Z [ERROR] Error in non-streaming fallback: 400
{
"type":"error",
"error":{
"type":"invalid_request_error",
"message":"messages.7.content.17.image.source.base64.data: Image does not match the provided media type image/jpeg"
},
"request_id":"req_011CVGwCTFPUKyg9MdCjc8p1"
}

2025-11-19T08:30:27.493Z [ERROR]
"Error: Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.7.content.17.image.source.base64.data: Image does not match the provided media type image/jpeg\"},\"request_id\":\"req_011CVGwCTFPUKyg9MdCjc8p1\"}\n
at generate (B:/~BUN/root/claude.exe:389:20036)\n
at makeRequest (B:/~BUN/root/claude.exe:731:5434)\n
at processTicksAndRejections (native:7:39)"


### 4.2. Additional Information

2025-11-19T08:30:26.821Z [DEBUG] CLAUDE_CODE_MAX_OUTPUT_TOKENS Capped from 200000 to 64000

View original on GitHub ↗

This issue has 11 comments on GitHub. Read the full discussion on GitHub ↗