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
Boxandsxalmost 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.
| Condition | What the agent had |
|---|---|
| No help | Only the installed package |
| Official MCP | Primer’s Storybook 38.46 with @storybook/addon-mcp, connected to the agent. No instructions |
| MCP + instructions | Plus 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 check | Plus permission to run npx tsc --noEmit |
Results
| Condition | Didn’t compile | Score | MCP calls | Time per task | Cost per task |
|---|---|---|---|---|---|
| No help | 9 of 10 | 79 | 0 | 17 s | $0.06 |
| Official MCP | 4 of 10 | 95 | 41, in 8 tasks | 54 s | $0.11 |
| MCP + instructions | 5 of 10 | 94 | 61, in 10 tasks | 69 s | $0.13 |
| MCP + type check | 0 of 10 | 99 | 68, plus 15 type checks | 72 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.
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
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
- 10 tasks, one run each, one model. Treat a difference of one or two screens as noise: 4 versus 5 failures is not a real gap.
- Primer’s Storybook ran locally from the
@primer/react@38.46.0tag (Storybook 10.6.5), with the MCP’s docs tools only. It has no Vitest addon, so notest-runtool. - With four agents in parallel, 17 of 170 MCP calls dropped with a connection reset. Failures didn’t follow them: 3 of the 5 failing screens with instructions had none, and every screen with the type check compiled despite them.
- The no-help condition was rerun the same day: 9 of 10 failed, against 8 of 10 in the first run.
- Task prompts were written in Spanish, so the agent wrote Spanish UI copy. It doesn’t affect imports or compilation.
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