Agents & MCP
ai2 treats AI agents as first-class consumers. If your agent speaks the shadcn MCP protocol, it already knows how to use this registry.
What agents get
- Searchable metadata. Every item states its variant matrix, intended use and dependencies in plain words, written to be read by models.
- A working example per component. All 51 components ship a
registry:exampleitem, so agents fetch real usage code instead of guessing props. - Deterministic installs. Dependencies, including the token theme, resolve automatically through
registryDependencies. - Copy prompt on every component page - a paste-ready brief (description, install command, usage, token rules) for any AI tool, MCP or not.
Set it up in your agent
Save tokens. Instead of describing a component from scratch, your agent pulls a finished one, with the variant matrix and token rules included, then adapts it to your project. First, register the @ai2 registry in your components.json:
{
"registries": {
"@ai2": "https://ai2.design/r/{name}.json"
}
}Then connect the shadcn MCP server. Pick your agent, choose the scope, and copy the steps:
Available in every project you open on this machine.
Run this in any terminal. The shadcn MCP is added to Claude Code with the user scope.
claude mcp add shadcn --scope user -- npx shadcn@latest mcpRestart Claude Code. The shadcn server loads and reads the @ai2 registry from your components.json.
Test it. Ask Claude:
OptionalSearch the @ai2 registry and install the button component.What the MCP server exposes
The shadcn MCP server gives the agent tools to list your configured registries, search and view items (name, description, files, docs), fetch usage examples, and produce the exact add command. ai2's metadata is written so each of those calls returns something a model can act on directly.
On the roadmap
An llms.txt index and markdown variants of every docs page are planned alongside the public deployment, so non-MCP agents can consume the documentation directly.