Skip to content

MCP tool output not visible in UI — GenericTool ignores output prop #15825

Closed as not planned

Description

@cpkt9762

Bug Description

MCP tools' output is invisible in the UI. When any MCP tool executes and returns results, the output is consumed by the LLM correctly but never rendered to the user in the terminal/app.

Root Cause

The GenericTool component in packages/ui/src/components/message-part.tsx (line 159-161) is the fallback renderer for all tools without a dedicated registered renderer — which includes all MCP tools.

export function GenericTool(props: { tool: string; status?: string; hideDetails?: boolean }) {
  return <BasicTool icon="mcp" status={props.status} trigger={{ title: props.tool }} hideDetails={props.hideDetails} />
}

Problems:

  1. Type signature only accepts { tool, status, hideDetails } — no output prop
  2. No children passed to BasicTool — so there's no expandable content area
  3. Even though ToolPartDisplay (line 1041) passes output={part.state.output} to the rendered component, GenericTool silently drops it

In contrast, built-in tools (bash, grep, glob, list, etc.) all register custom renderers via ToolRegistry.register() that explicitly render props.output.

Steps to Reproduce

  1. Configure any MCP server in OpenCode
  2. Have the agent call any MCP tool
  3. Observe the UI — only the tool name is shown (with MCP icon), no output content

Expected Behavior

MCP tool output should be visible and expandable, similar to how built-in tools display their results.

Suggested Fix

Update GenericTool to accept and render the output prop:

export function GenericTool(props: ToolProps) {
  return (
    <BasicTool icon="mcp" status={props.status} trigger={{ title: props.tool }} hideDetails={props.hideDetails}>
      <Show when={props.output}>
        {(output) => (
          <div data-component="tool-output" data-scrollable>
            <Markdown text={output()} />
          </div>
        )}
      </Show>
    </BasicTool>
  )
}

Affected Files

  • packages/ui/src/components/message-part.tsx — GenericTool component (line 159)
  • packages/ui/src/components/basic-tool.tsx — GenericTool export (line 159)

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 3, 2026
  2. github-actions commented on Mar 3, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  3. Femumme commented on Apr 10, 2026

    @Femumme

    Hey, I'd like to work on this — it's been really annoying me :D I use the context-mode MCP and not being able to see the output of commands is kinda odd. That way I just have to trust how the LLM interprets the output.

    Happy to put up a PR for it.

  4. Femumme commented on Apr 11, 2026

    @Femumme

    Hey, I just noticed that a PR has already been raised before - sorry about that! My approach is a little bit different to the previous PR tho, with a slightly different rendering mechanism more targeted at command outputs (Screenshots are attached in the PR).

  5. assigned and unassigned on Apr 26, 2026
  6. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  7. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions