Description
When using the Anima MCP server (https://public-api.animaapp.com/v1/mcp), the codegen-figma_to_code tool returns snapshot images with an incorrect media type, causing the Claude API to reject the entire request.
Error Message
messages.164.content.0.tool_result.content.1.image.source.base64: The image was specified using the image/png media type, but the image appears to be a image/jpeg image
Root Cause
The MCP server appears to hardcode the media type as image/png for all snapshot images returned in tool_result. However, the actual image data (likely fetched from the Figma Image API) can be JPEG. The Claude API validates the base64 image content against the declared media type and rejects the request when they don't match.
Steps to Reproduce
- Configure the Anima MCP server in any MCP-compatible client (Claude Code, Cursor, OpenCode, etc.)
- Call the
figma_to_code tool with a Figma design URL that contains nodes without transparency (Figma tends to return JPEG for these)
- The MCP server returns a
tool_result containing the snapshot image with media_type: "image/png" while the actual image bytes are JPEG
- The AI provider API rejects the request due to the media type mismatch
Expected Behavior
The MCP server should detect the actual image format (by inspecting magic bytes or the Content-Type header from Figma) and set the correct media type (image/jpeg or image/png) accordingly. Alternatively, the server could convert all images to PNG before returning them.
Impact
This is a blocking issue — when it occurs, the entire Figma-to-code flow fails because the AI never receives the tool result. There is no client-side workaround since the MCP client transparently forwards the tool_result to the AI provider.
Environment
- MCP endpoint:
https://public-api.animaapp.com/v1/mcp
- MCP transport: HTTP (Streamable)
- Client: OpenCode (also reproducible with other MCP clients)
- AI provider: Anthropic Claude API
Description
When using the Anima MCP server (
https://public-api.animaapp.com/v1/mcp), thecodegen-figma_to_codetool returns snapshot images with an incorrect media type, causing the Claude API to reject the entire request.Error Message
messages.164.content.0.tool_result.content.1.image.source.base64: The image was specified using the image/png media type, but the image appears to be a image/jpeg image
Root Cause
The MCP server appears to hardcode the media type as
image/pngfor all snapshot images returned intool_result. However, the actual image data (likely fetched from the Figma Image API) can be JPEG. The Claude API validates the base64 image content against the declared media type and rejects the request when they don't match.Steps to Reproduce
figma_to_codetool with a Figma design URL that contains nodes without transparency (Figma tends to return JPEG for these)tool_resultcontaining the snapshot image withmedia_type: "image/png"while the actual image bytes are JPEGExpected Behavior
The MCP server should detect the actual image format (by inspecting magic bytes or the
Content-Typeheader from Figma) and set the correct media type (image/jpegorimage/png) accordingly. Alternatively, the server could convert all images to PNG before returning them.Impact
This is a blocking issue — when it occurs, the entire Figma-to-code flow fails because the AI never receives the tool result. There is no client-side workaround since the MCP client transparently forwards the
tool_resultto the AI provider.Environment
https://public-api.animaapp.com/v1/mcp