MCP ConnectorsPRO
A panel for connecting MCP servers: a handshake while connecting, a rolling tool count, tools that cascade in and an add-server form.
Code
4 files · 666 lines of TypeScriptPRO
MCP Connectors is part of Pro
Get its source, the one-paste agent prompt and all 113 components, for a one-time $99.
Motion notes
- While connecting, a packet shuttles between client and server dots and the label shimmers: the wait reads as two sides talking, not a generic spinner.
- On connect the tool count rolls up from zero, digit by digit, on the emphasis spring, so a successful handshake has a clear payoff.
- Expanding a server cascades its tools in as chips with a tight stagger. The panel height follows a zero-bounce layout spring, so rows below never overshoot.
- The add-server trigger and form cross-collapse on one spring. Focus moves into the form and back only when a person opened or closed it, never on a controlled change. Status changes are announced. With reduced motion, chips and the handshake are static.
Usage
Example
<McpConnectors
servers={servers}
onToggle={(id, on) => (on ? connect(id) : disconnect(id))}
onRetry={connect}
onAdd={({ name, url }) => addServer(name, url)}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| servers | McpServer[] | — | { id, name, url, transport: "stdio" | "http" | "sse", auth?: "none" | "oauth" | "token", status: "disconnected" | "connecting" | "connected" | "error", tools?, error?, icon? } |
| onToggle | (id: string, connect: boolean) => void | — | The switch was flipped. Move the server to connecting or disconnected. |
| onRetry | (id: string) => void | — | Retry pressed on a server in the error state. |
| onAdd | (draft: McpDraft) => void | — | The add-server form was submitted with { name, url }, trimmed. |
| expandedId | string | null | — | Controlled expanded server. Leave it out for uncontrolled use. |
| defaultExpandedId | string | null | null | Initially expanded server. |
| onExpandedChange | (id: string | null) => void | — | Called when a connected server is expanded or collapsed. |
| adding | boolean | — | Controlled open state of the add-server form. |
| defaultAdding | boolean | false | Start with the form open. |
| onAddingChange | (adding: boolean) => void | — | Called when the form opens or closes. |
| draft | McpDraft | — | Controlled form values { name, url }. |
| onDraftChange | (draft: McpDraft) => void | — | Called on every keystroke in the form. |
| title | string | "MCP servers" | Panel heading and accessible name. |
| className | string | — | Classes for the panel. |