MCP
Use onchain-ui with AI assistants through the shadcn MCP server.
The shadcn MCP server lets AI assistants browse and install onchain-ui components. It reads the component index at /r/registry.json.
Setup
onchain-ui is listed in the shadcn registry directory, so one command registers the @onchain-ui namespace in your project's components.json:
npx shadcn registry add @onchain-uiOr add it by hand:
{
"registries": {
"@onchain-ui": "https://onchain-ui.dev/r/{name}.json"
}
}Then initialize the MCP server for your client:
npx shadcn mcp init --client claudeUse --client cursor, --client vscode, or --client codex for other assistants. The MCP server reads your components.json and makes each configured registry available to the assistant.
Usage
After connecting the MCP server, try these prompts:
- "Show me the components available in the onchain-ui registry"
- "Install the asset-row component from @onchain-ui"
- "Build a portfolio card using @onchain-ui/asset-row and @onchain-ui/token-price"
The namespace also works with the CLI directly:
npx shadcn add @onchain-ui/asset-rowEach registry item lists its description and dependencies. Installing asset-row also installs its token components, formatting utilities, and shadcn tooltip dependency.