Skip to content

MCP Apps iframe does not render nteract image output from localhost blob URL #29483

Description

@rgbkrk

Feedback ID

019ef11e-95ba-72c3-a85d-518dfcbd47b0

Summary

When a Nightly/nteract MCP tool returns a notebook cell with an image/png display output, the Codex MCP Apps/tool-result iframe renders as a blank white output area. The same PNG exists and can be copied/exported from the MCP Apps view, so the issue appears specific to rendering inside the Codex MCP Apps iframe, not notebook execution or clipboard.

Repro

  1. In Codex desktop, use the nteract Nightly MCP tools.
  2. Attach to a Python notebook and run a cell that produces a Matplotlib/Seaborn PNG.
  3. The tool result structured content includes a display output with image/png pointing at a local blob URL like http://localhost:<port>/blob/<sha256> and blob_base_url like http://localhost:<port>.
  4. Expand/view the MCP Apps rendered output in Codex.
  5. Expected: the PNG appears in the app iframe.
  6. Actual: the iframe/tool card is blank/white, although the image can be copied/exported from elsewhere.

Local evidence

  • nteract maps blob URLs under blob_base_url into content refs and resolves them through createMcpAppBlobResolver.
  • The nteract output-frame CSP is already permissive for static raster outputs, including img-src * data: blob: and connect-src *, so the nteract output document CSP does not look like the blocking layer.
  • The Codex MCP app renderer only uses the daemon output document URL when hostCapabilities.sandbox.csp.frameDomains allows the daemon blob origin. Otherwise daemonOutputFrameUrl(...) returns null and the renderer falls back to srcdoc.
  • The relevant source behavior is covered by the Codex app test for shared cell outputs: including http://localhost:47830 in frameDomains yields outputDocumentUrl: http://localhost:47830/output-frame; excluding it forces outputDocumentUrl: null.
  • Local macOS logs did not expose a clear browser-console CSP violation, so this is inferred from the source path and the observed blank iframe.

Suggested fix

For MCP Apps that receive structured content with blob_base_url on loopback, Codex should advertise/allow the dynamic loopback origin in the app host sandbox capabilities and outer iframe CSP, including at least:

  • frame-src / host capability frameDomains for http://localhost:<blob-port> or a safe loopback wildcard.
  • Image/fetch access for http://localhost:<blob-port>/blob/....
  • Nested frame access to http://localhost:<blob-port>/output-frame when the app asks for it.

If Codex intentionally does not allow local loopback frame/image fetches from MCP Apps, it would help for the host capability to make that explicit so apps like nteract can switch to inline data:image/png;base64,... for static raster outputs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingmcpIssues related to the use of model context protocol (MCP) servers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions