Feature request: allow folding verbose MCP tool result bodies in the Codex CLI TUI

Open 💬 1 comment Opened Jun 4, 2026 by sandynz

What variant of Codex are you using?

CLI

What feature would you like to see?

I would like the Codex CLI TUI to support folding or hiding verbose MCP tool result bodies in the main conversation history, while preserving the full result for the model and for explicit transcript inspection.

Today, Codex CLI TUI renders MCP tool result text directly in the conversation history after each MCP call. For tools that return file contents, the visible transcript can be dominated by tool result bodies:

• Called jetbrains-mcp.read_file(...)
  └ L1: ...
    L2: ...
    ...

This makes it difficult to read the assistant's higher-level messages. The issue is especially visible when the agent must load several skill, instruction, or project context files: those reads are legitimate and should not be artificially shortened, but their result bodies still flood the visible TUI history.

Reasonable designs:

  • Default collapsed MCP result body:

``text
• Called jetbrains-mcp.read_file(...) 58 lines, 9.2 KB
Press <key> or open transcript to view result
``

  • Config option, for example:

``toml
[tui]
fold_mcp_tool_results = "auto" # auto | always | never
mcp_tool_result_preview_lines = 1
``

  • Per-cell expand/collapse interaction in the transcript/history view.

Important distinction: this should be a display feature. It should not truncate or hide tool results from the model context, and it should not encourage agents to under-read required skill/instruction files.

Additional information

Local environment where this was observed:

Codex CLI: 0.135.0
Platform: Windows 11 Professional x64
Terminal: Windows Terminal / PowerShell
MCP server example: JetBrains MCP through stdio router

Reproduction outline:

  1. Configure any MCP server that exposes a file-reading tool. A JetBrains MCP server is one example.
  2. Start Codex CLI in TUI mode.
  3. Ask the assistant to read a file through MCP, for example a skill or project instruction file.
  4. Observe the conversation history after the MCP call.

Source check against current main suggests this is not currently configurable:

  • McpToolCallCell::display_lines() renders CallToolResult.content directly into history detail lines.
  • TOOL_CALL_MAX_LINES limits visible result height but still shows the body by default.
  • /raw / tui.raw_output_mode is for copy-friendly transcript selection and does not solve this compact-history use case.

This issue is about TUI readability and operator ergonomics, not MCP correctness.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗