Skip to content

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

Description

@patrick-yip

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

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agent-viewclaude agents TUI / --bg / FleetView / daemon bg sessionsarea:agentsarea:claude-code-webClaude Code on the web. claude.com/codearea:mcpbugSomething isn't workingplatform:webIssue specifically occurs on the web

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions