Skip to content

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

@cpkt9762

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.tsxGenericTool component (line 159)
  • packages/ui/src/components/basic-tool.tsxGenericTool export (line 159)

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions