Troubleshooting image content from MCP tool's return #6962
Replies: 5 comments 3 replies
-
When I updated the MCP SDK, it seems image content had changed and I was not aware of it. The intention is not just to display base64 as the image representation and to actually show the image |
Beta Was this translation helpful? Give feedback.
-
Actually, it's already working as expected with OpenAI and custom endpoints there is an issue with OpenRouter, since they don't support returning images from tool outputs |
Beta Was this translation helpful? Give feedback.
-
Anthropic direct also has no issue |
Beta Was this translation helpful? Give feedback.
-
I'm using the version built from commit 150116e and using my custom MCP tool via SSE. My server returns the image using fastmcp's
The tool's output is a raw json block having type, image, and MIME like this: {
"type": "image",
"data": "iVBORw0KGgoAAAANSUhEUgAAAwgAAAMIC..."
"mimeType": "image/png"
} I've pasted the tool's output to OpenAI's tokenizer, showing the output has 317505 tokens. I've tested the tool on Claude Desktop, and it can correctly decode the image. |
Beta Was this translation helpful? Give feedback.
-
Closing this: #7040 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What features would you like to see added?
Currently librechat cannot correctly decode image content returned from the MCP tools but only as an extra long base64 strings. I hope that Image Content can be correctly decoded and add to the context if receiving images from MCP tools.
More details
I'm pretty sure that the tool is returning the image in the right way since Claude Desktop can correctly decode the image. And I'm sure that I'm using a model having vision capabilities since I can manually upload the image to the model.
Which components are impacted by your request?
General
Pictures
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions