Search

Search components and blocks

Sign in

Guides

AI Agents

Let your coding agent use DitherUI directly. It can search the library, read a component's source and props, and install it into your project without you copying anything. Each item's meta.tier says whether it is free or premium.

MCP server

Coming soon

A remote MCP server for All-Access members. Create an API key on your profile page, then add the server to Claude Code with one command, or to any client that supports HTTP MCP servers.

Shell
claude mcp add --transport http ditherui https://mcp.ditherui.dev/mcp --header "Authorization: Bearer <your-api-key>"
JSONmcp.json
{
  "mcpServers": {
    "ditherui": {
      "type": "http",
      "url": "https://mcp.ditherui.dev/mcp",
      "headers": { "Authorization": "Bearer <your-api-key>" }
    }
  }
}
  • list_components

    The full catalog: name, title, kind (component, agent, block) and tier.

  • search_components

    Filter the catalog by name, description or kind.

  • get_component

    One item with its source files, dependencies, props table and usage snippet.

  • get_install_command

    The shadcn command that installs an item and everything it needs.

Agent sign-in

An agent can sign in on its own with the OAuth 2.0 device flow (RFC 8628), no API key to copy. Discovery documents live at /.well-known/oauth-authorization-server and /.well-known/oauth-protected-resource. Request a code, show the user the link, and poll until they approve it on /device.

Shell
curl -X POST https://ditherui.dev/api/auth/device/code \
  -H "content-type: application/json" \
  -d '{"client_id":"my-agent"}'

The response holds a user_code, a verification_uri_complete to show the user and an interval in seconds. Poll the token endpoint no faster than that. It answers authorization_pending until the user approves, then returns anaccess_token to send as Authorization: Bearer to the registry.

Shell
curl -X POST https://ditherui.dev/api/auth/device/token \
  -H "content-type: application/json" \
  -d '{"grant_type":"urn:ietf:params:oauth:grant-type:device_code","device_code":"<device_code>","client_id":"my-agent"}'

Registry

Every item is a standard shadcn registry item, so the CLI can install it directly. Add the namespace to components.json once, then install by name.

JSONcomponents.json
{
  "registries": {
    "@ditherui": {
      "url": "https://ditherui.dev/r/{name}.json",
      "headers": { "Authorization": "Bearer ${DITHERUI_API_KEY}" }
    }
  }
}
Shell
pnpm dlx shadcn@latest add @ditherui/switch
  • /r/index.json — The registry index: every item with its kind, tier and docs link.
  • /r/{name}.json — A shadcn registry item: files with their full source, npm and registry dependencies, props and usage under meta.
  • /llms.txt — A markdown index of the whole library for LLMs.

How an agent installs a component

  1. 1. Discover

    Read /r/index.json (or call list_components) to find the right item.

  2. 2. Fetch

    Request /r/{name}.json for its files, dependencies, props and usage.

  3. 3. Write

    Save the files into the project. Helper files ship inline, so there are no nested imports to chase.

  4. 4. Install

    Install the listed npm packages. Registry dependencies resolve to other items the CLI adds for you.