McpImportDialog

Import MCP servers found in another client's configuration. Every candidate is selected initially and shows its transport and target (command or URL). Names that collide with existingNames (case-insensitive) get a _1, _2 suffix, marked Renamed, and stay editable; invalid, taken or duplicate names block the Import button with a message under the field. onImport receives the selected servers with their final names. While its promise is pending the button shows a loader and the inputs are disabled; a rejection keeps the dialog open with the message in an alert; on success the dialog closes. With an empty servers list the dialog shows an empty state. The rename and validation rules are exported as resolveImportNames and validateImportNames, so you can apply the same rules on the server side.

Getting Started
$pnpm add @sinups/ai-kit @mantine/core @mantine/hooks @tabler/icons-react
Examples
Import with renames
Empty
API reference
Prop
Type
Required
opened
boolean
Yes
Whether the dialog is open
onClose
() => void
Yes
Called when the dialog is dismissed, cancelled or after a successful import
sourceLabel
string
Yes
Name of the client the servers come from, for example `Desktop client`
servers
McpServerCandidate[]
Yes
Servers found in the other client
existingNames
string[]
No
Names of configured servers, compared case-insensitively; colliding imports are renamed `name_1`, `name_2`
onImport
(servers: McpServerCandidate[]) => void | Promise<void>
Yes
Called with the selected servers carrying their final names; a rejected promise keeps the dialog open and shows the message
labels
Partial<McpImportDialogLabels>
No
Title, button and validation message overrides