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.

Hi there, wondering if anyone has an example of using chatGPT to generate an image and then call a MCP tool with a publicly available URL, pretty please? (using Open AI App SDK)

eg “Generate me and image of fried eggs and update the recipe”.

I do see api `window.openai.getFileDownloadUrl({ fileId })` but can’t seem to get that working.

chatGPT seems to tell me this is possible, but struggling to get it to work . I have tried base64 urls as an alternative too, but seemed to get stuck with that too.

See tool call - image url is relative , not public `/mct/data…`

Hi Adam! Any luck?? I’ve also been having no luck the past few days with this.

Hi Guilherme, any luck with this? I’ve also been trying for a while with no luck.

From what I understand, the Apps SDK has file-related methods like window.openai.uploadFile, window.openai.selectFiles(), and window.openai.getFileDownloadUrl({ fileId }).

A cleaner approach would be to let the ChatGPT App/widget handle the file first, then only pass a reference to your MCP server (not sending the whole image as a base64 value inside the MCP tool call).

So the flow would be something like this:

-User asks to upload the image.

-the app shows a small file/confirmation UI.

-The widget gets the file using selectFiles() or uploadFile().

-Then it sends only the fileId or temporary download URL to the MCP tool.

-Your backend downloads the image right away and stores it in your own storag

This is near and dear to my heart. SEP-2356 creates a base64 primitive for this, which is the first stepping stone, and I’ve been courting SEP-2361 to fully support this end-to-end without a base64 string.

I would recommend for now trying to lean into openai/fileParams (see docs) for this behavior. If you have thoughts here, I’d be happy to field them so we can land a standardized shape that works across the entire MCP ecosystem.