[BUG] Claude Agent View: localhost URLs returned by tools are not surfaced as previews / no browser handoff

Resolved 💬 2 comments Opened May 12, 2026 by patrick-yip Closed May 12, 2026

Summary

In Claude Agent View (cloud-hosted background sessions on claude.ai), when an MCP tool
or subprocess invokes webbrowser.open() or surfaces a http://localhost:<port>/ URL,
no browser is opened and the URL is not previewed inline. The URL appears as plain text
in chat, but is unreachable from the user's machine because the server is bound to the
agent sandbox's loopback interface.

This makes any tool that depends on a local rendered page effectively unusable in Agent
View. Examples: streamlit run, matplotlib plt.show(), Jupyter kernel launchers, any
"render and open in browser" affordance.

Repro

  1. Run a background session in Claude Agent View.
  2. Invoke any tool that opens a localhost URL via webbrowser.open("http://localhost:<port>/").
  3. Tool stdout reports the URL; agent surfaces it in chat.

Expected: URL is auto-previewed inline (like the desktop app's Preview pane), or
there is a clickable affordance to open it.

Actual: Nothing visible happens. The URL is plain text. Copy-pasting into a local
browser fails because 127.0.0.1:<port> inside the agent sandbox is not reachable
from the user's machine.

Why it matters

  • Many local renderers ship with a "render then open in browser" contract. These are

silently broken in Agent View today.

  • Background sessions are otherwise ideal for long-running render workflows, but

the missing browser handoff defeats the loop.

Related issues

  • #57253 PreviewContext blocks localhost URLs (desktop app) - related but desktop-specific
  • #46228 Background subagents OAuth limitations - related background-session gap
  • #47195 Preview should allow localhost subdomains

Suggested directions

  • Auto-render localhost URLs in agent message output via the Agent View UI's preview

pane (parity with desktop app behaviour).

  • Or: introduce a "render artifact" tool result type (HTML / image / iframe) so MCP

tools can return inline-displayable payloads instead of relying on a side-channel
browser.

  • Or: tunnel the agent sandbox's localhost ports back to the user's browser session

(Cloudflare-tunnel-style relay).

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗