Documentation
With a paid plan, you can add AI Components to your project's shadcn registries. Your coding agent can then list, search and install them through the shadcn MCP server, and you can install them by name from the CLI. Nothing runs on our side except the registry: the MCP server runs on your machine.
1. Create a registry token
Open Account and select Create token. Copy the token now. It is shown once.
Add it to your project's .env.local (or .env), and keep that file out of git:
AISDK_AGENTS_TOKEN=aisdk_rt_...2. Add the registry to components.json
{
"registries": {
"@aisdkagents": {
"url": "https://www.aisdkagents.com/pro-registry/{name}",
"headers": {
"Authorization": "Bearer ${AISDK_AGENTS_TOKEN}"
}
}
}
}The CLI reads ${AISDK_AGENTS_TOKEN} from your environment when it sends a request, so components.json can be committed safely. The token itself never goes in it.
3. Connect your coding agent
pnpm dlx shadcn@latest mcp init --client claude
Use cursor, vscode, codex or opencode for other clients. Then ask your agent things like:
- "Show me the AI Components for agent approvals."
- "Add @aisdkagents/chat-screen to this app."
When the MCP server cannot find the token
The MCP server reads components.json and .env.local from the folder it starts in. A project-level config like the one above starts it in your project. A global config, or a monorepo where the app lives in a subfolder, may start it somewhere else. The agent then reports an unknown @aisdkagents registry or a missing AISDK_AGENTS_TOKEN.
Start the server in your app's folder instead:
{
"mcpServers": {
"shadcn": {
"command": "sh",
"args": ["-c", "cd /path/to/your/app && npx shadcn@latest mcp"]
}
}
}On Windows, use "command": "cmd" with ["/c", "cd /d C:\\path\\to\\your\\app && npx shadcn@latest mcp"]. The token stays in the app's .env.local. Never put it in an MCP config file, which is often committed to git.
Install from the CLI
pnpm dlx shadcn@latest add @aisdkagents/chat-screen
AI Components that build on other AI Components install those too.
Keeping it private
- Every request is checked against your token and your current plan. If your access ends, the token stops working.
- Only AI Components are available through this registry. The list your agent sees has names and descriptions; source is sent one component at a time.
- You have one token at a time. Creating a new one replaces the old one. If a token leaks, revoke it in Account.
- Requests are limited per member per day, so a shared token is noticed and throttled.
Troubleshooting
| Message | Fix |
|---|---|
RegistryMissingEnvironmentVariablesError | AISDK_AGENTS_TOKEN is not set in the shell or env file the CLI reads. From an agent, see When the MCP server cannot find the token. |
REGISTRY_TOKEN_INVALID | The token was revoked or mistyped. Create a new one in Account. |
REGISTRY_PLAN_REQUIRED | The account behind the token no longer has a paid plan. |
REGISTRY_RATE_LIMITED | Too many requests today. Try again tomorrow. |
See Install with shadcn CLI for the copy-a-command install path.
ai sdk blocks.