Skip to content

shadcn/ui in Amazon Q Developer CLI

Add one entry to ~/.aws/amazonq/mcp.json and q chat can look up shadcn components, blocks and icons, then install them in your project. It needs shadcn.io Pro.

Kind
Terminal agent
Goes in
~/.aws/amazonq/mcp.json
Connects
Through mcp-remote
Team config
Yes

Add it to ~/.aws/amazonq/mcp.json

Amazon Q starts each MCP server as a local command, so the entry runs mcp-remote with npx to reach shadcn.io over HTTP. Once you're signed in with Pro, the config next to these steps has your own URL in it.

  1. Copy the entry

    It runs npx -y mcp-remote with your MCP URL, token included, as the last argument. If you don't have a token yet, generate one on your account page first.

  2. Merge it into mcp.json

    Open ~/.aws/amazonq/mcp.json, or create it if it isn't there. Put shadcnio inside mcpServers, next to any servers you already have, and save.

  3. Or let q mcp add write it

    q mcp add --name shadcnio --command npx with --args set to a JSON array of -y, mcp-remote and your URL writes the same entry to the global file. --scope workspace writes .amazonq/mcp.json instead.

  4. Start a new q chat

    Amazon Q reads mcp.json when a session starts, so leave any open one with /quit and run q chat again. This machine needs Node.js, since npx fetches mcp-remote on the first run.

~/.aws/amazonq/mcp.json
Sign in to get your config
Sign in with a Pro account, and this holds your MCP URL, ready to paste.

How it reads, with YOUR_TOKEN where your token goes:

{
  "mcpServers": {
    "shadcnio": {
      "args": [
        "-y",
        "mcp-remote",
        "https://www.shadcn.io/api/mcp?token=YOUR_TOKEN"
      ],
      "command": "npx"
    }
  }
}

~/.aws/amazonq/mcp.json lives in your home folder, outside every repo, and its args hold your token. Amazon Q in VS Code and JetBrains reads the same file while useLegacyMcpJson is on, as it is by default.

Where Amazon Q reads MCP servers from
FileApplies toGood to know
~/.aws/amazonq/mcp.jsonEvery project on this machine, in the CLI and the IDEHolds your token, so it stays out of git
.amazonq/mcp.json at the repo rootThis workspace onlyWins over the global file when both define shadcnio
mcpServers in an agent file under ~/.aws/amazonq/cli-agents/Sessions started with q chat --agent and that agent's nameSet useLegacyMcpJson to keep the mcp.json servers as well

Commit .amazonq/mcp.json for the team

Commit .amazonq/mcp.json at the repo root with the entry below. Where the token would go, it names SHADCNIO_TOKEN, so the repo never holds anyone's key: each teammate exports that variable in the shell they start q chat from. On a shadcn.io Team or Organization plan, each member's own token carries Pro.

.amazonq/mcp.json
{
  "mcpServers": {
    "shadcnio": {
      "args": [
        "-y",
        "mcp-remote",
        "https://www.shadcn.io/api/mcp?token=${SHADCNIO_TOKEN}"
      ],
      "command": "npx"
    }
  }
}

Each teammate sets SHADCNIO_TOKEN to their own token (from their MCP URL), so no token is committed.

Check it with /mcp and /tools

/mcp in a q chat session prints each server with its load messages, and lists any still loading. /tools shows what Amazon Q can call, with shadcnio's 22 tools under its name.

  1. Run q chat in a project. Servers load in the background, so you can type while shadcnio starts.
  2. Type /mcp and find shadcnio with its load messages, or under Still loading if it hasn't finished.
  3. Type /tools to see its 22 tools. Outside a session, q mcp status --name shadcnio prints its scope, command and timeout.
  4. Send the prompt below and press y when Amazon Q asks to run whoami: it answers with your account, your plan and this minute's remaining calls.
Prompt
use shadcnio to show the account and plan behind my token

What it looks like in q chat

An S3 upload, a Lambda card and a Vue region picker: the prompt, the calls Amazon Q makes and what ends up in the repo. Flip the MCP off and the same prompt runs on Amazon Q's memory alone.

Your agent
  1. shadcn.io MCP connected · 22 tools
  2. You: Add a drag-and-drop upload to the reports page that puts files in S3 through our presigned URL route.
  3. Agent step: Read src/app/api/upload-url/route.ts (fs_read)Returns: A route that signs S3 PUT URLs with the AWS SDK
  4. MCP call: search_blocks({ query: "upload to s3 with a presigned url", category: "file-upload" })Returns: file-upload-presigned-url ranked first
  5. MCP call: get_block({ name: "file-upload-presigned-url", include: ["install"] })Returns: One npx shadcn add command, your token in its URL
  6. Agent step: Ran npx shadcn add with execute_bash (you pressed y)Returns: The block, plus the progress and button parts it uses
  7. Your agent: The reports page now takes dropped files, shows each one's progress and uploads it through /api/upload-url.

In your project

Presigned upload

  • Drop zone, progress and retry from a real block
  • Wired to the signing route you already had

1 prompt → 2 MCP calls

Prompts to try in q chat

Paste one at the q chat prompt, or type /editor to write a longer one. Naming shadcnio keeps Amazon Q on the registry instead of its memory.

01
use shadcnio to add a drag-and-drop upload that sends files to S3 through a presigned URL
02
use shadcnio to build an ops page for our Lambda functions from its monitoring blocks
03
use shadcnio to put a combobox on the region field in src/components/DeployForm.tsx
04
use shadcnio to plan a pricing page from blocks and show me the plan before you write any files
05
use shadcnio to replace the hand-built modal in billing settings with its dialog
06
use shadcnio to restyle our internal console after AWS's DESIGN.md
07
use shadcnio to swap the emoji in the sidebar for Lucide icons
08
use shadcnio to set up this SvelteKit app for shadcn.io components, then add a data table

Amazon Q specifics

What's particular to Amazon Q: its approval prompt, rules files, agents, the wait at start-up, scripted runs and the IDE plugin.

  • Trust the shadcnio tools

    The default agent trusts only fs_read, so Amazon Q stops before each shadcnio call and asks [y/n/t]. Press t to trust that tool for the session, or launch with all of the server's tools trusted.

    $ q chat --trust-tools=fs_read,@shadcnio
  • A rule in .amazonq/rules

    The default agent loads AmazonQ.md, README.md and every Markdown file under .amazonq/rules/ into each session. Put one line there and you can stop naming the server in prompts.

    For any UI change, ask the shadcnio MCP for the component, block or icon first, and install it with the command it returns.
  • An agent for UI work

    Save this as ~/.aws/amazonq/cli-agents/ui.json and start it with q chat --agent ui. useLegacyMcpJson keeps your mcp.json servers, and allowedTools trusts shadcnio in every session.

    {
      "description": "UI work with the shadcn registry",
      "tools": ["*"],
      "allowedTools": ["fs_read", "@shadcnio"],
      "useLegacyMcpJson": true
    }
  • Give it time to load

    Servers load in the background, and mcp.initTimeout sets how many milliseconds Amazon Q waits for them before your first prompt. The first npx run downloads mcp-remote, so a slow network may need longer.

    $ q settings mcp.initTimeout 20000
  • Scripted runs

    q chat --no-interactive takes the prompt as an argument and can't stop to ask, so trust what the job needs up front: the server, file writes and the shell.

    $ q chat --no-interactive \
      --trust-tools=fs_read,fs_write,execute_bash,@shadcnio \
      "use shadcnio to add a skeleton to the invoices list"
  • The same server in your IDE

    Amazon Q in VS Code and JetBrains picks up the same mcp.json. In the Chat panel, the tools icon lists shadcnio, and each of its tools can be set to Ask, Always allow or Deny.

When shadcnio won't load

What Amazon Q shows when shadcnio fails, and what to do about it. Problems common to every client are in the troubleshooting guide.

/mcp doesn't list shadcnio at all.
Either q chat was already running when you saved, or shadcnio isn't inside mcpServers. Check the file parses as JSON, then /quit and run q chat again. In a custom agent, check that useLegacyMcpJson is true.
shadcnio fails to load and prints an error.
Read what mcp-remote prints as q chat starts. An old token is the usual cause: copy the entry again from this page or your dashboard. A 403 there means the account has no active Pro plan; renew it on pricing.
shadcnio never comes up, with no error from mcp-remote.
npx comes with Node.js. Run node --version in the shell you start q chat from, and if it fails, install Node.js and open a new terminal.
/mcp says MCP functionality has been disabled by your administrator.
Your Q Developer Pro admin turned MCP off in the profile, or allows only the servers in an MCP registry. Ask them to switch it back on, or to add shadcn.io to that registry.
On Windows, the server doesn't start.
Run npx through cmd: set command to cmd and start args with /c and npx, before -y, mcp-remote and your URL. MCP clients has the whole entry.
Amazon Q writes a component from memory instead.
Name the server (use shadcnio to…) and ask for something specific. A rule under .amazonq/rules/ makes that the default, and Kiro has the setup if you've moved to Kiro CLI.

Get the MCP for Amazon Q with Pro

The MCP comes with every Pro plan, with every block and premium template, for you or your whole team. Monthly, yearly or lifetime.

4.9/5 out of 5 · 150+ reviewsfrom 150+ founders and developers.

  • Secure checkout via Stripe
  • Code lives in your repo
  • Keep what you've shipped if you cancel
  • License terms

Frequently asked questions

The shadcn MCP in Amazon Q: setup, limits, and the rest.

4.9 out of 5 from 150+ developers

Use the registry from q chat

Every component, 6,231 blocks and 294k icons, one mcp.json entry away from your next `q chat` session, with shadcn.io Pro.

Get Pro