Skip to content

MCP

Connect the shadcn MCP server to the Silkware registry so a coding agent can browse, search and install components.

The shadcn MCP server works with any shadcn-compatible registry, so it needs nothing special from Silkware beyond the registry itself. Once it is connected, an agent in your editor can list the items in @silkware, search them, read their source and dependencies, and add them to your project through the CLI.

The server keeps shadcn's name, in .mcp.json and in /mcp, because it is shadcn's tool. What it serves in your project is Silkware. The CLI behind it can also install from shadcn's own registry; the agent rules say when that is allowed.

What the server needs

  • The @silkware namespace in your components.json. See Registry.
  • A registry index at /r/registry.json. pnpm registry:build writes it together with every item.

Connect

  1. Register the namespace

    pnpm dlx shadcn@latest registry add "@silkware=http://localhost:3000/r/{name}.json"
  2. Add the server to your client

    For Claude Code, the command writes .mcp.json in the project:

    pnpm dlx shadcn@latest mcp init --client claude

    The file it writes:

    {  "mcpServers": {    "shadcn": {      "command": "npx",      "args": ["shadcn@latest", "mcp"]    }  }}

    Other clients use --client cursor, --client vscode or --client opencode. For Codex, add the same command to ~/.codex/config.toml:

    [mcp_servers.shadcn]command = "npx"args = ["shadcn@latest", "mcp"]
  3. Restart the client

    Restart Claude Code, then run /mcp to confirm that the shadcn server is connected. The same command helps when something fails.

What an agent can do

  • List the items in the registry: "Show me the components in the silkware registry".
  • Search by name or description: "Find a component for a conversation thread".
  • Read an item before installing it: its files, its npm dependencies and the other items it needs.
  • Install items, with their dependencies, into your project.
  • Build a page from several items: "Create a settings page using items from the silkware registry".

The same lookups work from the command line, which is a quick way to check the registry without an agent:

pnpm dlx shadcn@latest search @silkware --query sidebarpnpm dlx shadcn@latest view @silkware/button

The agent installs what the registry lists. It does not know how Silkware expects components to be used. Give it the agent rules too: see Agents.