Repository navigation
Description
Which version line?
v2 — current (@modelcontextprotocol/inspector@latest)
Which client?
TUI
Inspector version
2.7.0 (git tag) — static code-review finding, not run locally
Node version
N/A — static code review, no live run performed
Operating system (and browser, for the web client)
N/A — static code review
Transport
Not applicable / never connected
MCP server under inspection
N/A — this is a static code-review finding against the 2.7.0 tag source (clients/tui/src/App.tsx, clients/tui/src/components/RequestsTab.tsx), not a live reproduction against a running MCP server.
Steps to reproduce
Found via static review of the 2.7.0 tag source, not a live run.
- The JSON body pretty-print logic (splitting a stringified tool-call result into lines for Ink rendering) appears verbatim in four places:
App.tsx(x2) andRequestsTab.tsx(x2). - Beyond the size-cap gap tracked separately (TUI request/response body rendering has no size cap — risk of terminal hang on large payloads #2407), any future fix (syntax highlighting, a max-line count, wrap behavior) has to be applied by hand in all four places, and it is easy to miss one.
I have not modified one copy to watch the others diverge live; flagging the duplication itself as the maintenance risk, and as a likely source of a future "why does this tab render bodies differently" report.
Expected behavior
The JSON body pretty-print logic lives in one shared helper that all four call sites use, so a future fix (size cap, syntax highlighting, wrap behavior) is applied once.
Actual behavior
The same pretty-print logic is copy-pasted across App.tsx (x2) and RequestsTab.tsx (x2).
Suggested fix: extract a shared formatting helper used by all four sites, ideally alongside the related size-cap fix (#2407).
Logs, errors, or screenshots
No response
Already prototyped a fix?
No response
Before you submit
- I searched existing issues and this is not a duplicate.
- This is not a security vulnerability report (those go through the private advisory process).
Activity
cliffhall commentedon Sep 18, 2026
Triage: Priority Low (total 4)
Labels applied at triage:
v2,chore(cleanup, no behavior change) — replacing the form's staticbug.Board: #28, Status
Incoming(awaiting maintainer review — no milestone yet).cliffhall commentedon Sep 24, 2026
Resolved by #2480 (merged to
v2/mainas fd6a584). The #2407 fix added a shared pure helper,clients/tui/src/utils/bodyLines.ts(formatBody/layoutBody), plus aclients/tui/src/components/BodyLines.tsxcomponent. All four sites this issue names (App.tsx×2,RequestsTab.tsx×2) now render through it, so a future change to body formatting is made in one place.