Skip to content

Connect shadcn/ui to OpenCode

Copy-in React components built on Radix and Tailwind. Its MCP server browses, searches and installs items from the default and any namespaced community registry.

MCP serverOfficialChecked 2026-11-16

Before you start

  1. Step 1: Add shadcn/ui to OpenCode

    Add it from the terminal

    Run this in your project folder. It saves the server to the project's opencode.json.

    Terminal
    opencode mcp add shadcn -- npx -y shadcn@latest mcp

    Or edit the config file

    Add this to opencode.json at the project root.

    opencode.json
    {
      "$schema": "https://opencode.ai/config.json",
      "mcp": {
        "shadcn": {
          "type": "local",
          "command": [
            "npx",
            "-y",
            "shadcn@latest",
            "mcp"
          ],
          "enabled": true
        }
      }
    }
  2. Step 2: Check it's connected

    Terminal
    opencode mcp list

    Start OpenCode in the project; the server's tools are available to the agent straight away.

  3. Step 3: Try a first request

    Ask OpenCode something that only works with shadcn/ui connected:

    Say to OpenCode
    Search the shadcn registry for a date picker and give me the command to add it to this project.

If it doesn't work

  • OpenCode reads opencode.json from the project root, or ~/.config/opencode/opencode.json for every project.
  • Environment variables use the {env:NAME} syntax inside the config file.
  • Servers that need a sign-in: run opencode mcp auth <name>.