claude-code - 💡(How to fix) Fix [BUG] MCP ImageContent in tool results is collapsed by default in claude.ai web / Claude Desktop (image not displayed inline) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53256Fetched 2026-04-26 05:20:23
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1

Error Message

Error Messages/Logs

N/A — no error; the image is delivered correctly to the model and the UI, but is hidden behind a collapse expander.

Root Cause

  • #31208 (CLI-side: MCP ImageContent treated as text in tool results, 10-20x token waste) — different bug, same root cause: MCP ImageContent handling lags image_search parity
  • #45575 (CLI TUI: text hidden when structuredContent exists) — analogous "MCP content rendering inconsistency"
  • #22451, #32479, #40102 (precedent: Desktop bugs filed in claude-code repo)

Code Example

def to_mcp_result(self):
    if self.meta is not None:
        return CallToolResult(...)
    if self.structured_content is None:
        return self.content  # ← this branch is taken
    return self.content, self.structured_content
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Note: This is a Claude Desktop / claude.ai web UI bug, not Claude Code CLI. Filing here following the precedent of #22451 and #32479.

When an MCP server returns ImageContent (e.g., a chart from a charting tool), the claude.ai web app (Desktop) renders the entire MCP tool call block — Request parameters JSON + Response image — collapsed by default behind a ▶ expander. The image is hidden from the user until they manually click to expand the block.

In contrast, Anthropic's built-in image_search tool returns images that display inline immediately without folding.

What Should Happen?

MCP tool results that contain ImageContent should render the image inline by default, like image_search does. Folding the whole Request+Response block hides what is often the primary deliverable of the tool call (a chart, screenshot, diagram, etc.).

Error Messages/Logs

N/A — no error; the image is delivered correctly to the model and the UI, but is hidden behind a collapse expander.

Steps to Reproduce

  1. Set up an MCP server that returns ImageContent (e.g., FastMCP Image(...) return value, jupyter-mcp-server, playwright MCP, etc.)
  2. Connect via Streamable HTTP connector in claude.ai web (Settings → Connectors → Add custom connector)
  3. Invoke the tool from a chat (e.g., "render a candlestick chart for code 7203")
  4. Observe: the tool call block is folded by default; user must click ▶ to see the image

Claude Model

Not sure / Multiple models (the bug is in UI rendering, model-independent)

Is this a regression?

I don't know

Last Working Version

N/A

Claude Code Version

N/A — this is a Claude Desktop / claude.ai web bug, not Claude Code CLI.

Claude Desktop version: Claude 1.4758.0 (fb266c) 2026-04-24T20:22:30.000Z

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other (this is a Claude Desktop / claude.ai web UI bug, terminal not applicable)

Additional Information

Server-side verification — confirmed FastMCP returns the minimal, purest possible ImageContent:

Tested with FastMCP 3.2.2:

  • ToolResult.content = [ImageContent] (1 element only)
  • ToolResult.structured_content = None
  • ToolResult.meta = None
  • Tool.output_schema = None
  • to_mcp_result() returns list[ImageContent] with 1 element (no CallToolResult wrap, no structuredContent, no meta)

FastMCP source (tools/base.py:124-137):

def to_mcp_result(self):
    if self.meta is not None:
        return CallToolResult(...)
    if self.structured_content is None:
        return self.content  # ← this branch is taken
    return self.content, self.structured_content

→ The server hands the MCP transport the most minimal possible response (one ImageContent, no extras). The folding behavior is purely client-side (claude.ai web UI).

Connection details:

  • Client: claude.ai web (Claude Desktop app), Streamable HTTP connector
  • Server: custom OSS MCP server (https://jquants-mcp.aikawa.jp/mcp)
  • Reproduction repo: https://github.com/shigechika/jquants-mcp (render_candlestick tool, returns Image(...))

Impact:

  • Charting / screenshot / diagram MCP tools become impractical (users click to see every output)
  • Model's narrative loses visual context (the model receives the image, but the user doesn't see it inline)

Related issues:

  • #31208 (CLI-side: MCP ImageContent treated as text in tool results, 10-20x token waste) — different bug, same root cause: MCP ImageContent handling lags image_search parity
  • #45575 (CLI TUI: text hidden when structuredContent exists) — analogous "MCP content rendering inconsistency"
  • #22451, #32479, #40102 (precedent: Desktop bugs filed in claude-code repo)

extent analysis

TL;DR

The claude.ai web app should render MCP tool results with ImageContent inline by default, without requiring users to click an expander.

Guidance

  • Verify that the MCP server returns the minimal possible ImageContent response, as confirmed with FastMCP 3.2.2.
  • Check the claude.ai web UI rendering logic to determine why ImageContent from MCP tools is folded by default, unlike image_search results.
  • Investigate potential differences in handling ImageContent between MCP tools and image_search in the claude.ai web UI.
  • Consider updating the UI rendering logic to prioritize displaying ImageContent from MCP tools inline, similar to image_search results.

Example

No code snippet is provided, as the issue is related to the claude.ai web UI rendering logic, which is not explicitly stated in the issue.

Notes

The issue is specific to the claude.ai web UI and does not affect the Claude Code CLI. The root cause is likely related to the UI rendering logic, which treats ImageContent from MCP tools differently than image_search results.

Recommendation

Apply a workaround to update the UI rendering logic to display ImageContent from MCP tools inline by default, as this is the expected behavior based on the image_search functionality.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] MCP ImageContent in tool results is collapsed by default in claude.ai web / Claude Desktop (image not displayed inline) [1 participants]