Skip to content

Primer already ships the Storybook MCP. Here’s what it fixed, and what it got wrong.

GitHub’s Primer is one of the first design systems to ship the official Storybook MCP in its own Storybook. In an earlier test, an AI agent writing Primer UI with no help failed to compile 8 screens out of 10, because it remembered APIs Primer had removed. So I ran the same 10 tasks again against Primer 38.46, with the MCP served by Primer’s own Storybook.

The short version

  • The MCP fixed the memory problem. Screens that didn’t compile went from 9 of 10 to 4 of 10, and the removed Box and sx almost disappeared.
  • It brought a new one. For Primer’s experimental components, the MCP documents import … from '@primer/react', but Primer 38.46 only exports them from @primer/react/experimental. Most remaining failures were the agent following that import.
  • A type check closed the gap. With the MCP and permission to run tsc, 10 of 10 screens compiled. In 6 tasks the agent hit the wrong import, read the compiler error and fixed it.

What I ran

The same 10 everyday UI tasks as before: a sign-up form, a user table, a delete dialog, settings, pricing, an app header, an empty state, alerts, filters and a dashboard. The agent was Claude Code with Sonnet, one run per task, with only @primer/react 38.46 installed. Every file was then compiled against that exact version.

ConditionWhat the agent had
No helpOnly the installed package
Official MCPPrimer’s Storybook 38.46 with @storybook/addon-mcp, connected to the agent. No instructions
MCP + instructionsPlus a six-line CLAUDE.md telling it to call docs-list and docs-show before using a component, as Storybook’s docs suggest
MCP + type checkPlus permission to run npx tsc --noEmit

Results

ConditionDidn’t compileScoreMCP callsTime per taskCost per task
No help9 of 1079017 s$0.06
Official MCP4 of 109541, in 8 tasks54 s$0.11
MCP + instructions5 of 109461, in 10 tasks69 s$0.13
MCP + type check0 of 109968, plus 15 type checks72 s$0.14

Score is the Kata Score (0–100): component usage, screens that compile, hard-coded values and rebuilt components. Cost is the API cost per task reported by Claude Code. For comparison, a rules file listing Primer’s components and their entry points, with no MCP, also reached 0 of 10 in the earlier run.

1. The MCP fixed stale memory

With no help, 8 of the 9 failing screens imported Box or used sx, both removed from Primer. With the MCP, the agent read the docs before writing: it called docs-list and docs-show in 8 of 10 tasks even without instructions, because the server sends its own. Box came back in a single file, in a task where the agent’s only MCP call dropped.

2. The docs gave the wrong import

The failures that remained were a different kind. The agent found the right component in Storybook, then imported it from the wrong place. Here is the same empty state, written with the MCP, and with the MCP plus a type check. Drag the divider.

07-empty-state.tsx · @primer/react 38.46

With the MCP

import { Blankslate } from '@primer/react'; (compiler error: TS2305: Module '@primer/react' has no exported member 'Blankslate')
import { RepoIcon } from '@primer/octicons-react';

<Blankslate border spacious>
  <Blankslate.Visual><RepoIcon /></Blankslate.Visual>
  <Blankslate.Heading>No projects yet</Blankslate.Heading>
</Blankslate>

✕ TS2305: no exported member Blankslate

With the MCP + type check

import { Blankslate } from '@primer/react/experimental';
import { RepoIcon } from '@primer/octicons-react';

<Blankslate border>
  <Blankslate.Visual><RepoIcon /></Blankslate.Visual>
  <Blankslate.Heading>No projects yet</Blankslate.Heading>
</Blankslate>

✓ Compiles

Real outputs from the run, with the UI copy translated and shortened.

The agent did what the docs said. For Blankslate, Card, Table and UnderlinePanels, the MCP’s docs-show returns an import from the package root:

import { Blankslate } from '@primer/react';

In Primer 38.46, all five components the agent got wrong (those four plus DataTable) are only exported from @primer/react/experimental. Adding instructions made the agent use the MCP more, in all 10 tasks, but didn’t reduce failures: following the docs more closely also meant following the wrong import more closely.

3. A type check closed the gap

With permission to run the compiler, the agent’s trace reads like a careful developer’s: list the docs, read the component, write the file, run tsc, see TS2305, fix the import, run tsc again. That happened in 6 of the 10 tasks, and every screen compiled. It cost about one cent and three seconds more per task than the MCP with instructions.

What this means

For design system teams: turn the MCP on. It fixed the most common failure. Then check what your docs say about imports, especially for subpath entry points like experimental, next or deprecated. And let the agent check its own work: a type check, Storybook’s test-run tool with the Vitest addon, and your CI.

For Storybook’s components manifest: it could carry each component’s real entry point, read from the package’s exports map or set per component. I haven’t traced where the manifest takes the import from yet.

The pattern is the same as before. In our EUI tests, docs reduced errors and only a check removed them. Docs tell the agent what’s right; checks tell it when it’s wrong. It needs both.

Method and limits

The harness, prompts and raw outputs are available on request: hola@nobori.studio.

How does your design system do?

The same 10 tasks, run on your package, with a two-page report in two business days. Free.

Get a free score