claude-code - 💡(How to fix) Fix Feature Request: Improve MCP tool call rendering in terminal

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…

Fix Action

Fix / Workaround

Workarounds Considered

Code Example

⏺ mcp-server - execute_script (MCP)(code: "\ndef main(**kwargs):\n    from datetime
                                       import datetime\n    import json\n\n
                                       ACCOUNT_ID = \"abc123\"\n\n    def
                                       fetch_records(account_id):\n
                                       \"\"\"Fetch active records for account.\"\"\"\n
                                       results = Record.objects(\n
                                       account=account_id,\n
                                       status=\"ACTIVE\"\n        )\n
                                       print(f\"Found {len(results)} records\")\n
                                       ... (continues for many wrapped lines)
RAW_BUFFERClick to expand / collapse

Problem

MCP tool calls with large string parameters (e.g., multi-line code) render as a single unformatted block pushed to the far right of the terminal. This makes them nearly unreadable compared to built-in tools.

Built-in tools (Bash, Read, Write, Edit) get:

  • Collapsible output sections (ctrl+o to expand)
  • Clean formatting with proper line breaks
  • Summary lines showing key info

MCP tools get:

  • All parameters dumped inline on a single wrapped line
  • No collapsing, no formatting
  • Escaped newlines (\n) instead of actual line breaks
  • Long string params push content to the rightmost column

Example: an MCP tool that executes a script

The code parameter contains a ~40-line Python script. In the terminal it renders as:

⏺ mcp-server - execute_script (MCP)(code: "\ndef main(**kwargs):\n    from datetime
                                       import datetime\n    import json\n\n
                                       ACCOUNT_ID = \"abc123\"\n\n    def
                                       fetch_records(account_id):\n
                                       \"\"\"Fetch active records for account.\"\"\"\n
                                       results = Record.objects(\n
                                       account=account_id,\n
                                       status=\"ACTIVE\"\n        )\n
                                       print(f\"Found {len(results)} records\")\n
                                       ... (continues for many wrapped lines)

This is functionally unreadable. The entire code block becomes visual noise that you have to scroll past.

Proposed Solution

Apply the same rendering treatment to MCP tools that built-in tools already get:

  1. Collapsible input parameters: Large string params (especially multi-line ones) should be collapsed by default with a summary line, expandable with ctrl+o
  2. Code formatting: String parameters containing newlines should render as formatted code blocks, not escaped inline strings
  3. Collapsible output: MCP tool results should use the same collapsible rendering as Bash output

Bonus (lower priority)

  • Allow MCP tool schemas to include display hints (e.g., marking a parameter as "x-display": "code" to trigger code block rendering)
  • Allow a parameter to be marked as "x-collapsed": true in the schema

Workarounds Considered

  • PreToolUse hooks: Can modify updatedInput but this changes both display AND execution — can't truncate for display only
  • PostToolUse hooks: Run after display, can't modify what was shown
  • Writing code to a file first: Adds an extra step but the messy MCP call display still appears
  • Settings/config: No options exist for MCP tool rendering

None of these solve the core problem.

Impact

Any MCP tool that accepts large structured input (code, JSON configs, templates) is affected. As MCP adoption grows, more tools will hit this — it's not specific to any single plugin.

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 Feature Request: Improve MCP tool call rendering in terminal