claude-code - 💡(How to fix) Fix MCP tool results should support the native Edit tool's diff rendering [1 comments, 2 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#47151Fetched 2026-04-13 05:40:06
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
5
Timeline (top)
labeled ×4commented ×1
RAW_BUFFERClick to expand / collapse
<img width="895" height="209" alt="Image" src="https://github.com/user-attachments/assets/54149d58-53b7-4685-811f-29f461451bcb" />

Problem

MCP tools that edit files can only return TextContent, which Claude Code renders as a plain monospace block with escaped \ns. The native Edit tool renders the same information as a colored unified diff (green + / red -). There is no way for an MCP tool to opt into that renderer.

For users of third-party edit tools, every edit produces a wall of text instead of a diff. This is our number one user complaint.

Request

Give MCP tools access to the native Edit tool's diff rendering. Tools should be able to signal "this result is a diff" (e.g. via a content-type annotation on TextContent) and have Claude Code render it the same way as a native Edit call — colored, expanded by default, same visual treatment.

Related issues

  • #22619 — generative UI for tools
  • #15718 — display/context separation (closed — curious why)
  • #13600 — markdown renderer for CLI
  • #18177 — configurable diff tools
  • #39683 — persistent verbosity setting

Environment

  • Claude Code: 2.1.104
  • OS / terminal: macOS, iTerm2

extent analysis

TL;DR

Allow MCP tools to opt into the native Edit tool's diff rendering by adding a content-type annotation to TextContent.

Guidance

  • Investigate adding a content-type annotation to TextContent to signal that the result is a diff, enabling Claude Code to render it as a colored unified diff.
  • Review related issues, such as #22619 and #18177, to understand existing efforts towards improving tool integration and diff rendering.
  • Consider the display/context separation concept from #15718, although it's closed, to inform the design of the diff rendering feature.
  • Evaluate the feasibility of introducing a new content-type annotation, ensuring it aligns with the existing architecture and doesn't introduce compatibility issues.

Example

No code example is provided due to the lack of specific implementation details in the issue.

Notes

The solution relies on the assumption that adding a content-type annotation to TextContent is technically feasible and aligns with the existing Claude Code architecture. The implementation details and potential compatibility implications need to be carefully considered.

Recommendation

Apply a workaround by introducing a content-type annotation to TextContent, allowing MCP tools to opt into the native Edit tool's diff rendering, as this addresses the primary user complaint and provides a clear path forward.

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