How to send file generated in chat to MCP Server?

Hello!

I am trying to build an ChatGPT App following the Apps SDK guidelines and I am running into an issue where I the files are not sent correctly to the MCP Server.

Basically my workflow is:

  • User generate image in Chat (or upload one from his file system)
  • User asks to upload image
  • ChatGPT sends image to MCP Server

What is the right way to send the image from ChatGPT?

  • I tried using a base64 string but it didn’t work consistently and the value was truncated for images around 2.5 MB.
  • I have also tried sending the OpenAI Asset ID but it won’t work for a launched app because the user would be not connected for the same organization as the OpenAI API Key that I generate.

Basically I could not find any documentation in this regard and would like to know if any of you have gone through something like this and what did you do to solve it?

If there is not a way to do this from the chat tool call, I would have to ask the user to add the image in a File Dropzone Widget rendered but that wouldn’t be good because it would add one more step to the process.

1 Like