Skip to content
AgentsMCP toolMenu

MCP tool

A call to a tool on an MCP server or connector: the server with its mark, the tool name, input and output, with approval.

Server, tool name, input and output, with approval.

Installation

$ pnpm dlx shadcn@latest add https://chatcn.dev/r/tool-mcp.json

Usage

tsx
import { ToolMcp } from "@/components/ui/chatcn/tool-mcp"

<ToolMcp server="Linear" tool="create_issue" icon={<LinearMark />} state="output-available" input={input} output={output} />

chatcn ships no provider logos; pass your connector's mark as icon. renderToolPart routes every mcp__server__tool name to the mcp entry, and text content in MCP results renders as text.

Props

PropTypeNotes
serverstringConnector or server name
toolstringTool name on that server
iconReactNodeConnector mark. Defaults to a plug
input, inputText, outputAs on ToolCall
stateToolDisplayStateThe ToolCall lifecycle: streaming, running, approval, output, error, denied, cancelled
approval, decisionApproval request and the user's answer, as on ToolCall
onApprove, onDeny, onRetrySame callbacks as ToolCall
errorTextReactNodeShown on output-error
durationMs, startedAtnumberOptional. Measured automatically when omitted
variant"card" | "inline"Inline sits on a trace rail
open, defaultOpen, onOpenChangeControlled or uncontrolled details

Keyboard

KeyAction
Enter, SpaceExpand or collapse the details
TabMove through the header, links, copy buttons and approval actions

Motion

  • Inherits ToolCall: the status glyph swaps with a 150 ms blur crossfade and details open over 200 ms.
  • Nothing inside the body animates. Under reduced motion everything snaps.