MCP Components
React components designed for seamless integration with MCP tools. Each component provides built-in loading states, error handling, and host theming support.ToolButton
Button that executes an MCP tool on click with optional confirmation, loading states, and result display.Basic Usage
With Result Display
With Confirmation Dialog
Props Reference
| Prop | Type | Description |
|---|---|---|
tool | string | ToolBinding | Tool name or binding config |
args | Record<string, unknown> | Arguments to pass to the tool |
resultDisplay | 'inline' | 'toast' | 'modal' | 'none' | How to display results |
confirm | boolean | ConfirmConfig | Show confirmation before executing |
variant | 'default' | 'destructive' | 'outline' | 'ghost' | Button style variant |
loadingText | string | Text to show while loading |
onToolSuccess | (result) => void | Called on successful execution |
onToolError | (error) => void | Called on error |
ToolDataGrid
Data grid with server-side pagination, sorting, and row actions - all powered by MCP tools.Basic Usage
With Row Actions
Props Reference
| Prop | Type | Description |
|---|---|---|
dataTool | string | ToolBinding | Tool to fetch data from |
columns | ToolDataGridColumn[] | Column definitions |
transformData | (result) => { rows, total } | Transform tool result to grid data |
rowActions | ToolDataGridRowAction[] | Actions for each row |
pagination | boolean | Enable pagination (default: true) |
defaultPageSize | number | Initial page size |
refreshInterval | number | Auto-refresh interval in ms |
onRowClick | (row, index) => void | Row click handler |
Column Definition
ToolForm
Form component that submits data to an MCP tool with built-in field types and validation.Basic Usage
Field Types
| Type | Description |
|---|---|
text | Standard text input (default) |
number | Numeric input with min/max |
email | Email input with validation |
password | Password input |
textarea | Multi-line text |
select | Dropdown selection |
checkbox | Boolean checkbox |
switch | Toggle switch |
slider | Range slider |
Props Reference
| Prop | Type | Description |
|---|---|---|
toolName | string | Tool to call on submit |
fields | ToolFormField[] | Field definitions |
submitText | string | Submit button text |
showSuccessToast | boolean | Show toast on success |
resetOnSuccess | boolean | Reset form after success |
onSuccess | (result) => void | Success callback |
onError | (error) => void | Error callback |
layout | 'vertical' | 'horizontal' | Form layout |
ToolSelect
Select component that can fetch options from a tool and/or trigger a tool on selection.Fetch Options from Tool
Call Tool on Selection
Props Reference
| Prop | Type | Description |
|---|---|---|
optionsTool | string | ToolBinding | Tool to fetch options from |
transformOptions | (result) => Option[] | Transform result to options |
onSelectTool | string | ToolBinding | Tool to call on selection |
argName | string | Argument name for selected value |
options | ToolSelectOption[] | Static options |
value | string | Controlled value |
onValueChange | (value) => void | Change handler |