ISSUE 067  ·  17 NOVEMBER 2026 ELEN RSS
CodeCity
DESIGN № 0057

shadcn-ui-mcp-server: the assistant reads the component code instead of guessing it

shadcn-ui-mcp-server: ο βοηθός διαβάζει τον κώδικα των components, δεν τον μαντεύει

shadcn-ui-mcp-server: the assistant reads the component code instead of guessing it

What it does

You have watched an assistant build you a button with the wrong height, the wrong colour, the wrong variant. It does not do it out of carelessness. It writes from memory, and its memory does not know what the component looks like today. shadcn-ui-mcp-server exists to give it eyes.

Two words first, because without them the rest makes no sense. MCP is a protocol that lets an AI assistant connect to external tools inside the conversation; the assistant does not know them in advance, it discovers them at the start of a session. shadcn/ui is a set of ready-made web components — buttons, dialogs, tables — with one difference: you do not install it as a library. It copies the code into your own project.

So this server installs nothing. It reads. It goes to the shadcn/ui v4 repositories and brings the assistant the source code, the usage demos, the blocks (ready-made page assemblies such as dashboards and forms) and the metadata. It works with four ecosystems: shadcn/ui for React, plus shadcn-svelte, shadcn-vue and react-native-reusables, selected with the --framework flag (repository).

It is not the same tool as the official shadcn MCP server, which talks to registries and generates an install command for you. That one tells you “add this”; this one opens the code and shows it. They are complementary, not rivals, and we say so because the two are easily confused.

It exposes ten tools, and I watched it declare them on our machine: get_component, get_component_demo, list_components, get_component_metadata, get_directory_structure, get_block, list_blocks, apply_theme, list_themes, get_theme. Nine of them read. The tenth writes, and we will get to it in due course.

Who it is for

For anyone building interfaces with shadcn/ui who is tired of correcting the assistant. The beginner who heard the word “agent” last week will grasp the benefit from the first question: instead of an imaginary button, the assistant hands over the button that sits in the official repository today, with all its variants. The professional gains something more specific: no more fixing props and names that changed.

It shines when you work in React and need complex blocks, or when your project has moved to Svelte, Vue or React Native and you want one tool building components for all of them. And it shines when you want to set up nothing — no account, no key.

It is not for you if you do not work with shadcn/ui. The server has no other material. And it is not for you if you want the assistant to install a component with one command; that is the official shadcn MCP server’s job, not this one’s.

Install

You want Node 20 or newer; the package declares it in its engines field (the Docker image, for its part, uses Node 22). npx ships with Node, so you install nothing by hand.

You tell your client to run the server, you restart, and you ask. You download no file, you open no key. npx pulls the package on first run — on our measurement, 40 MB across 4,274 files.

The -y flag tells npx not to wait for confirmation. Without a GitHub token you get 60 requests an hour; with a scope-free personal GitHub token, 5,000 (repository). Without a key, our test ran fine.

Using it per LLM

Here the server is an MCP server, so you speak its shape: one configuration entry, naming the executable and its arguments. The general shape is the same everywhere — an mcpServers object with one key, holding command set to npx and args set to -y and @jpisnice/shadcn-ui-mcp-server. What changes from client to client is the file and the format. I drove no session inside any of them; the steps are documentation, except where I say otherwise.

Claude Code

Claude Code has its own command, and it is the cleanest path:

claude mcp add shadcn-ui -- npx -y @jpisnice/shadcn-ui-mcp-server

Then restart and check with claude mcp list, or inside a session with /mcp. You are looking for the line shadcn-ui: Connected. If you do not see it, the usual cause is a restart you skipped.

Codex CLI

Codex has no helper command; the configuration goes into ~/.codex/config.toml by hand. You add an mcp_servers.shadcn_ui section declaring command = "npx" and args = ["-y", "@jpisnice/shadcn-ui-mcp-server"]. It is the same configuration, in TOML rather than JSON. I did not run that path to the end — we have no Codex on our machine.

Cursor

Cursor reads .cursor/mcp.json at the project root, or ~/.cursor/mcp.json for every project. You write the mcpServers object with the server into it, and then — do not skip this step — you open Cursor Settings and enable the server. Cursor does not start servers just because the file exists. Once enabled, you see a green dot next to the name and the list of tools.

One note for all of them: after setup you ask something like “give me the source code of the button from shadcn/ui v4”. If nothing comes back, the two usual causes are the forgotten restart and the configuration written into the wrong file.

Where it wins, where it loses

It wins on the core point: the assistant sees the real code, not its recollection of it. get_component button returned 2,546 characters with every variant — default, destructive, outline, secondary, ghost, link. That is the end of fixing props that changed.

It wins on breadth. Four ecosystems from one tool, and two primitive libraries for React (Radix and Base). It wins on price: no account, no key, no subscription. And it wins on speed — startup of 1.6 seconds on our measurement.

Now where it loses.

First, apply_theme writes. Of the ten tools, nine read; this one changes the theme in your project, from tweakcn’s ready-made presets. That is not a flaw — it is simply the one tool that leaves a mark. So you run it in a project, not in your client’s copy, and you commit first.

Second, it needs the network. Every component is fetched live from GitHub. Offline it has nothing, and without a GitHub token the limit is 60 requests an hour — enough for a test, little for heavy work.

Third, it compresses nothing. Every component enters the context whole. The button is 2,546 characters; a block is far larger. If the assistant pulls three blocks to answer one question, you pay for all of them.

And the security caveat, which we do not hide. Two independent checks disagree, and both are looking at the same code. M8ven gives it A, 98/100, with the verdict “code clean and strongly established adoption”, ten tools counted, and no secrets in the source. ModelsAtlas blocks it at D, 69/100 and records two high-severity findings. Both are the same thing: new Function evaluating text as code, on lines 92 and 118 of src/tools/tweakcn/fetch-presets.ts. It is the code that reads theme presets, and the technique is a known code-injection pattern. One check walks past it, the other scores it as a failure. We take no side: we report what each found, because the reader must know before putting it to work on a client. The code lives behind one person, under the MIT licence.

Testing

Everything below we ran on Windows 11, on a Dell Inspiron 3576, with no graphics card. I stood up no agent session inside Claude Code, Codex or Cursor; what was tested, was tested in the shell and over the protocol.

First the version. npx -y @jpisnice/shadcn-ui-mcp-server --version printed 3.0.0, as declared on npm.

Then the most convincing part, which most write-ups skip: I brought the server up by hand, speaking JSON-RPC over standard input. On initialize it declared serverInfo with the name shadcn-ui-mcp-server and version 3.0.0, and agreed on the 28 July 2026 MCP protocol. tools/list returned 10 tools: get_component, get_component_demo, list_components, get_component_metadata, get_directory_structure, get_block, list_blocks, apply_theme, list_themes, get_theme.

And then a real call, with no GitHub token. get_component button returned 2,546 characters of source code, with every variant inside: default, destructive, outline, secondary, ghost, link. list_components returned 61 components. Startup time: 1.6 seconds. The promise holds: the assistant does not guess, it reads.

What I did not run, and I say so plainly. I did not try apply_theme on a live project, to avoid changing the theme of one of ours; everything I write about it comes from the documentation and from the tools’ own declarations. I did not go through Codex. And the repository figures — 3,069 stars, 315 forks, 7 open issues, MIT licence, last push on 3 October 2026 — were read by our research, together with the 16,454 npm downloads for the month of 23 September to 22 October 2026 and the two security-check pages we saw above.

What it costs

The model. Our own figure: the schema of the ten tools is 3,890 characters, about 972 tokens, and it loads into every session that has the server open — even when you never ask for a component. It is a tax, not a charge: you pay it once per session, at the start.

The machine. Our own figure: 40 MB on disk across 4,274 files on first download, and ~83 MB of memory (RSS) with one node process running. Vendor claim: it wants Node 20+, as its engines field declares.

In money, nothing. No key, no subscription, no card. The optional GitHub token costs nothing; it merely raises the limit from 60 to 5,000 requests an hour — a vendor claim, from the repository’s documentation.

And one observation of our own, from research: the M8ven page that gave us the 98/100 was cached on 6 October 2026, and the check itself flags it as too old to display. The grade holds for what it saw then, not necessarily for the code you download today.

Verdict

Score: 8.2/10.

shadcn-ui-mcp-server solves a problem you feel before you can name it: your assistant builds components that do not look like today’s. It solves it by giving the agent the real source code, free, with no key, under ten clean names. get_component button returned 2,546 characters across six variants; list_components, 61 components; startup, 1.6 seconds. And --version says 3.0.0, as on npm.

It loses its two points in three places. apply_theme writes, so it needs care. It needs the network and, with no key, has a low limit. And it compresses nothing: every component enters the context whole. Above all these sits the security caveat: M8ven A/98, ModelsAtlas D/69, with two code-injection findings that one check walks past and the other scores as a failure. We take no side; we state it, and leave it to your judgement.

If you work with shadcn/ui and an agent, try it on a project of your own, not on a client’s, and read the ModelsAtlas page first.

Sources: repository https://github.com/Jpisnice/shadcn-ui-mcp-server · npm package https://www.npmjs.com/package/@jpisnice/shadcn-ui-mcp-server · releases https://github.com/Jpisnice/shadcn-ui-mcp-server/releases · M8ven check https://m8ven.ai/check · ModelsAtlas check https://modelsatlas.com/mcp/jpisnice/shadcn-ui-mcp-server/ · shadcn/ui https://ui.shadcn.com/