Back to blog

Storybook MCP for React

Storybook-powered agentic UI development

loading
Kyle Gach
@kylegach
Last updated:

Agents don’t know anything about your components so they make up slop that doesn’t match your coding standards. Storybook MCP gives agents intelligence and test guardrails to keep on track:

  1. Context about your existing components to reuse
  2. Instructions to write stories and preview their work
  3. Ability to run tests and fix their own issues
0:00
/0:19
💁
“But what about skills?”
We’re investing in both. Skills are a helpful way to teach agents how to accomplish tasks. But MCP is required for back-and-forth communication with agents to power self-healing testing.

Force agents to use your components

Storybook MCP equips agents with component metadata like stories, API, and docs. This allows agents to reuse existing components instead of inventing new patterns. It does this faster and with fewer tokens compared to not using MCP.

All numbers compare Baseline vs. MCP Docs. Quality: 12.8% improved code usage. Speed: 2.76x faster duration. Cost: 27% fewer tokens used.
Benchmarks from generating UI with the Reshaped component library, with and without Storybook MCP

Share UI context across teams

Teams often split their app and design system into separate Storybooks. To generate UI with components from more than one Storybook, you can use the MCP server together with composition.

Design system components, Application components, and Third-party components are all composed into input for the MCP Server which communicates with the Agents
Agents can read data from composition without needing to connect with multiple endpoints.

Publish remote MCP
Publish your Storybook MCP server to share component context with your team without running Storybook locally. Teammates can add the published MCP to their agent, even if their project doesn’t use Storybook.

Chromatic supports publishing Storybook MCP out of the box for free. It also comes with quality checks, versioning, and secure authorization built-in.

Review agent work with story previews

When an agent is finished, it summarizes its work. Instead of a wall of text, Storybook MCP embeds live stories directly inside the chat UI. You can verify the look and feel of the generated UI, including interactions like hover states, without leaving the client.

The live story is embedded directly in the agent chat interface via MCP Apps. A link to that story is also included for deeper inspection.

Agents self-verify with tests

The MCP server gives your agent tools to run component and accessibility tests. It only tests what it deems relevant, making the feedback loop fast and focused. When the agent kicks off a test run, you see the results stream into Storybook's UI.

If there are errors, the agent applies fixes itself or alerts the developer when human judgement is needed.

[insert animated gif of prompt + SB in simple browser]

Get started

Storybook MCP is available now in Storybook 10.3 for React projects. Try it now below or read the full installation docs. MCP support for other frameworks coming later this year.

Upgrade to version 10.3+:

npx storybook@latest upgrade

Install and register the addon:

npx storybook add @storybook/addon-mcp

Add the MCP server to your client:

npx mcp-add --type http --url "http://localhost:6006/mcp" --scope project

Join the Storybook mailing list

Get the latest news, updates and releases

7,874 developers and counting

We’re hiring!

Join the team behind Storybook and Chromatic. Build tools that are used in production by 100s of thousands of developers. Remote-first.

View jobs

Popular posts

Announcing Storybook 3.3

Angular Support, Device Viewports, Test Improvements, & more!
loading
Michael Shilman

Storybook wins an open source award

Most impactful contribution to the community
loading
Norbert de Langen

Introducing: Storybook for Vue 🎉

First of many “Storybook for <insert framework here>”
loading
Norbert de Langen
Join the community
7,874 developers and counting
WhyWhy StorybookComponent-driven UI
DocsGuidesTutorialsChangelogTelemetry
CommunityAddonsGet involvedBlog
ShowcaseExploreAbout
Open source software
Storybook

Maintained by
Chromatic
Special thanks to Netlify and CircleCI